Repository navigation
refactor(ra): name the complete registration phase vocabulary - #137
csnitker-godaddy wants to merge 1 commit into
Conversation
kperry-godaddy
left a comment
There was a problem hiding this comment.
The change is harmless and the wire values don't move, so there is nothing to worry about in the diff itself. What shapes my read is where the PR is aimed. internal/ra/handler/dto.go is byte-identical on main and on fix/renewal-publication, so this doesn't depend on #128: it is queued behind a stack that has changes requested on it for no reason, "Fixes #134" can't auto-close from a non-default base (https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue), and if #128 is squash-merged with its branch deleted, GitHub retargets this PR to main with #128's commits in its diff.
I'd settle that before anything else:
git fetch origin
git rebase --onto origin/main origin/fix/renewal-publication fix/ra-certificate-phase-constant
git push --force-with-lease
gh pr edit 137 --base mainOne note inline on the constant itself, about what the linter actually reports and how far the extraction goes.
|
|
||
| // ----- AgentStatus (matches V2 spec §1133) ----- | ||
|
|
||
| const phaseCertificateIssuance = "CERTIFICATE_ISSUANCE" |
There was a problem hiding this comment.
Two things on this line. First, the premise: with the repo's .golangci.yml and the pinned golangci-lint v2.11.4, ./internal/ra/handler/... reports zero issues on the base as well as here, so no repeated-string rule was failing before this change. If a different invocation produced the goconst report behind #134, it would be worth recording that command in the PR. Second, if the phase vocabulary is worth naming, it is worth naming once: DOMAIN_VALIDATION still appears five times in these three functions, DNS_PROVISIONING three times, INITIALIZATION once, and COMPLETED is borrowed from renewalStatusCompleted, a renewal-status constant standing in for a phase. These five strings are the AgentStatus.phase enum at spec/api-spec-v2.yaml:2069:
// AgentStatus phase and step vocabulary (spec/api-spec-v2.yaml, AgentStatus.phase enum).
const (
phaseInitialization = "INITIALIZATION"
phaseDomainValidation = "DOMAIN_VALIDATION"
phaseCertificateIssuance = "CERTIFICATE_ISSUANCE"
phaseDNSProvisioning = "DNS_PROVISIONING"
phaseCompleted = "COMPLETED"
)with phaseFor, completedStepsFor and pendingStepsFor switched over. Either shape is fine with me once the base is sorted; dto_more_test.go keeps pinning the wire values.
There was a problem hiding this comment.
Rebased this PR onto main and named all five phase values with dedicated constants, including a phase-specific COMPLETED. The description now treats this as vocabulary cleanup and makes no claim of a reproduced lint failure.
6ae1e7e to
d1cda69
Compare
Signed-off-by: Connor Snitker <csnitker@godaddy.com>
d1cda69 to
b472fde
Compare
Define dedicated constants for all five
AgentStatus.phasevalues and usethem consistently in phase and completed/pending step mappings. COMPLETED
now uses the phase vocabulary instead of borrowing a renewal-status constant.
Values and response fields remain unchanged from the
AgentStatus.phaseenum in
spec/api-spec-v2.yaml. This cleanup is independent of the RA/TLdeployment stack.
Canonical phase vocabulary in
spec/api-spec-v2.yaml,AgentStatus.phase:No field or enum value changes.
Fixes #134.
AI assistance
Assisted-by: Codex (GPT-6), under Connor Snitker's direction.