Footer: full commit SHA in URL, short hash for display#2651
Open
0xharkirat wants to merge 1 commit into
Open
Conversation
The footer's commit URL was previously constructed with the same 7-char
hash used for display. GitHub returns 404 if a short SHA in the URL is
ambiguous (multiple commits matching the same 7-char prefix) —
vanishingly rare in this repo but trivially fixable: carry the full
40-char SHA through the env, slice in the JSX for the visible label
only.
- build-artifacts.yml: drop `cut -c1-7` / `--short=7` in both
COMMIT_HASH setters. The env now carries the full SHA (also matches
the OCI convention for `org.opencontainers.image.build.commit`, which
expects the full revision).
- footer.tsx: render `{commitHash.slice(0, 7)}` for the visible label;
the URL keeps using the full `${commitHash}` so it always resolves.
User-facing: same 7-char text, link always works. Same pattern will
land in SSW.Website and SSW.People to keep all three footers
consistent.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0xharkirat
added a commit
to SSWConsulting/SSW.Website
that referenced
this pull request
Jun 1, 2026
Mirrors the same pattern raised in SSWConsulting/SSW.Rules#2651: - commitHash now holds the full SHA from NEXT_PUBLIC_GITHUB_SHA (was sliced at module level). - URL keeps using ${commitHash} -> always resolves unambiguously. - Display label uses {commitHash.slice(0, 7)} -> same visible 7-char text, no real-world ambiguity for users. Address Copilot's review comment (#4720) about short-SHA ambiguity, and keeps the 3 SSW footers consistent on the same approach. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
Author
|
/deploy |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates footer commit handling so the GitHub commit URL uses the full SHA while keeping the footer display compact with a 7-character label.
Changes:
- Pass the full commit SHA through
COMMIT_HASHin the build workflow. - Display only the first 7 characters of the commit hash in the footer.
- Preserve downstream Docker build/env propagation using the same
COMMIT_HASHvariable.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
components/layout/nav/footer.tsx |
Shortens the visible commit label while keeping the link target as the full hash. |
.github/workflows/build-artifacts.yml |
Stops truncating COMMIT_HASH during build metadata generation and checkout-based refresh. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6 tasks
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.
Summary
Follow-up to #2646. The footer commit link was using the same 7-char short hash for both the displayed label and the GitHub commit URL. Short SHAs in URLs can be ambiguous (GitHub returns 404 if multiple commits share the same 7-char prefix). Probability is vanishingly small in this repo (~250 commits) but the fix costs ~1 line, so worth doing now and propagating to SSW.Website and SSW.People for parity.
Approach
COMMIT_HASH(drop thecut -c1-7/--short=7in both setters).{commitHash.slice(0, 7)}in the JSX. URL uses the full${commitHash}so it always resolves.COMMIT_HASH) — no new variables, no new threading. KISS preserved.Bonus: the Docker label
org.opencontainers.image.build.commitnow contains the full SHA, which is what the OCI spec actually expects forrevision.Test plan
pnpm devwithCOMMIT_HASH=27836617e5b23919c8d98baee3a274045b8f4915in.env→ display shows2783661, link points to…/commit/27836617e5b23919c8d98baee3a274045b8f4915/deployafter merge to test in slot)Follow-up
Same change will be applied to SSW.Website (open PR #4720) and SSW.People once this merges, to keep all three footers consistent.
🤖 Generated with Claude Code