Skip to content

feat(dart): tell a web build, and Sentry, which build it is - #61

Open
nikzen wants to merge 2 commits into
fix/vodozemac-darwin-build-pathsfrom
feat/web-build-identity
Open

feat(dart): tell a web build, and Sentry, which build it is#61
nikzen wants to merge 2 commits into
fix/vodozemac-darwin-build-pathsfrom
feat/web-build-identity

Conversation

@nikzen

@nikzen nikzen commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

A web build cannot say which build it is, so a bug report names a day rather than a revision and a browser's stack trace arrives minified. famedly/call solves both by generating a Dart file into its own source tree on every CI run.
Two options replace that.

  • web.version.enable passes git describe and the commit as the version and commit dart-defines, read with String.fromEnvironment, so the file call used to check in keeps its debug defaults and stops being overwritten.
  • web.sentry.enable asks the compiler for the source maps and hands them to Sentry under that release and distribution. Turns the version on by itself: a symbol file is only found again by the release it was filed under.

Both are command substitutions in the build command rather than a step that exports them, so the command the flake prints still reproduces a CI build by hand. Deepening the checkout is now steps.withHistory, which the commit
message check also uses.

The maps go to Sentry and no further. They land in build/web, which is the artefact Pages, the review apps and the images all serve, so a later step deletes them again — including on the runs that skip the upload, which built
them all the same. Those are merge queues, whose builds nobody sees, and Dependabot, which has no access to our secrets and would otherwise fail on an empty token and take the build down with it. The review app already steps
around it the same way.

Not carried over from call: the cache-busting sed on index.html, which has matched nothing since the framework started loading the bundle from flutter_bootstrap.js, and the 16-core runner, since the Rust bindings that
made the job long are a cached package now.

Stacked on #62; the build.nix it extends comes from #56.

Test plan

  • nix flake check --all-systems, prek --all-files --stage pre-push
  • the generated workflow checks out deep, carries both defines, uploads after the build and skips it in a merge queue and for Dependabot
  • built famedly/call with the generated command: v1.0.12-17-g039c1d2 and the full sha are in main.dart.js, and the map is there to upload
  • the deletion matches *.js.map and *.wasm.map and leaves other assets alone, checked against a tree holding a file named world.map
  • the upload itself needs a token and a release, so it is unverified until the migration runs it

Made with Cursor


The stack

main ─┬─ #63  make room on the runner
      ├─ #59  substitute from the shared binary cache
      └─ #56  sign, describe and scan what we publish
            └─ #62  keep the build directory out of vodozemac
                  └─ #61  tell a web build which build it is  ←
                        └─ #64  let a project choose its vodozemac

#63 and #59 stand outside the chain and can land in any order. #59 and #56
both touch the vodozemac module, so whichever goes second wants a rebase.

Comment thread nix/dart/web/workflows/build.nix Outdated
Comment thread nix/dart/web/workflows/build.nix
@nikzen
nikzen force-pushed the feat/web-build-identity branch from 689145a to 757895a Compare August 3, 2026 21:45
@nikzen
nikzen changed the base branch from feat/supply-chain to fix/ci-free-disk-space August 3, 2026 21:45
@nikzen
nikzen force-pushed the feat/web-build-identity branch from 757895a to 76e55b5 Compare August 3, 2026 21:48
@nikzen
nikzen force-pushed the feat/web-build-identity branch from 76e55b5 to fe72370 Compare August 3, 2026 21:49

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fe72370. Configure here.

Comment thread nix/dart/web/assets.nix
nikzen and others added 2 commits August 4, 2026 09:26
A job that reads the history rather than the files at HEAD has to say so at
checkout: the token leaves with the action, so nothing can be fetched after it.
The commit message check spelled its own checkout out for that, and lost the
token hygiene the shared one has along the way.

Signed-off-by: Niklas Zender <n.zender@famedly.com>
A minified stack from a browser is only a stack if the symbols that were
stripped out of it can be found again, and they are filed under the release
that produced them. So the same two values go both ways: into the application
as dart-defines, where a user can read the version off the screen and name a
build in a bug report, and into Sentry as the release and the distribution.

They are command substitutions in the build command rather than a step that
exports them, so the command the flake prints reproduces a CI build by hand.

The upload leaves Dependabot out. Its pull requests run without access to our
secrets, so the upload would find an empty token, fail, and take the build down
with it before the artefact every deployment reads was ever uploaded — and its
pull requests are the ones nobody looks at until they go red. The review app
steps around the same thing in two places.

The maps are deleted once they have been uploaded, and on the runs that skip
the upload too, since those built them all the same. The build directory is the
artefact that Pages, the review apps and the images all serve, so leaving them
there would hand anyone the source the site was compiled from.

Replaces the Dart file famedly/call generated into its own source tree on every
run, and deepens the checkout only for the builds that describe themselves.

Signed-off-by: Niklas Zender <n.zender@famedly.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@nikzen
nikzen force-pushed the feat/web-build-identity branch from fe72370 to 22c4d59 Compare August 4, 2026 07:29
@nikzen
nikzen changed the base branch from fix/ci-free-disk-space to fix/vodozemac-darwin-build-paths August 4, 2026 07:29
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