AI review bug fixing

This commit is contained in:
Matej Bačo committed 2025-09-11 15:02:44 +02:00
1 parent 039a2361b4
commit cdb400b538
8 files changed
+20 -19

No files matched your search

+8 -8
View File
@@ -66,9 +66,9 @@ class DNS extends Validator
$msg = "Domain {$this->domain} has {$this->count} {$this->type} {$record} with wrong {$value}: {$recordValuesVerbose}.";
if ($this->type === self::RECORD_CAA) {
$msg .= ' You can resolve this by adding our record too (recommended), or removing all other records.';
$msg .= ' You can resolve this by adding our record (recommended), or removing all other records.';
} elseif ($this->type === self::RECORD_A || $this->type === self::RECORD_AAAA || $this->type === self::RECORD_CNAME) {
$msg .= ' You can resolve this by changing the record to haveour value.';
$msg .= ' You can resolve this by changing the record to have our value.';
}
return $msg;
@@ -90,16 +90,16 @@ class DNS extends Validator
*/
public function isValid(mixed $value): bool
{
$this->count = 0;
$this->domain = \is_string($value) ? $value : \strval($value);
$this->reason = self::FAILURE_REASON_UNKNOWN;
$this->recordValues = [];
if (!is_string($value)) {
if (!\is_string($value)) {
$this->reason = self::FAILURE_REASON_INTERNAL;
return false;
}
$this->count = 0;
$this->domain = \strval($value);
$this->reason = self::FAILURE_REASON_UNKNOWN;
$this->recordValues = [];
$dns = new Client($this->dnsServer);
try {
+2 -2
View File
@@ -35,7 +35,8 @@ class Base extends Action
if (!\is_null($log)) {
$log->addExtra('dnsTimingCaa', \strval(\microtime(true) - $validationStart));
$log->addTag('dnsDomain', $domain->get());
$error = $validator->getDescription();
$error = $validator->getLogs();
$log->addExtra('dnsResponse', \is_array($error) ? \json_encode($error) : \strval($error));
}
@@ -122,7 +123,6 @@ class Base extends Action
$errors[] = $validator->getLogs();
}
}
$error = \implode("\n", $errors);
$log->addExtra('dnsResponse', \is_array($error) ? \json_encode($error) : \strval($error));
}
@@ -161,10 +161,10 @@ class Create extends Base
'region' => $project->getAttribute('region')
]);
if ($status === 'created') {
if ($rule->getAttribute('status', '') === 'created') {
try {
self::verifyRule($rule, $log);
$status = 'verifying';
$rule->setAttribute('status', 'verifying');
} catch (Exception $err) {
$rule->setAttribute('verificationLogs', $err->getMessage());
}
@@ -182,10 +182,10 @@ class Create extends Base
'region' => $project->getAttribute('region')
]);
if ($status === 'created') {
if ($rule->getAttribute('status', '') === 'created') {
try {
self::verifyRule($rule, $log);
$status = 'verifying';
$rule->setAttribute('status', 'verifying');
} catch (Exception $err) {
$rule->setAttribute('verificationLogs', $err->getMessage());
}
@@ -188,10 +188,10 @@ class Create extends Base
'region' => $project->getAttribute('region')
]);
if ($status === 'created') {
if ($rule->getAttribute('status', '') === 'created') {
try {
self::verifyRule($rule, $log);
$status = 'verifying';
$rule->setAttribute('status', 'verifying');
} catch (Exception $err) {
$rule->setAttribute('verificationLogs', $err->getMessage());
}
@@ -182,10 +182,10 @@ class Create extends Base
'region' => $project->getAttribute('region')
]);
if ($status === 'created') {
if ($rule->getAttribute('status', '') === 'created') {
try {
self::verifyRule($rule, $log);
$status = 'verifying';
$rule->setAttribute('status', 'verifying');
} catch (Exception $err) {
$rule->setAttribute('verificationLogs', $err->getMessage());
}
@@ -87,6 +87,7 @@ class Update extends Base
$rule = $rule->setAttribute('verificationLogs', '');
} catch (Exception $err) {
$rule = $rule->setAttribute('verificationLogs', $err->getMessage());
$dbForPlatform->updateDocument('rules', $rule->getId(), $rule);
throw $err;
}
@@ -94,7 +94,7 @@ class Certificates extends Action
$domainType = $document->getAttribute('domainType');
$skipRenewCheck = $payload['skipRenewCheck'] ?? false;
$action = $payload['action'] ?? [];
$action = $payload['action'] ?? Certificate::ACTION_GENERATION;
$verificationDomainFunction = $payload['verificationDomainFunction'] ?? null;
$verificationDomainApi = $payload['verificationDomainApi'] ?? null;