Skip to content

Commit 2df9714

Browse files
authored
fix(changelog): guard glow dependency and fix release-tag regex (#1231)
glow was moved from the BST image to Homebrew's cli.Brewfile in 49382c5 (image diet work, projectbluefin/common#546), but changelog.just still hard-called glow -p. On a fresh boot before brew-preinstall.service runs, glow is absent and ujust changelog exits 127. Changes: - changelog.just: guard both glow -p calls with command -v glow, fall back to cat when glow isn't installed yet - changelog.just: fix release-tag regex — drop [.0-9]* suffix that appended OSTREE_VERSION fractional part (.0) to the date, producing non-existent query tags like stable-20260619.0 - Clean up stale references left by 49382c5: - overview.md: glow/fzf now N (brew-preinstall) - add-package.md: use gum.bst as copy template (glow.bst deleted) - packaging-binaries.md: remove glow.bst/fzf.bst from example lists, add lesson about brew-preinstall timing - packaging-go.md: remove glow.bst/fzf.bst from pre-built examples - track-bst-sources.yml: remove dead Update glow and Update fzf steps (silently failing on deleted files) - sbom_diff.py: remove glow/fzf from notable-packages list Closes #941 Assisted-by: glm-5.2 via opencode
1 parent 852f729 commit 2df9714

7 files changed

Lines changed: 38 additions & 121 deletions

File tree

.github/scripts/sbom_diff.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
("common", "common", None),
5050
("JetBrainsMono", "JetBrains Mono", None),
5151
("gum", "gum", None),
52-
("fzf", "fzf", None),
53-
("glow", "glow", None),
5452
]
5553

5654
# ── Version string helpers ────────────────────────────────────────────────────

