feat(bootstrap): FLUX_BRANCH, damit die Flux-Phase probelaufen kann #717

Merged
k.renner merged 1 commits from flux-branch-rehearsal into master 2026-08-29 06:46:08 +00:00
Member

Das eine Stück aus #711, das nach dem Merge von #716 noch übrig und unstrittig ist.

Beide flux bootstrap-Aufrufe hatten --branch=master fest verdrahtet. Deshalb konnte die Flux-Phase nie vor dem Ernstfall ausprobiert werden: flux bootstrap committet seine eigenen Sync-Manifeste in den Branch, den es reconciled — ein Testlauf hätte also in genau die Quelle geschrieben, von der ein Rebuild abhängt.

FLUX_BRANCH defaultet auf master. Der Wegwerf-Branch muss vorher existieren — flux bootstrap klont ihn und scheitert sonst mit couldn't find remote ref, statt ihn anzulegen. Das ist nicht offensichtlich, deshalb steht es im Kommentar samt beider Befehle.

Gegen ein Scratch-Cluster erprobt: flux bootstrap klont den genannten Branch, committet seine Manifeste dorthin und installiert die Controller. Die Waits danach brauchen echte Platten und wurden nicht ausgeführt.

Warum der Rest von #711 nicht mitkommt

Commit Warum nicht
$HOME-Isolation steckt bereits in master, über #716
Docker-Selftest von vmtest überholt — echtes Factory-Image, drei Nodes, derselbe Codepfad
--insecure-Flag-Fix behebt einen Bug in patch_for_machine, und die Funktion existiert in master nicht. Der Fehler steckt ausschließlich in nie gemergtem Code
Chassis-Serial-Marker + serienbasierte Identifikation nie gemergt, und das Design kollidiert jetzt mit NODE_ADDRS aus #716

Der letzte Punkt ist eine offene Entscheidung, keine erledigte Sache: NODE_ADDRS löst „welche Adresse" positionsbasiert, die Serial-Identifikation löste „welche Maschine ist das überhaupt". Beim Cold Rebuild ohne DNS ist das nicht dasselbe. Ob das noch gebraucht wird, gehört separat entschieden — deshalb ist es hier nicht mit hineingemischt.

Das eine Stück aus #711, das nach dem Merge von #716 noch übrig und unstrittig ist. Beide `flux bootstrap`-Aufrufe hatten `--branch=master` fest verdrahtet. Deshalb konnte die Flux-Phase nie vor dem Ernstfall ausprobiert werden: `flux bootstrap` committet seine eigenen Sync-Manifeste in den Branch, den es reconciled — ein Testlauf hätte also in genau die Quelle geschrieben, von der ein Rebuild abhängt. `FLUX_BRANCH` defaultet auf `master`. Der Wegwerf-Branch **muss vorher existieren** — `flux bootstrap` klont ihn und scheitert sonst mit `couldn't find remote ref`, statt ihn anzulegen. Das ist nicht offensichtlich, deshalb steht es im Kommentar samt beider Befehle. Gegen ein Scratch-Cluster erprobt: `flux bootstrap` klont den genannten Branch, committet seine Manifeste dorthin und installiert die Controller. Die Waits danach brauchen echte Platten und wurden nicht ausgeführt. ## Warum der Rest von #711 nicht mitkommt | Commit | Warum nicht | |---|---| | `$HOME`-Isolation | steckt bereits in master, über #716 | | Docker-Selftest | von `vmtest` überholt — echtes Factory-Image, drei Nodes, derselbe Codepfad | | `--insecure`-Flag-Fix | behebt einen Bug in `patch_for_machine`, und die Funktion existiert in master nicht. Der Fehler steckt ausschließlich in nie gemergtem Code | | Chassis-Serial-Marker + serienbasierte Identifikation | nie gemergt, und das Design kollidiert jetzt mit `NODE_ADDRS` aus #716 | Der letzte Punkt ist eine offene Entscheidung, keine erledigte Sache: `NODE_ADDRS` löst „welche Adresse" positionsbasiert, die Serial-Identifikation löste „welche Maschine ist das überhaupt". Beim Cold Rebuild ohne DNS ist das nicht dasselbe. Ob das noch gebraucht wird, gehört separat entschieden — deshalb ist es hier nicht mit hineingemischt.
claude-bot added 1 commit 2026-08-29 06:37:45 +00:00
feat(bootstrap): make the flux branch configurable so the phase can be rehearsed
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
ci/woodpecker/pr/pr-review Pipeline was successful
9c5ed5dfcf
Both bootstrap calls hardcoded --branch=master, which is why the flux phase could
never be tried before it was needed: `flux bootstrap` commits its own sync
manifests into the branch it reconciles, so running it wrote to the source a
rebuild depends on.

