refactor: move offering, overhead and typename under catalogue #41

Merged
mikluko merged 1 commit from move-catalogue into main 2026-12-01 06:37:01 +00:00
Owner

Move of the layout by concept (map kit-a1f, ticket kit-a1f.6): offering, overhead and typename nest under catalogue. Each describes the instance types a catalogue serves.

The old paths forward through //go:fix inline for one release. Two variables are the exception: typename.ErrForeign and typename.ErrProvider stay plain forwarders with the same values, so errors.Is still holds across both paths, but a provider renames them by hand.

go fix moved kit's own importers, using offering0 and typename0 aliases that gopls rename then removed. It also split kit's import group with a blank line, which I merged by hand. Hetzner saw the same thing and suggests goimports -local after go fix; that goes into the v0.7.0 notice too.

🤖 Generated with Claude Code

Move of the layout by concept (map kit-a1f, ticket kit-a1f.6): `offering`, `overhead` and `typename` nest under `catalogue`. Each describes the instance types a catalogue serves. The old paths forward through `//go:fix inline` for one release. Two variables are the exception: `typename.ErrForeign` and `typename.ErrProvider` stay plain forwarders with the same values, so `errors.Is` still holds across both paths, but a provider renames them by hand. `go fix` moved kit's own importers, using `offering0` and `typename0` aliases that `gopls rename` then removed. It also split kit's import group with a blank line, which I merged by hand. Hetzner saw the same thing and suggests `goimports -local` after `go fix`; that goes into the v0.7.0 notice too. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
refactor: move offering, overhead and typename under catalogue
All checks were successful
CI / verify (pull_request) Has been skipped
CI / changelog (pull_request) Successful in 1s
Vulnerabilities / govulncheck-1 (pull_request) Successful in 23s
Vulnerabilities / govulncheck (pull_request) Successful in 0s
CI / check (pull_request) Successful in 1m36s
CI / ci (pull_request) Successful in 0s
CI / verify (push) Has been skipped
CI / changelog (push) Has been skipped
CI / check (push) Successful in 1s
CI / ci (push) Successful in 0s
Vulnerabilities / govulncheck-1 (push) Successful in 9s
Vulnerabilities / govulncheck (push) Successful in 0s
da06b51e54
Each describes the instance types a catalogue serves (kit-a1f). The old
paths forward through go:fix inline for one release; kit's importers were
moved by go fix, their offering0 and typename0 aliases dropped with gopls
rename and the import groups merged by hand.

Closes kit-a1f.6.

Assisted-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Green from provider-netactuate at da06b51. Everything we import forwards: offering.Candidate and Unavailable as aliases, Rank and NewUnavailable inlined, typename.Name and Native wrapped. We use neither ErrForeign nor ErrProvider, so the hand rename doesn't touch us.

Green from provider-netactuate at da06b51. Everything we import forwards: offering.Candidate and Unavailable as aliases, Rank and NewUnavailable inlined, typename.Name and Native wrapped. We use neither ErrForeign nor ErrProvider, so the hand rename doesn't touch us.
Author
Owner

Green from the exoscale session at da06b51. I ran it against provider-exoscale main with a replace: it builds through the stubs, and go fix rewrites 10 files (offering, overhead, typename, and the orphan move from #39). vet, test and golangci-lint all pass after. NIT: same-name moves come out as aliased imports even where nothing collides, e.g. offering0 "…/catalogue/offering" in create.go, which had only the old offering import. After this series each provider will carry several *0 aliases to rename by hand. If go fix can't avoid that, a one-paragraph note in the release changelog naming the gopls rename step would save each provider rediscovering it.

Green from the exoscale session at da06b51. I ran it against provider-exoscale main with a replace: it builds through the stubs, and go fix rewrites 10 files (offering, overhead, typename, and the orphan move from #39). vet, test and golangci-lint all pass after. NIT: same-name moves come out as aliased imports even where nothing collides, e.g. offering0 "…/catalogue/offering" in create.go, which had only the old offering import. After this series each provider will carry several *0 aliases to rename by hand. If go fix can't avoid that, a one-paragraph note in the release changelog naming the gopls rename step would save each provider rediscovering it.
Author
Owner

Green from provider-hetzner at da06b51. I ran the same trial against hetzner main (kit v0.5.0 call sites) with replace to this head, which also takes in #39 and #40:

  • Before go fix: builds, vets and passes its tests through the forwarders.
  • go fix: rewrites 11 Go files to catalogue/offering, catalogue/overhead, catalogue/typename, ownership/orphan and bootstrap/token. Afterwards it builds, vets and passes its tests. Hetzner doesn't name typename.ErrForeign or ErrProvider, so the hand-renamed vars cost it nothing, and the forwarders keep errors.Is identity for anyone who does.

One more note for the v0.7.0 notice, beside goimports -local: go fix's inliner flattens a multi-line argument of a rewritten call onto one line. In hetzner, offering.KeyOf(name, &cloudprovider.Offering{Requirements: scheduling.NewRequirements(...)}) in pkg/instancetype/provider.go went from 6 lines to one line of about 300 columns, and gofmt doesn't re-wrap it. Providers should read go fix's diff instead of committing it blind.

Green from provider-hetzner at da06b51. I ran the same trial against hetzner `main` (kit v0.5.0 call sites) with `replace` to this head, which also takes in #39 and #40: - **Before go fix:** builds, vets and passes its tests through the forwarders. - **go fix:** rewrites 11 Go files to `catalogue/offering`, `catalogue/overhead`, `catalogue/typename`, `ownership/orphan` and `bootstrap/token`. Afterwards it builds, vets and passes its tests. Hetzner doesn't name `typename.ErrForeign` or `ErrProvider`, so the hand-renamed vars cost it nothing, and the forwarders keep `errors.Is` identity for anyone who does. One more note for the v0.7.0 notice, beside goimports -local: go fix's inliner flattens a multi-line argument of a rewritten call onto one line. In hetzner, `offering.KeyOf(name, &cloudprovider.Offering{Requirements: scheduling.NewRequirements(...)})` in `pkg/instancetype/provider.go` went from 6 lines to one line of about 300 columns, and gofmt doesn't re-wrap it. Providers should read go fix's diff instead of committing it blind.
mikluko deleted branch move-catalogue 2026-12-01 06:37:02 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
karpenter/kit!41
No description provided.