Skip to content

refactor(ra): name the complete registration phase vocabulary - #137

Open
csnitker-godaddy wants to merge 1 commit into
mainfrom
fix/ra-certificate-phase-constant
Open

csnitker-godaddy wants to merge 1 commit into
mainfrom
fix/ra-certificate-phase-constant

Conversation

@csnitker-godaddy

@csnitker-godaddy csnitker-godaddy commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Define dedicated constants for all five AgentStatus.phase values and use
them 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.phase
enum in spec/api-spec-v2.yaml. This cleanup is independent of the RA/TL
deployment stack.

Canonical phase vocabulary in spec/api-spec-v2.yaml, AgentStatus.phase:

phase:
  type: string
  enum: [INITIALIZATION, DOMAIN_VALIDATION, CERTIFICATE_ISSUANCE, DNS_PROVISIONING, COMPLETED]

No field or enum value changes.

Fixes #134.

AI assistance

Assisted-by: Codex (GPT-6), under Connor Snitker's direction.

@kperry-godaddy kperry-godaddy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 main

One note inline on the constant itself, about what the linter actually reports and how far the extraction goes.

Comment thread internal/ra/handler/dto.go Outdated

// ----- AgentStatus (matches V2 spec §1133) -----

const phaseCertificateIssuance = "CERTIFICATE_ISSUANCE"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@csnitker-godaddy
csnitker-godaddy force-pushed the fix/ra-certificate-phase-constant branch from 6ae1e7e to d1cda69 Compare October 2, 2026 18:17
@csnitker-godaddy csnitker-godaddy changed the title refactor(ra): share certificate issuance phase constant refactor(ra): name the complete registration phase vocabulary Oct 2, 2026
@csnitker-godaddy
csnitker-godaddy changed the base branch from fix/renewal-publication to main October 2, 2026 18:18
Signed-off-by: Connor Snitker <csnitker@godaddy.com>
@csnitker-godaddy
csnitker-godaddy force-pushed the fix/ra-certificate-phase-constant branch from d1cda69 to b472fde Compare October 2, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

Deduplicate the RA certificate issuance phase literal

2 participants