feat: add PR title to pretty version name in ISO name and menu entry#46
Merged
Conversation
phorcys420
added a commit
that referenced
this pull request
Jun 30, 2026
Refine the pretty version name for PR preview builds: - Add `coderBox.prNumber` (the GitHub PR ID), read from CODER_BOX_PR_NUMBER and set in CI from github.event.pull_request.number. Woven into the menu label as "#46" and the file name as "-46" when present. - The installer boot-menu label now puts the PR reference first and moves the commit hash to the very end when a PR title is present: " - Coder Box Installer - PR #46: <title> (<rev>)" Non-PR builds are unchanged: " - Coder Box Installer (<rev>)". Example file name: coder-box-installer-x86_64-linux-pr-46-fix-the-thing.iso
Closes #42. Weave the pull-request title into each image's "pretty version name" — the boot-menu label and the ISO file name — when a build is for a PR. - box-turnkey.nix gains `coderBox.prTitle` (reads CODER_BOX_PR_TITLE under the --impure eval every image build already uses, so an arbitrary title never needs shell-escaping into a Nix expression; empty in pure eval / when unset). - Two derived read-only fragments share one append path across flavours: prMenuSuffix (" - PR: <title>", menu-breaking chars neutralised) and prFileSuffix ("-pr-<slug>", lowercased [a-z0-9-] slug, dash runs collapsed, trimmed, capped at 40 chars). - appliance/iso.nix and installer/iso.nix append these to appendToMenuLabel and image.baseName. Empty for tag/main/local builds, so those names are unchanged. - test.yml sets CODER_BOX_PR_TITLE from github.event.pull_request.title (job-level env, forwarded with -e) so the title can't break the shell. - Makefile documents the local preview override.
Refine the pretty version name for PR preview builds: - Add `coderBox.prNumber` (the GitHub PR ID), read from CODER_BOX_PR_NUMBER and set in CI from github.event.pull_request.number. Woven into the menu label as "#46" and the file name as "-46" when present. - The installer boot-menu label now puts the PR reference first and moves the commit hash to the very end when a PR title is present: " - Coder Box Installer - PR #46: <title> (<rev>)" Non-PR builds are unchanged: " - Coder Box Installer (<rev>)". Example file name: coder-box-installer-x86_64-linux-pr-46-fix-the-thing.iso
0aeef32 to
6710500
Compare
phorcys420
added a commit
that referenced
this pull request
Jul 1, 2026
Split the boot-screen footer across up to two GRUB labels so a long PR title no longer overflows the screen width: line 1 (always): Coder Box - <short-sha>@<branch> line 2 (PR only): (PR #46: <title>) A non-PR build shows only line 1. box-turnkey.nix now exposes coderBox.bootLabelLine1 / bootLabelLine2 (replacing the single-line bootLabel), and base/iso.nix stacks the second label ~1 line-height below the first (emitted only when line 2 is non-empty).
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.
Closes #42.
What
When a build is for a pull request, weave the PR title and number into the image's pretty version name — both the boot-menu label (BIOS/isolinux + EFI/grub) and the ISO file name — so reviewers can tell at a glance which PR an image came from.
How
nixos/_images/box-turnkey.nix(shared by all image flavours) is the single source of truth:coderBox.prTitle(fromCODER_BOX_PR_TITLE) andcoderBox.prNumber(fromCODER_BOX_PR_NUMBER). Reading from the env (the build already runs--impure) means an arbitrary title never has to be shell-escaped into a Nix expression;getEnvreturns""in pure eval / when unset, so tag/main/local builds are unaffected.prMenuSuffix→" - PR #46: <title>"(number omitted if unknown), with menu-breaking chars (quotes, backslashes, newlines) neutralised.prFileSuffix→"-pr-46-<slug>", where<slug>is the lowercased title reduced to[a-z0-9-](dash runs collapsed, edges trimmed, capped at 40 chars).installer/iso.nix: for a PR build the PR reference comes first and the commit hash moves to the very end of the boot-menu label; non-PR builds keep the plain(<rev>)form.appliance/iso.nix: appends the PR suffix (no rev in its label)..github/workflows/test.ymlsetsCODER_BOX_PR_TITLE/CODER_BOX_PR_NUMBERfrom the PR event (job-levelenv:, forwarded with-e) so the title can't break the shell; empty for non-PR events.Makefiledocuments the local preview override.Examples
Installer, PR #46 title
fix: the thing! (v2):coder-box-installer-x86_64-linux-pr-46-fix-the-thing-v2.iso- Coder Box Installer - PR #46: fix: the thing! (v2) (abc123def456)No PR (tag/main/local) — unchanged:
coder-box-installer-x86_64-linux.iso- Coder Box Installer (abc123def456)Validation
nix flake check --impure --no-build --all-systems→ all checks passed.isoImage.isoName/appendToMenuLabelfor installer + appliance, with/without PR title and with/without PR number, confirming the names above.