FLUX_BRANCH defaults to master and can be pointed at a throwaway branch. That
branch has to exist first — `flux bootstrap` clones it and fails with
`couldn't find remote ref` rather than creating it, which is not obvious and is
why the comment spells the two commands out.

Rehearsed against a scratch cluster to establish that: `flux bootstrap` clones
the named branch, commits its manifests there, and installs the controllers. The
waits after it need real disks and were not exercised.

Nothing else about the phase changes, which is the point — a rehearsal that takes
a different code path proves less than one that takes the same one.
review-bot left a comment
Member

🤖 Automated review — model claude-haiku-4-5-20251001 (complexity: trivial), commit 9c5ed5dfcfd1da95c2a0604d73db7a2571aa2247.

Advisory review by the review-bot pipeline. It never approves; a human merges. Push new commits to get a fresh review.


Summary

This PR introduces a FLUX_BRANCH environment variable to allow testing the Flux bootstrap phase against a separate branch instead of always writing to master. The implementation is clean, properly documented, and maintains backward compatibility by defaulting to master. Both hardcoded --branch=master instances have been correctly replaced, and the change enables rehearsals of a critical phase without affecting production.

🟢 Nits

  • Line 82: The example command git push origin origin/master:refs/heads/rehearsal-1 is helpful, but could be slightly clearer by using git branch instead (e.g., git checkout -b rehearsal-1 origin/master && git push -u origin rehearsal-1). However, the current form works and the documentation is clear enough.

Tests

Testing appears adequate for this feature:

  • The author tested against a scratch cluster and confirmed that flux bootstrap successfully clones the branch, commits sync manifests, and installs controllers.
  • The limitation that the branch must exist beforehand (with the expected error message) was verified.
  • Full end-to-end testing with waits is hardware-dependent but the critical path (bootstrap itself) was exercised.

For future verification, a simple integration test could confirm:

  1. Setting FLUX_BRANCH to a custom value properly passes it to both flux bootstrap github and flux bootstrap gitea commands
  2. The variable correctly defaults to master when unset

Recommendation

Looks reasonable — no blocking issues; the nit above is optional.

🤖 **Automated review** — model `claude-haiku-4-5-20251001` (complexity: trivial), commit `9c5ed5dfcfd1da95c2a0604d73db7a2571aa2247`. > Advisory review by the `review-bot` pipeline. It never approves; a human merges. Push new commits to get a fresh review. --- ## Summary This PR introduces a `FLUX_BRANCH` environment variable to allow testing the Flux bootstrap phase against a separate branch instead of always writing to master. The implementation is clean, properly documented, and maintains backward compatibility by defaulting to master. Both hardcoded `--branch=master` instances have been correctly replaced, and the change enables rehearsals of a critical phase without affecting production. ## 🟢 Nits - Line 82: The example command `git push origin origin/master:refs/heads/rehearsal-1` is helpful, but could be slightly clearer by using `git branch` instead (e.g., `git checkout -b rehearsal-1 origin/master && git push -u origin rehearsal-1`). However, the current form works and the documentation is clear enough. ## Tests Testing appears adequate for this feature: - The author tested against a scratch cluster and confirmed that `flux bootstrap` successfully clones the branch, commits sync manifests, and installs controllers. - The limitation that the branch must exist beforehand (with the expected error message) was verified. - Full end-to-end testing with waits is hardware-dependent but the critical path (bootstrap itself) was exercised. For future verification, a simple integration test could confirm: 1. Setting `FLUX_BRANCH` to a custom value properly passes it to both `flux bootstrap github` and `flux bootstrap gitea` commands 2. The variable correctly defaults to `master` when unset ## Recommendation Looks reasonable — no blocking issues; the nit above is optional. <!-- pr-review:sha=9c5ed5dfcfd1da95c2a0604d73db7a2571aa2247 -->
k.renner merged commit 6c74bf7674 into master 2026-08-29 06:46:08 +00:00
Sign in to join this conversation.