Skip to content

feat(preprod): Store raw build number for display purposes#119262

Merged
trevor-e merged 4 commits into
masterfrom
telkins/preprod-build-number-raw
Jul 8, 2026
Merged

feat(preprod): Store raw build number for display purposes#119262
trevor-e merged 4 commits into
masterfrom
telkins/preprod-build-number-raw

Conversation

@trevor-e

@trevor-e trevor-e commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Launchpad will start packing multi-component Apple CFBundleVersion values (e.g. 1.2.3) into a large synthesized int for build_number (fix(preprod): Parse dotted Apple build numbers instead of dropping them launchpad#645), which would otherwise show up as an odd, unreadable number anywhere a build number is displayed.
  • Adds build_number_raw — the original unparsed build string — so those surfaces can show the real value instead. Stored in PreprodArtifactMobileAppInfo.extras (no migration needed) and exposed via BuildDetailsAppInfo.
  • Safe to deploy ahead of the launchpad change: it's a no-op until launchpad starts sending the field.
  • Frontend changes to consume this are a separate follow-up PR.

Test plan

  • New unit tests covering storage, the API response, and display formatting
  • prek passing

Launchpad now packs multi-component Apple CFBundleVersion values (e.g.
"1.2.3") into a large synthesized sortable int for build_number, since
the DB column needs a single orderable value. Left as-is, that int
would show up directly in the UI and in GitHub PR/status check
comments wherever build_number is rendered to a human.

Accept the raw, unparsed build string (build_number_raw) on the
artifact update endpoint and store it in
PreprodArtifactMobileAppInfo.extras rather than a new column, since
extras is unused on this model today and a real column would need a
migration for a field this narrowly scoped. The write is merge-safe:
existing extras keys are fetched and merged rather than overwritten,
since update_or_create's defaults would otherwise replace the whole
JSON blob on every update.

Surface it through BuildDetailsAppInfo (used by the build-details,
builds, and size-analysis/compare endpoints) and prefer it over the
synthesized int in format_version_string, the shared formatter used by
PR/status check comments.

Refs the launchpad build_number packing fix.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 8, 2026
trevor-e and others added 2 commits July 8, 2026 16:56
The sibling PreprodArtifact.extras merge a few lines below (head_artifact.extras.update(extras_updates)) has no comment for the
same pattern — it's already established in this file. Explaining the
road not taken (why not use get_mobile_app_info()) added length
without adding anything a reader needs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
A one-line comment listing known extras keys drifts silently — the
sibling PreprodArtifact.extras field already has ~10 known keys and
its comment only mentions a couple of examples. Replace the comment
with PreprodArtifactMobileAppInfoExtras, a TypedDict that mypy
actually checks at the write site (project_preprod_artifact_update.py)
and both read sites (format_version_string, create_build_details_app_info).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@trevor-e trevor-e marked this pull request as ready for review July 8, 2026 21:04
@trevor-e trevor-e requested a review from a team as a code owner July 8, 2026 21:04
test_one_build asserts the full builds endpoint response body and
missed the new build_number_raw field added to BuildDetailsAppInfo,
which broke CI.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@trevor-e trevor-e merged commit 8250b32 into master Jul 8, 2026
68 of 69 checks passed
@trevor-e trevor-e deleted the telkins/preprod-build-number-raw branch July 8, 2026 21:31
trevor-e added a commit that referenced this pull request Jul 9, 2026
## Summary
- Backend now stores the raw, unparsed build identifier
(`build_number_raw`) alongside `build_number`, since `build_number` can
be a large synthesized int for Apple builds with a dotted
`CFBundleVersion` (#119262). Left unhandled, that synthesized int would
render directly to users.
- Adds `build_number_raw` to `BuildDetailsAppInfo` and prefers it
(`build_number_raw ?? build_number`) at every site that renders a build
number: install header, build details header/title, builds table, build
comparison item, selected-builds panel, and the base-build VCS info
link.
- Depends on #119262 (backend) being deployed first — until then
`build_number_raw` is always `null` and this is a no-op, falling back to
`build_number` exactly as before.

## Test plan
- [x] New/updated unit tests in `preprodBuildsTable.spec.tsx` and
`buildDetails.spec.tsx` asserting the raw value is preferred over a
synthesized int
- [x] `pnpm typecheck` and `pnpm lint:js` passing

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants