Skip to content

refactor: port routes_gitops.go self-upgrade to ops.RegisterSelfUpgrade (epic #23725 slice 2b.7) [architect] - #23754

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
arch/23725-slice-2b7-routes-gitops
Sep 26, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
arch/23725-slice-2b7-routes-gitops

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Refactor

Move the two /self-upgrade routes out of the hand-rolled block in
setupGitOpsRoutes into a file-scoped ops.RegisterSelfUpgrade function
in pkg/api/handlers/ops/registrar.go.

Route order and paths are byte-for-byte identical to the previous block,
so fiber's first-match semantics and the existing wiring tests are
unchanged.

Why file-scoped registrars, not a monolithic ops.Register

Each ops handler (air-gap, manifest, notifications, onboarding, ping,
self-upgrade, timeline, token-usage) is wired from a different route
file in pkg/api. A monolithic ops.Register would either register
routes not wanted by a given caller or force every caller to import the
whole ops surface. Individual RegisterXxx functions let each caller
wire only what it needs.

Why the signature is domain-local (not handlers.Registrar)

The parent pkg/api/handlers package still imports
pkg/api/handlers/ops through ops_aliases.go, so this subpackage
cannot import the parent's Deps/Registrar types without an import
cycle. Slice 2c collapses all domain registrars onto a shared signature
once the final _aliases.go files are retired — same pattern followed
by slice 2b.6 (#23753).

Diff shape

  • pkg/api/handlers/ops/registrar.go (new, 37 LOC)
  • pkg/api/routes_gitops.go (4 LOC → 5 LOC for the ported block)

Refs #23725 (slice 2b.7; ops handlers in routes_auth / route_group_feedback / route_group_public / routes_integrations / route_group_api_core still ahead)


Filed by architect agent (ACMM L6 — full mode)

— hive: agent=architect backend=copilot model=claude-opus-4.7 copilot=1.0.88

…s.RegisterSelfUpgrade (epic #23725 slice 2b.7)

Move the two /self-upgrade routes out of the hand-rolled block in
setupGitOpsRoutes into a file-scoped ops.RegisterSelfUpgrade function in
pkg/api/handlers/ops/registrar.go. Route order and paths are byte-for-byte
identical to the previous block, so fiber's first-match semantics and
the existing wiring tests are unchanged.

A file-scoped registrar is used rather than a monolithic ops.Register
because each ops handler (air-gap, manifest, notifications, onboarding,
ping, self-upgrade, timeline, token-usage) is wired from a different
route file in pkg/api. Individual RegisterXxx functions let each caller
wire only what it needs.

Signature is domain-local (not handlers.Registrar) because the parent
pkg/api/handlers package still imports pkg/api/handlers/ops via
ops_aliases.go, so this subpackage cannot import the parent's
Deps/Registrar types without an import cycle. Slice 2c unifies
signatures once the _aliases.go files are retired.

Refs #23725 (slice 2b.7; ops handlers in routes_auth/feedback/public/integrations/api-core still ahead)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: kubestellar-hive[bot] <223556219+Copilot@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Sep 26, 2026
@netlify

netlify Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kubestellarconsole canceled.

Name Link
🔨 Latest commit e528cbe
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6ab7bdcad904e20008e7c6cf

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mikespreitzer for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @hivecommons-hive[bot] — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@github-actions github-actions Bot added the ai-generated Pull request generated by AI label Sep 26, 2026
@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 26, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit b366fba into main Sep 26, 2026
41 of 42 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the arch/23725-slice-2b7-routes-gitops branch September 26, 2026 13:12
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@github-actions

Copy link
Copy Markdown
Contributor

Post-merge build verification passed ✅

Both Go and frontend builds compiled successfully against merge commit b366fba203130c0f3f2c6272930a9906c8af5aeb.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Post-Merge Verification: passed

Commit: b366fba203130c0f3f2c6272930a9906c8af5aeb
Specs run: smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/36244378109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull request generated by AI dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tier/2-standard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant