Skip to content

refactor: remove dead SHA_HEAD_SHORT build-arg - #379

Open
mendezr wants to merge 1 commit into
projectbluefin:mainfrom
mendezr:arch/remove-sha-head-short-build-arg
Open

mendezr wants to merge 1 commit into
projectbluefin:mainfrom
mendezr:arch/remove-sha-head-short-build-arg

Conversation

@mendezr

@mendezr mendezr commented Sep 18, 2026

Copy link
Copy Markdown

Summary

Removes the dead SHA_HEAD_SHORT build-arg contract. This addresses issue #372.

Justfile passed --build-arg SHA_HEAD_SHORT=$(git rev-parse --short HEAD) to podman build whenever the worktree was clean, but the Containerfile never declares ARG SHA_HEAD_SHORT and nothing in the image reads it, so the builder discarded it and emitted an one or more build args were not consumed warning on every clean build. That warning is the repo's only signal for a genuinely misspelled build arg, so the noise is costing real diagnostic value.

Following the issue's recommendation, I chose the "Remove it" direction:

  • Justfile build recipe: dropped the git-based SHA_HEAD_SHORT build-arg block.
  • build/00-image-info.sh: dropped the SHA_HEAD_SHORT entry from the required-env-vars header comment.
  • tests/unit/justfile-build_test.bats: removed the two tests that certified the producer, plus the now-orphaned git stub and STUB_GIT_STATUS fixture.

Validation

  • just check passes (Justfile syntax).
  • just test-unit passes: 194 tests, 0 failures.

— hive: backend=goose model=deepseek/deepseek-v4-flash-0731

Justfile passed a --build-arg named SHA_HEAD_SHORT to podman build
whenever the worktree was clean, but the Containerfile never declares
ARG SHA_HEAD_SHORT and nothing reads it, so the builder discarded it,
emitting an unconsumed-build-arg warning on every clean build. That
warning is the repo's only signal for a genuinely misspelled build arg,
so the noise cost real diagnostic value.

Remove the producer from the build recipe, the header anchor in
build/00-image-info.sh, the orphaned git stub in the bats harness, and
the two unit tests that certified the dead half.

Assisted-by: DeepSeek DeepSeek V4 Flash 0731 via goose
Signed-off-by: mendezr <mendezr@users.noreply.github.com>

@kubestellar-hive kubestellar-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate of #373 — this PR is a strict subset.

I read both diffs in full. The Justfile and build/00-image-info.sh hunks are byte-identical between the two PRs (same resulting blobs b4712648 / 2b79abba): both drop the dead SHA_HEAD_SHORT --build-arg block and its header-comment entry. Both also remove the two stale assertions and the git stub from tests/unit/justfile-build_test.bats.

#373 (earlier, 2026-09-16) additionally adds tests/unit/justfile-build-arg-gate_test.bats, a contract gate asserting every --build-arg the Justfile passes is declared as ARG in the Containerfile — which prevents the next undeclared arg from reappearing silently. This PR (2026-09-18) has no equivalent guard.

Flagging for a maintainer: if you agree, this one could be closed in favour of #373. I have not closed anything.

— hive: agent=reviewer backend=copilot model=claude-fable-5

@kubestellar-hive kubestellar-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to duplicate #373, which makes the same change to Justfile and build/00-image-info.sh.

Verified by reading both diffs in full:

  • The Justfile hunk (removing the git status -s guard and the SHA_HEAD_SHORT --build-arg at former lines 154–155) and the build/00-image-info.sh header-comment hunk are byte-identical in both PRs.
  • Both bodies cite issue #372 and both deliberately take the "remove" direction rather than declaring ARG SHA_HEAD_SHORT in the Containerfile.
  • Differences: #373 additionally adds tests/unit/justfile-build-arg-gate_test.bats, a contract gate asserting every --build-arg the Justfile passes is declared as an ARG in the Containerfile — that prevents this class of drift from recurring. This PR's only extra is removing the now-orphaned git stub and STUB_GIT_STATUS fixture from justfile-build_test.bats (a nice cleanup #373 leaves behind, but harmless dead test scaffolding).

Flagging for a maintainer: if you agree, this one could be closed in favour of #373, which is two days earlier and broader in scope (it adds the regression gate). The git-stub cleanup here could be folded into #373 or done as a follow-up. I have not closed anything.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78

@kubestellar-hive kubestellar-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This duplicates #373, which makes the byte-identical change to Justfile (removing the SHA_HEAD_SHORT block at line ~151) and to the header comment in build/00-image-info.sh. Both PRs cite the same problem (undeclared ARG → "build args were not consumed" warning) and both take the "remove" direction from issue #372.

Differences I verified by reading both diffs in full:

  • #373 additionally adds tests/unit/justfile-build-arg-gate_test.bats, a contract gate asserting every --build-arg the Justfile passes has a matching ARG in the Containerfile — so the same class of drift can't recur.
  • This PR (#379) is cleaner in one respect: it also removes the now-orphaned git stub and STUB_GIT_STATUS fixture from tests/unit/justfile-build_test.bats (lines 37–70), which #373 leaves behind as dead fixture code.

#373 is earlier (Sep 16 vs Sep 18) and broader in scope, so flagging for a maintainer: if you agree, this one could be closed in favour of #373, ideally after porting its stub-cleanup hunk. I have not closed anything.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78

@kubestellar-hive kubestellar-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed (correctness) — removal is complete and consistent at head 2d5cdf9: no SHA_HEAD_SHORT reference remains anywhere in the tree, Containerfile indeed never declared the ARG (its ARG block is lines 57–62), and the build recipe no longer invokes git, so dropping the git stub from the bats harness is safe — the two deleted tests were its only consumers.

Two stale comments the diff left behind, both describing the behavior this PR removed:

  • Justfile:105-106 — the build recipe's doc comment still says "If the git working directory is clean, it also includes the short SHA of the current HEAD." That's now false.
  • tests/unit/justfile-build_test.bats:6 — the header still lists git among the stubbed external commands, but the stub was removed in this PR.

Both are one-line comment fixes; no functional issues found.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78

@Danathar

Copy link
Copy Markdown

This removes the same dead SHA_HEAD_SHORT build arg as #373 (kylerankin, opened earlier, approved by hanthor and me). #373 also adds tests/unit/justfile-build-arg-gate_test.bats, which fails if a --build-arg is ever passed without a matching ARG — the check that stops this happening again. Suggest closing this one in favour of #373 once it lands; if there's something here #373 doesn't cover, say so and I'll look again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants