Skip to content

feat(menu): show the commit SHA in the version footer - #1571

Draft
bmc08gt wants to merge 1 commit into
code/cashfrom
feat/version-footer-commit-sha
Draft

bmc08gt wants to merge 1 commit into
code/cashfrom
feat/version-footer-commit-sha

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

The version footer's build number is git rev-list --count HEAD, which only identifies a commit if you also know which branch was built. This adds the first 10 characters of the commit SHA, and splits the footer over two lines:

Version 2026.9.3 • Build 4623
2acfecffeb • beta

The iOS app is getting the same change in a parallel PR, with the same format: the break after the build number, no bullet at the start of the second line, and * for a dirty build.

  • Two lines. On a 1080px-wide screen at the default font size, the one-line version with the development track ran almost edge to edge. A larger font or a narrower phone wrapped it at an arbitrary point, sometimes inside Build 4623 or the hash. A production build has no track, so its second line is just the hash.
  • Length. The SHA is always cut to 10 characters, not git's variable default abbreviation, so both platforms render the same string. The formatting lives in VersionInfo.commitLabel.
  • Dirty builds. A build with uncommitted changes to tracked files shows 2acfecffeb*. The check is git diff --quiet HEAD, which ignores untracked files. The release workflow's checkout-written files (google-services.json, local.properties, the signing key) are gitignored as well, and build-release checks out with fetch-depth: 0, so release builds read as clean. Only the exit code is read, so the configuration cache doesn't invalidate on every edit to an already-dirty tree.
  • Bugsnag. GIT_SHA reuses the git rev-parse HEAD value behind bugsnagBuildId; that value and its use as the build UUID are unchanged.
  • No SHA. When commitSha is blank, commitLabel is null and the footer falls back to the previous one-line string, now subtitle_appVersionInfoFooterNoCommit.

VersionInfoTest covers the 10-character cut, the * suffix, short and whitespace-padded SHAs, and the empty fallback.

@bmc08gt bmc08gt self-assigned this Sep 25, 2026
@github-actions github-actions Bot added the type: feature New functionality label Sep 25, 2026
The footer's build number is `git rev-list --count HEAD`, which only
identifies a commit if you also know which branch was built. The footer
now adds the first 10 characters of the commit SHA and splits over two
lines:

  Version 2026.9.3 • Build 4623
  2acfecf • beta

The one-line form with the development track ran almost edge to edge on
a 1080px-wide screen at the default font size, so a larger font or a
narrower phone would wrap it at an arbitrary point. A production build
has no track, so its second line is just the hash.

A build with uncommitted changes to tracked files marks the hash with
`*`. The check is `git diff --quiet HEAD`, which ignores untracked
files; the files the release workflow writes into the checkout
(google-services.json, local.properties, the signing key) are gitignored
besides. Reading only the exit code keeps the configuration cache stable
while editing a dirty tree.

`GIT_SHA` reuses the `git rev-parse HEAD` value already computed for the
Bugsnag build UUID, whose value is unchanged. `VersionInfo.commitLabel`
holds the formatting; it returns null for a build with no SHA, and the
footer falls back to the old one-line string.
@bmc08gt
bmc08gt force-pushed the feat/version-footer-commit-sha branch from cee6513 to 4b8db27 Compare September 25, 2026 16:34
bmc08gt added a commit to code-payments/code-ios-app that referenced this pull request Sep 25, 2026
Android's footer changed in code-payments/code-android-app#1571, and the
two apps share one format:

    Version 2026.9.3 • Build 272
    2acfecffeb

- The commit moves to a second line, followed by " • <track>" when there
  is one. iOS has no release track yet, so its second line is the hash.
  Without a commit the footer is the old single line.
- A dirty build is marked "*" instead of "-dirty", and only changes to
  tracked files count, as on Android (git diff --quiet HEAD). The
  generated GoogleService-Info.plist is excluded because the Generate
  Google phase rewrites it on every build with secrets.
- Tap-to-copy is gone; the footer tap drives only the beta unlock count.
@bmc08gt
bmc08gt marked this pull request as draft October 2, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant