Skip to content

fix(sentry): stop one build reporting two release strings - #3416

Open
vpetersson-bot wants to merge 1 commit into
masterfrom
agent/anthias-claude/5cbc4053902a
Open

vpetersson-bot wants to merge 1 commit into
masterfrom
agent/anthias-claude/5cbc4053902a

Conversation

@vpetersson-bot

Copy link
Copy Markdown
Contributor

Issues Fixed

No tracked issue — found while auditing the Sentry project. Sentry
holds 2026.9.0+fa2d90a and 2026.09.0+fa2d90a as two separate
releases of one build (same git short hash), and the older
2026.06.3 alongside 2026.6.3.

Description

The release CalVer is zero-padded on purpose (2026.09.0, matching
the git tag v2026.09.0), and every consumer that needs strict
semver unpads it: uv.lock stores 2026.9.0, and
bin/render_balena_yml.sh normalises the same way before stamping
balena.yml, which rejects a padded segment.

get_anthias_release() unpads on only one of its two paths. The
build backend applies PEP 440 normalisation when it copies the
version into the package metadata, so importlib.metadata.version()
answers 2026.9.0; the pyproject.toml fallback — the path every
image takes, since uv sync --no-install-project leaves no
distribution to read — returns the padded string verbatim. One build
therefore describes itself two ways depending on how it was
deployed.

Sentry keys releases by string, so that splits a single image into
two unrelated releases. "Resolved in release X" and the regression
detection built on top of it can then only reason about whichever
half an event landed in — the exact thing a release stamp exists to
prevent. The same split reaches the System Info page, the v2 info
API and the outbound User-Agent.

This unpads in get_anthias_release() so both paths land on the side
the rest of the toolchain already takes. It is the whole of what PEP
440 normalisation does to a version of this shape. Anything that is
not an all-numeric dotted version is returned untouched rather than
guessed at. The checked-in CalVer stays zero-padded, so the release
runbook does not change.

tests/test_version.py is new — there was no direct coverage of this
helper, every other suite mocks it. Two of its cases fail without the
one-line change in version.py.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

Not device-tested: the change is a pure string normalisation in a
version helper, exercised by unit tests on both resolution paths, with
no board-specific behaviour to observe on hardware.

🤖 Generated with Claude Code

The release CalVer is zero-padded on purpose (2026.09.0, matching the
git tag), and every consumer that needs strict semver unpads it —
uv.lock stores 2026.9.0, render_balena_yml.sh normalises before
stamping balena.yml. get_anthias_release does it on only one of its
two paths: the build backend normalises per PEP 440 on the way into
package metadata, so importlib.metadata answers 2026.9.0, while the
pyproject.toml fallback hands back the padded string verbatim.

Sentry keys releases by string, so the same image arrives as two
unrelated releases — 2026.9.0+fa2d90a and 2026.09.0+fa2d90a are both
on record for one build. "Resolved in release X" and the regression
detection built on it then only see whichever half an event landed
in, which is the one thing a release stamp exists to prevent. The
split also reaches the System Info page, the v2 info API and the
outbound User-Agent.

Unpad in get_anthias_release so both paths land on the side the rest
of the toolchain already takes. Anything that is not an all-numeric
dotted version is returned untouched rather than guessed at.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
@vpetersson-bot
vpetersson-bot requested a review from a team as a code owner October 24, 2026 08:15
@vpetersson-bot vpetersson-bot self-assigned this Oct 24, 2026
Copilot AI lite review requested due to automatic review settings October 24, 2026 08:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

@vpetersson-bot
vpetersson-bot requested a lite review from Copilot October 24, 2026 08:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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