Showing the source commit on every snapcraft.io build
A change for the snapcraft.io publisher dashboard that adds a Git commit column to the builds table and links each hash straight to the GitHub commit when the snap is repo-connected.
Snapcraft.io is the storefront and publisher dashboard for Snaps. The publisher side has a “GitHub builds” feature where you point a snap at a repo and the store builds it for you. Until #5282 (merged today), the dashboard did not show which commit any given build came from. This post is the technical write-up. Closes #2948.
What was wrong before
If a build failed, the first thing you wanted to know was which commit caused it. The dashboard did not show that anywhere. The builds table had status, queue time and architecture, and the build detail page had logs — but no SHA. The only way to find out was to line up the build’s timestamp with your repo’s commit history.
What the change does
#5282 adds a “Git commit” column to the builds table and a matching row on each build’s detail page. The hash is truncated to 7 characters, and when the snap is connected to a GitHub repo the hash is a link straight to the commit on GitHub. When the snap is not repo-connected the SHA renders as plain text.
Implementation
The work is three small pieces that other surfaces can reuse:
formatCommitId()truncates the hash and returns an empty string for old builds that pre-date commit tracking, so the column does not render garbage for legacy data.createGitHubCommitUrl()only builds the link when the snap-to-repo relationship is known.GitCommitLinkis the React component that wraps both, so the release pages and any future surface can drop it in.
Tests
Coverage is 32 unit tests on the helpers and the component, plus an integration path in test_builds.py that exercises the column end-to-end against a fixture build payload.
Important Links
- The PR:
#5282(merged 13 Aug 2025). - Closes:
#2948. - Live at: snapcraft.io.
- Repo:
canonical/snapcraft.io.