feat: define and document repository structure version 1 - #145
Open
weatherhog wants to merge 1 commit into
Open
Conversation
The structure this repository prescribes had no version, so a fork carried no marker of which generation of the layout it was built from and there was no way to tell it had fallen behind. The repository has exactly one tag (v0.1.0, September 2022) and every structural change since sits in a single Unreleased CHANGELOG section. docs/repo_structure.md now declares the current layout as structure version 1 and says what does and does not warrant a bump. `kubectl gs gitops` records the version in a .gitops-metadata.yaml file in the repositories it generates, and `kubectl gs gitops check` reports the parts of a repository generated with an older one. This repository ships its own .gitops-metadata.yaml so that forks start pinned at version 1. It lists no layers: the trees under management-clusters/ and bases/ here are examples rather than generated layers, and a fork can record its real ones with `check --adopt`. Bumping the version here requires bumping StructureVersion in kubectl-gs to match. Nothing enforces the lockstep; it is a convention. Towards giantswarm/giantswarm#23540
|
Semantic YAML source diff — key reordering without value changes is ignored. Output@@ .gitops-metadata.yaml @@
(Added — see file diff in PR for content)Suppress with |
Open
1 task
Validation output log |
Rendered manifest diff output log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Declares the layout this repository prescribes as structure version 1, and adds a
Structure Version
section to
docs/repo_structure.mddefining what does and does not warrant a bump.Also ships a
.gitops-metadata.yamlat the repository root so that forks start pinned at version 1.Why
The structure had no version. A fork carried no marker of which generation of the layout it was
built from, so there was no way to tell it had fallen behind — and no way to enumerate what would
need updating. This repository has exactly one tag (
v0.1.0, September 2022), zero publishedreleases, and every structural change since sits in a single
## UnreleasedCHANGELOG section.Companion PR
Pairs with giantswarm/kubectl-gs#2081, which teaches
kubectl gs gitopsto record theversion in the repositories it generates and adds
kubectl gs gitops checkto report drift.Neither PR breaks without the other, but the docs here describe a command that only exists once
the kubectl-gs side is released — the new section says so explicitly.
Why
layers: []in the shipped fileThe trees under
management-clusters/andbases/here are examples, not generated layers.Listing them would create an inventory that rots every time an example is added. A fork records
its real layers with
kubectl gs gitops check --adopt. Staleness is harmless either way:checkcompares versions, never completeness.
What is being committed to
Shipping
structureVersion: 1obliges someone to bump it when the layout changes, and to say whatchanged. Nothing enforces the lockstep between the number here and
StructureVersioninkubectl-gs/internal/gitops/metadata/types.go— it is a convention, documented in both repos. Ifreviewers want that enforced by CI rather than by discipline, say so and I will add it.
What this does not do
This is the detection half of giantswarm/giantswarm#23540. Migration and upgrade tooling is
untouched — the part described in
March 2025 as an
open product feature. The issue stays open.
What is needed from the reviewers
1is the right starting point, i.e. that today'smainis the baseline..gitops-metadata.yamlin every fork is acceptable.Verification
The new root file is invisible to every PR check:
tools/test-all-fffiltersfindoutput byapi.*\.fluxcd\.ioand this file does not match;tests/ats/conftest.pyonly appliesmanagement-clusters/<dir>/<dir>.yaml; the only top-level Flux Kustomization haspath: ./management-clusters/MC_NAME.yamllintpasses and no added markdown line exceedsMD013's 120 characters.
Related: giantswarm/giantswarm#23540