.github/workflows/track-bst-sources.yml

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -449,114 +449,6 @@ jobs:
449449
fi
450450
echo "PR: $PR_URL"
451451
452-
- name: Update fzf
453-
continue-on-error: true
454-
env:
455-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
456-
run: |
457-
LATEST_VERSION=$(gh api repos/junegunn/fzf/releases/latest --jq '.tag_name' | sed 's/^v//')
458-
echo "Latest fzf version: $LATEST_VERSION"
459-
460-
BST_FILE="elements/bluefin/fzf.bst"
461-
CURRENT_VERSION=$(grep -oP 'download/v\K[0-9.]+' "$BST_FILE" | head -1)
462-
echo "Current version: $CURRENT_VERSION"
463-
464-
if [ "$LATEST_VERSION" = "$CURRENT_VERSION" ]; then
465-
echo "fzf is already up to date."
466-
exit 0
467-
fi
468-
469-
echo "Updating: $CURRENT_VERSION -> $LATEST_VERSION"
470-
sed -i "s|v${CURRENT_VERSION}/fzf-${CURRENT_VERSION}|v${LATEST_VERSION}/fzf-${LATEST_VERSION}|g" "$BST_FILE"
471-
just bst -o arch x86_64 source track bluefin/fzf.bst
472-
just bst -o arch aarch64 source track bluefin/fzf.bst
473-
474-
BRANCH="auto/track-fzf"
475-
TITLE="chore(deps): update fzf v${CURRENT_VERSION} -> v${LATEST_VERSION}"
476-
477-
git checkout -B "$BRANCH" origin/testing
478-
git add "$BST_FILE"
479-
git commit -m "$TITLE"
480-
git push --force-with-lease origin "$BRANCH"
481-
git checkout -f testing
482-
483-
{
484-
echo "## fzf update: \`v${CURRENT_VERSION}\` → \`v${LATEST_VERSION}\`"
485-
echo ""
486-
echo "| | |"
487-
echo "| --- | --- |"
488-
echo "| **Source** | [junegunn/fzf](https://github.com/junegunn/fzf) |"
489-
echo "| **Version** | \`v${CURRENT_VERSION}\` → \`v${LATEST_VERSION}\` |"
490-
echo "| **Changelog** | [https://github.com/junegunn/fzf/releases/tag/v${LATEST_VERSION}](https://github.com/junegunn/fzf/releases/tag/v${LATEST_VERSION}) |"
491-
echo "| **Compare** | [v${CURRENT_VERSION}...v${LATEST_VERSION}](https://github.com/junegunn/fzf/compare/v${CURRENT_VERSION}...v${LATEST_VERSION}) |"
492-
echo ""
493-
echo "---"
494-
echo "*Generated by [Track BuildStream Sources](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})*"
495-
} > /tmp/pr-body.md
496-
497-
EXISTING_PR=$(gh pr list --head "$BRANCH" --json number --jq '.[0].number' 2>/dev/null || true)
498-
if [ -n "$EXISTING_PR" ]; then
499-
gh pr edit "$EXISTING_PR" --title "$TITLE" --body-file /tmp/pr-body.md
500-
PR_URL=$(gh pr view "$EXISTING_PR" --json url --jq '.url')
501-
else
502-
PR_URL=$(gh pr create --base testing --head "$BRANCH" --title "$TITLE" --body-file /tmp/pr-body.md)
503-
fi
504-
echo "PR: $PR_URL"
505-
506-
- name: Update glow
507-
continue-on-error: true
508-
env:
509-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
510-
run: |
511-
LATEST_VERSION=$(gh api repos/charmbracelet/glow/releases/latest --jq '.tag_name' | sed 's/^v//')
512-
echo "Latest glow version: $LATEST_VERSION"
513-
514-
BST_FILE="elements/bluefin/glow.bst"
515-
CURRENT_VERSION=$(grep -oP 'download/v\K[0-9.]+' "$BST_FILE" | head -1)
516-
echo "Current version: $CURRENT_VERSION"
517-
518-
if [ "$LATEST_VERSION" = "$CURRENT_VERSION" ]; then
519-
echo "glow is already up to date."
520-
exit 0
521-
fi
522-
523-
echo "Updating: $CURRENT_VERSION -> $LATEST_VERSION"
524-
sed -i "s|v${CURRENT_VERSION}/glow_${CURRENT_VERSION}|v${LATEST_VERSION}/glow_${LATEST_VERSION}|g" "$BST_FILE"
525-
just bst -o arch x86_64 source track bluefin/glow.bst
526-
just bst -o arch aarch64 source track bluefin/glow.bst
527-
528-
BRANCH="auto/track-glow"
529-
TITLE="chore(deps): update glow v${CURRENT_VERSION} -> v${LATEST_VERSION}"
530-
531-
git checkout -B "$BRANCH" origin/testing
532-
git add "$BST_FILE"
533-
git commit -m "$TITLE"
534-
git push --force-with-lease origin "$BRANCH"
535-
git checkout -f testing
536-
537-
{
538-
echo "## glow update: \`v${CURRENT_VERSION}\` → \`v${LATEST_VERSION}\`"
539-
echo ""
540-
echo "| | |"
541-
echo "| --- | --- |"
542-
echo "| **Source** | [charmbracelet/glow](https://github.com/charmbracelet/glow) |"
543-
echo "| **Version** | \`v${CURRENT_VERSION}\` → \`v${LATEST_VERSION}\` |"
544-
echo "| **Changelog** | [https://github.com/charmbracelet/glow/releases/tag/v${LATEST_VERSION}](https://github.com/charmbracelet/glow/releases/tag/v${LATEST_VERSION}) |"
545-
echo "| **Compare** | [v${CURRENT_VERSION}...v${LATEST_VERSION}](https://github.com/charmbracelet/glow/compare/v${CURRENT_VERSION}...v${LATEST_VERSION}) |"
546-
echo ""
547-
echo "---"
548-
echo "*Generated by [Track BuildStream Sources](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})*"
549-
} > /tmp/pr-body.md
550-
551-
EXISTING_PR=$(gh pr list --head "$BRANCH" --json number --jq '.[0].number' 2>/dev/null || true)
552-
if [ -n "$EXISTING_PR" ]; then
553-
gh pr edit "$EXISTING_PR" --title "$TITLE" --body-file /tmp/pr-body.md
554-
PR_URL=$(gh pr view "$EXISTING_PR" --json url --jq '.url')
555-
else
556-
PR_URL=$(gh pr create --base testing --head "$BRANCH" --title "$TITLE" --body-file /tmp/pr-body.md)
557-
fi
558-
echo "PR: $PR_URL"
559-
560452
- name: Update gum
561453
continue-on-error: true
562454
env:

docs/skills/add-package.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Use when you need to:
4141
## Quick Start
4242

4343
```bash
44-
cp elements/bluefin/glow.bst elements/bluefin/<name>.bst
44+
cp elements/bluefin/gum.bst elements/bluefin/<name>.bst
4545
# edit the new element
4646
just bst show oci/bluefin.bst
4747
just bst build bluefin/<name>.bst

docs/skills/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ Gaps as of 2026-06-03. Y = present, N = absent.
139139
|---|:---:|:---:|
140140
| just | Y | Y |
141141
| wl-clipboard | Y | Y |
142-
| glow | Y | Y |
142+
| glow | N (brew-preinstall) | Y |
143143
| gum | Y | Y |
144-
| fzf | Y | Y |
144+
| fzf | N (brew-preinstall) | Y |
145145
| fish | N | Y |
146146
| zsh | N | Y |
147147
| tmux | N | Y |

docs/skills/packaging-binaries.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ url: releases:owner/project/releases/download/v%{version}/binary.tar.gz
150150
151151
### `strip-binaries: ""` belongs under `variables:`, not `public: bst:` (2026-06-07)
152152

153-
Real elements (`tailscale.bst`, `glow.bst`, `gum.bst`, `fzf.bst`, `tealdeer.bst`) all declare
153+
Real elements (`tailscale.bst`, `gum.bst`, `tealdeer.bst`) all declare
154154
`strip-binaries: ""` under `variables:`. `public: bst:` is for `overlap-whitelist` entries only.
155155
Placing `strip-binaries` under `public: bst:` causes a YAML error at element parse time.
156156

@@ -169,7 +169,7 @@ public:
169169

170170
Some projects (e.g., `fzf`) release tarballs where the binary sits at the archive root with no
171171
wrapping directory. Without `base-dir: ""`, BST expects a top-level directory and fails. Example
172-
from `fzf.bst`:
172+
from `fzf.bst` (`fzf.bst` was removed in 49382c5; the pattern still applies to any flat-tarball binary):
173173

174174
```yaml
175175
sources:
@@ -217,7 +217,7 @@ sources:
217217
ref: sha256hex...
218218
```
219219

220-
This pattern is used in `tailscale.bst`, `glow.bst`, `gum.bst`, and `fzf.bst`.
220+
This pattern is used in `tailscale.bst`, `gum.bst`, and `tealdeer.bst`.
221221

222222
### Shared profile scripts require the binary in a BST element — check common Containerfile (2026-06-09)
223223

@@ -254,3 +254,24 @@ sources:
254254
```
255255

