examples/minimal: run a pinned city revision when CITY_REVISION is set #113

Merged
mikluko merged 2 commits from examples-city-revision into main 2026-11-16 19:24:27 +00:00
Owner

examples/minimal/k8s/files/start.sh resets the city's checkout to CITY_REVISION when it is set, and to the upstream's head as before when it is not. The statefulset names the variable as optional, unset by default. This is the twin of saraksh/kube #155, so a deployer can pin the city to a commit and have a change of the commit restart the pod once.

`examples/minimal/k8s/files/start.sh` resets the city's checkout to `CITY_REVISION` when it is set, and to the upstream's head as before when it is not. The statefulset names the variable as optional, unset by default. This is the twin of saraksh/kube #155, so a deployer can pin the city to a commit and have a change of the commit restart the pod once.
examples/minimal: run a pinned city revision when CITY_REVISION is set
All checks were successful
test / changelog (pull_request) Successful in 4s
test / go (pull_request) Successful in 56s
1a4cc368fe
Assisted-By: Claude <noreply@anthropic.com>
Author
Owner

Review at head 1a4cc36 on main b84db7c. The script's change is right; three small things in what surrounds it, then it merges. This comment is complete by itself.

What holds, each run by me: shellcheck on examples/minimal/k8s/files/start.sh is clean; kubectl kustomize examples/minimal/k8s renders; the script differs from saraksh/kube's (merged as #155 there, rolled on the city today, where the checkout came up on its branch at the pinned commit) only in the two example hosts and the header's wrapping. On a scratch clone git reset -q --hard <commit> gave the right tree forward, backward, over a modified tracked file and over an untracked file in the way, and a later unpinned start resets to the upstream's head.

1. The commented-out env entry goes; the README says the option

examples/minimal/k8s/statefulset.yaml gains

# - name: CITY_REVISION
#   value: <commit>

That is commented-out code, which this repository's owner does not take in a commit. Remove the four added lines from the manifest. The option belongs where a deployer reads what the pod does: examples/minimal/README.md, "What it deploys", the gc bullet, which today says only "brings the checkout of the city's repository to its upstream's commit". One clause there: the commit CITY_REVISION names, where the StatefulSet's gc container sets it, in place of the upstream's commit. Say only what the script does; nothing about Flux or restarts, which the example does not have.

2. The header's line

# From the environment: CITY_REPOSITORY, CITY_BRANCH, CITY_REVISION (optional), CITY_NAME, CITY_DOLT_HOST, is 107 characters among lines wrapped under 100. Rewrap the sentence.

3. The changelog line names the example

"The example's start.sh" does not say which; the file's other entries write examples/minimal. ### Added is the right heading. Suggested: "examples/minimal: start.sh brings the city's checkout to the commit CITY_REVISION names when it is set, in place of the upstream's head."

The branch will conflict in CHANGELOG.md with #112 if that merges first; rebase then.

Review at head 1a4cc36 on main b84db7c. The script's change is right; three small things in what surrounds it, then it merges. This comment is complete by itself. What holds, each run by me: `shellcheck` on `examples/minimal/k8s/files/start.sh` is clean; `kubectl kustomize examples/minimal/k8s` renders; the script differs from saraksh/kube's (merged as #155 there, rolled on the city today, where the checkout came up on its branch at the pinned commit) only in the two example hosts and the header's wrapping. On a scratch clone `git reset -q --hard <commit>` gave the right tree forward, backward, over a modified tracked file and over an untracked file in the way, and a later unpinned start resets to the upstream's head. ## 1. The commented-out env entry goes; the README says the option `examples/minimal/k8s/statefulset.yaml` gains # - name: CITY_REVISION # value: <commit> That is commented-out code, which this repository's owner does not take in a commit. Remove the four added lines from the manifest. The option belongs where a deployer reads what the pod does: `examples/minimal/README.md`, "What it deploys", the `gc` bullet, which today says only "brings the checkout of the city's repository to its upstream's commit". One clause there: the commit `CITY_REVISION` names, where the StatefulSet's `gc` container sets it, in place of the upstream's commit. Say only what the script does; nothing about Flux or restarts, which the example does not have. ## 2. The header's line `# From the environment: CITY_REPOSITORY, CITY_BRANCH, CITY_REVISION (optional), CITY_NAME, CITY_DOLT_HOST,` is 107 characters among lines wrapped under 100. Rewrap the sentence. ## 3. The changelog line names the example "The example's `start.sh`" does not say which; the file's other entries write `examples/minimal`. `### Added` is the right heading. Suggested: "`examples/minimal`: `start.sh` brings the city's checkout to the commit `CITY_REVISION` names when it is set, in place of the upstream's head." The branch will conflict in `CHANGELOG.md` with #112 if that merges first; rebase then.
examples/minimal: document CITY_REVISION in the README, drop the commented env entry
All checks were successful
test / changelog (pull_request) Successful in 6s
test / go (pull_request) Successful in 1m9s
9dc80608d7
Assisted-By: Claude <noreply@anthropic.com>
mikluko deleted branch examples-city-revision 2026-11-16 19:24:27 +00:00
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
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
mikluko/roomcity!113
No description provided.