Skip to content

feat(upload): make --artifact optional on upload build - #52

Merged
krassx merged 1 commit into
mainfrom
feat/register-only-build
Sep 19, 2026
Merged

krassx merged 1 commit into
mainfrom
feat/register-only-build

Conversation

@krassx

@krassx krassx commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Omitting --artifact registers the build and ships no bytes (request_artifact_upload: false).

Why

  • The mode already exists: build::run skips packing and never reads the artefact when the flag is false, and xcode post-action uses it. No CLI caller could reach it — --artifact was required and the flag hard-coded true.
  • It is the default path on Android and iOS, which ship bytes only when size analysis is opted into (sizeAnalysis.enabled, BUGSEE_SIZE_ANALYSIS_ENABLED).
  • A web build has no single artefact, so it is the only path a web build can express.

Behaviour

invocation result
upload build --payload-json p registers; nothing packed or sent
upload build --payload-json p --artifact app.aab unchanged
--mapping / --chunked / --out without --artifact exit 20
--artifact /nope exit 10, as before

--deps/--timings still travel without an artefact — the build-info bundle is a separate upload. The three rejected flags only describe how artefact bytes move; dropping a --mapping silently would cost symbolication.

Tests

6 CLI-level tests asserting both directions of the flag (with an artefact, the same log line says true and the ZIP is still packed), so "ships nothing" cannot pass on a run that never consulted it. They strip tracing's ANSI to assert the field's value rather than its name. 3 mutants caught (pinned true, pinned false, guard bypassed). 1 e2e flow: payload intact, request_artifact_upload: false, zero PUTs.

Gates: fmt, clippy -D warnings (0), all unit tests + suites, e2e_flows.py ALL PASS.

Not here

  • format: "web" needs no CLI change — the payload passes through verbatim, so the producer writes it.
  • The size-check baseline hardcodes format=ipa; web has no size-check in slice 1, so it is deferred.
  • The build uuid derivation for web is blocked on what a build record is keyed by — bugsee/bugsee-javascript#8.

First slice of web-build registration (audit §6). Design: docs/design/web-build-registration.md.

🤖 Generated with Claude Code

Omitting it registers the build and ships no bytes (`request_artifact_upload: false`).

That mode already existed — `build::run` skips packing and never reads the artefact when the flag is
false, and `xcode post-action` uses it — but no CLI caller could reach it: `--artifact` was required
and the flag hard-coded `true`. It is the default path on Android and iOS, which ship bytes only when
size analysis is opted into, and the only path a web build can express, having no single artefact.

`--deps`/`--timings` still travel without an artefact (the build-info bundle is a separate upload).
`--mapping`, `--chunked` and `--out` are rejected with exit 20 rather than ignored: dropping a
`--mapping` silently would cost symbolication.

Tests: 6 CLI-level, asserting both directions of the flag; 3 mutants caught; 1 e2e flow asserting the
payload is intact and zero PUTs happen.

First slice of web-build registration — docs/design/web-build-registration.md in the JS repo.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@krassx
krassx force-pushed the feat/register-only-build branch from a3ae829 to c085f68 Compare September 19, 2026 03:31
@krassx krassx changed the title feat(upload): register a build without shipping the artefact's bytes feat(upload): make --artifact optional on upload build Sep 19, 2026
@claude

claude Bot commented Sep 19, 2026

Copy link
Copy Markdown

Code review

Makes --artifact optional on upload build so a caller can register a build and ship the build-info sidecars without shipping artefact bytes — the register-only mode already existed inside build::Params/xcode post-action but had no way to be reached from the command line. The new flags-need---artifact guard (--mapping/--chunked/--out) fails closed with exit 20 rather than silently dropping bytes, build::run's register-only path was already covered by existing tests, and the new CLI-level tests assert both directions (with and without --artifact) so the assertion can't pass on a guard that never looked at the flag. --help text, README, and CHANGELOG were all updated for the new optional flag and its interactions.

I checked validation ordering (the pre-existing mapping/deps/timings existence loop runs before the new "needs --artifact" guard, so a nonexistent --mapping path without --artifact surfaces as exit 10 "does not exist" rather than exit 20 "needs --artifact"), the Path::new("") sentinel for the unset-artifact case (only read when request_artifact_upload is true, confirmed in build::run), the wire shape (no field renamed/added — request_artifact_upload already existed in the POST body, this just varies its value), and MSRV/cross-platform/daemonizing (none of that code is touched). Nothing there rises to a real, confident finding.

Findings: None.

Merge as is.

@claude

claude Bot commented Sep 19, 2026

Copy link
Copy Markdown

Code review

This PR makes --artifact optional on upload build, threading Option<PathBuf> through to the existing request_artifact_upload flag that build::run and xcode post-action already supported but no CLI path could reach. It adds a validation block rejecting --mapping/--chunked/--out when no artefact is given (exit 20, config_invalid), updates the clap doc comment on artifact in the same change, and adds matching CLI-level tests plus an e2e flow.

I traced the new logic against build::run (artefact is only read/packed when request_artifact_upload is true, so the Path::new("") placeholder for the None case is never touched), the exit-code contract in src/exit_code.rs, and the mock-server e2e additions in scripts/e2e_flows.py — all consistent. The --help text, README, and CHANGELOG were all updated to describe the new optional behavior, satisfying the --help-drift rule in CLAUDE.md.

Findings: None.

One thing I noticed but don't consider blocking: the pre-existing "sidecar file must exist" check (--mapping/--deps/--timings) runs before the new "needs --artifact" check, so passing a nonexistent --mapping path with no --artifact returns exit 10 (input_not_found) rather than exit 20 (config_invalid) — the tests only exercise the case where the mapping file exists. Both are legitimate non-fallback codes and the ordering was already there, so this isn't a contract break, just a minor inconsistency worth a mention if you want the two checks to agree on precedence.

Recommend merging as is.

@krassx
krassx merged commit 0c70508 into main Sep 19, 2026
20 checks passed
@krassx
krassx deleted the feat/register-only-build branch September 19, 2026 10:47
@krassx krassx mentioned this pull request Sep 22, 2026
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.

1 participant