256256
References: projectbluefin/common PR 542, projectbluefin/dakota PR 762 (issue 753)
257+
258+
### `changelog.just` hard-calls glow — guard for brew-preinstall timing (2026-07-29)
259+
260+
`files/just-overrides/changelog.just` pipes GitHub Release notes through `glow -p`.
261+
glow was moved from the BST image to Homebrew's cli.Brewfile in 49382c5
262+
(image diet work, projectbluefin/common#546), so it is not present on a fresh
263+
boot before brew-preinstall.service runs. The recipe must guard with
264+
`command -v glow` and fall back to `cat` — otherwise `ujust changelog` exits 127.
265+
266+
When a ujust recipe calls a binary that lives in Homebrew (not the BST image),
267+
it must degrade gracefully. The binary is available after first-login
268+
brew-preinstall, not at build time or on a pre-login fresh boot.
269+
270+
Also: when removing a BST element, check `track-bst-sources.yml`, `overview.md`,
271+
and skill files for stale references — 49382c5 left all three dangling
272+
(the "Update glow"/"Update fzf" steps, overview table, and packaging examples).
273+
274+
A second bug in the same recipe: the release-tag regex
275+
`OSTREE_VERSION=.*\d{2}\.\K\d{8}[.0-9]*` appended the OSTREE fractional part
276+
(`.0`) to the date, producing query tags like `stable-20260619.0` which don't
277+
exist (real tags are `stable-YYYYMMDD`). Fix: drop `[.0-9]*`.

docs/skills/packaging-go.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ install-commands:
176176
### All current Go tools in Dakota are pre-built binaries — not Go-from-source builds (2026-06-07)
177177

178178
As of June 2026, every Go-based tool in Dakota uses `kind: manual` with pre-built binaries
179-
from GitHub Releases. `glow.bst`, `gum.bst`, and `fzf.bst` are all pre-built binary elements,
179+
from GitHub Releases. `gum.bst` is a pre-built binary element,
180180
not Go source builds. See `packaging-binaries.md` for the pre-built pattern.
181181

182182
Go-from-source build infrastructure (this skill) exists for future use when a required tool

files/just-overrides/changelog.just

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ changelogs:
1111

1212
# If stable or gts, get changelogs from Github Releases
1313
if [[ "$TAG" =~ gts$|stable$ ]]; then
14-
DATE="$(grep -oP "OSTREE_VERSION=.*\d{2}\.\K\d{8}[.0-9]*" /etc/os-release)"
14+
DATE="$(grep -oP "OSTREE_VERSION=.*\d{2}\.\K\d{8}" /etc/os-release)"
1515
CONTENT="$(curl -Ls "https://api.github.com/repos/projectbluefin/dakota/releases" | jq -r ".[] | select(.tag_name==\"${TAG}-${DATE}\") | .body")"
1616
fi
1717

18-
# Display Content with Glow, otherwise fallback to latest Dakota release notes
18+
# Render with glow when available (brew-preinstall), otherwise plain output.
19+
# glow was moved from the BST image to Homebrew's cli.Brewfile in 49382c5.
20+
if command -v glow &>/dev/null; then
21+
RENDER=(glow -p)
22+
else
23+
RENDER=(cat)
24+
fi
1925
if [[ -n "${CONTENT:-}" ]]; then
20-
echo "$CONTENT" | glow -p
26+
echo "$CONTENT" | "${RENDER[@]}"
2127
else
2228
echo "WARN: Could not find a release specific to your image"
23-
curl -Ls "https://api.github.com/repos/projectbluefin/dakota/releases/latest" | jq -r ".body" | glow -p
29+
curl -Ls "https://api.github.com/repos/projectbluefin/dakota/releases/latest" | jq -r ".body" | "${RENDER[@]}"
2430
fi

0 commit comments

Comments
 (0)