Skip to content
This repository was archived by the owner on Nov 16, 2026. It is now read-only.

fix(build): Unbreak the build for uint64 fields and the bound client type - #136

Merged
BYK merged 1 commit into
mainfrom
fix/uint64-build
Nov 9, 2026
Merged

BYK merged 1 commit into
mainfrom
fix/uint64-build

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Build has failed on main since the spec sync at 11-07 18:54Z. The automatic release did run on that push (Release run 42403582929). It cut release/1.52.0 and opened getsentry/publish#10297. That branch's Build also failed (run 42403616257), so #10297 is ci-failed and has no npm-package artifact. Since then, every push fails Release with craft's Release branch "release/1.52.0" already exists: runs 42508035369, 42592761019 and 42628769804.

Two separate spec changes broke the build.

1. TS7056 on createSentryClient (since dc25434)

Build 42403582935 failed with:

src/sentry-client.gen.ts:19:17 - error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize.

createSentryClient returned an inferred object type with about 270 bound methods, and declaration emit inlines it.

Fix: scripts/generate-client.mjs also emits a named SentryClient interface, with the same signatures and JSDoc, and annotates createSentryClient(config): SentryClient. The .d.ts now refers to the interface by name. SentryClient is still exported. It's now an interface instead of ReturnType<typeof createSentryClient>, with the same readonly members.

2. BigInt(0) from format: uint64 (since 4260bab)

Builds 42508035590, 42592761038 and 42628769704 failed with:

Error: zod.gen.ts: unexpected top-level call outside `z.*`: BigInt(0)

The spec now has 120 integers with "format": "uint64", such as event context fields like app_memory. Hey API types them as number, but its Zod schema is z.coerce.bigint().gte(BigInt(0)).max(BigInt('18446744073709551615')). The tree-shaking guard rejects that schema. It would also turn JSON numbers into bigints that don't match the generated types.

Fix: lib/normalize-spec.mjs now drops uint64 formats, as it already does for int64 integers with safe bounds. The validators then produce the number that the types promise. A new normalize-spec test covers this.

After this merges

The stale release/1.52.0 branch (46c54bc) predates both fixes and the three later syncs, so it can't be published:

  1. Delete release/1.52.0.
  2. Close publish: getsentry/[email protected] publish#10297.
  3. Dispatch Release with version: 1.52.0.

Local results

These ran on current main (89d031f) plus this change, in a sandbox with 4 vCPUs and 8 GB:

  • pnpm build passes. The sandbox needed NODE_OPTIONS=--max-old-space-size=4096 for the declaration workers, or they ran out of memory. CI runners have more memory.
  • pnpm typecheck passes.
  • pnpm test passes: 52 files, 655 tests.

via @BYK.

--

View Session in Sentry

…type

Two spec syncs broke `pnpm build` on main, so the 1.52.0 release has no
artifact to publish.

- dc25434: `createSentryClient`'s inferred return type grew past what
  tsc will serialize (TS7056), so declaration emit failed. The generator
  now emits a named `SentryClient` interface and annotates the function
  with it.
- 4260bab: the spec gained `format: uint64` integers. Hey API turns them
  into `z.coerce.bigint().gte(BigInt(0))`, and the tree-shaking guard
  rejects the top-level `BigInt(...)` call. normalize-spec now drops
  uint64 formats, as it already does for safe int64 ones, so the
  validators produce the `number` the generated types promise.

Co-Authored-By: BYK <[email protected]>
@BYK
BYK merged commit 4230710 into main Nov 9, 2026
11 checks passed
@BYK
BYK deleted the fix/uint64-build branch November 9, 2026 15:50
BYK added a commit to getsentry/toolkit that referenced this pull request Nov 9, 2026
Bumps the `@sentry/api` catalog entry from 1.51.0 to 1.53.0. The
`minimumReleaseAgeExclude` entry and the lockfile are updated to match.

- 1.52.0 is the first release with the stricter response types from
getsentry/sentry: literal unions, UUID formats, activities keyed on
`type`, and typed event contexts. It was published after
getsentry/sentry-api-schema#136 fixed that repo's build.
- 1.53.0 adds the spec sync that landed while 1.52.0 was pending
(getsentry/sentry-api-schema@83a2b744). It only adds the 30-day search
limit to the AI conversation endpoint descriptions; no types change.

## What broke

`pnpm run tsc` failed in two CLI spots. Both were real mismatches, not
just stricter types:

- **`issue-app-links.ts`:** a Sentry App component's `schema` is now a
union keyed on `type`, and only `issue-link` has `link`. Sentry stores
each component's `schema` as the app's schema element, `type` included
(`SentryAppComponent.objects.create(type=element["type"],
schema=element)` in `sentry_apps/logic.py`). The CLI now narrows on
`schema.type === "issue-link"` before it validates `link` with the
existing `LinkFormSchema`.
- **`human.ts` (`formatIssueDetails`):** `firstRelease`/`lastRelease`
can be just `{ version }`. `serialize_releases` in
`api/helpers/group_index/index.py` returns that when it can't load the
release. The CLI read only `shortVersion`, so it dropped the release
from issue details. A small `releaseVersion` helper now falls back to
`version`.

## Tests

- `issue-app-links.test.ts`: the new response validators check UUID
formats and the issue-link schema shape. The fixtures used
`"install-uuid"`-style IDs and a `{ link }`-only schema, so they no
longer passed. They now use real UUIDs and a full `{ type: "issue-link",
link, create }` schema. The unsupported-form case now sends a field type
the CLI can't fill (`checkbox`), instead of a missing `link` that the
API contract rules out.
- `human.details.test.ts`: new case for the `{ version }`-only release
fallback.
- Nothing in toolkit read `invite_link`, so there were no tests to
update for its removal.

## Generated files

-
`packages/cli/plugins/sentry-cli/skills/sentry-cli/references/{alert,event,release}.md`
were regenerated by the CLI `typecheck` docs step from the new field
descriptions. A few `config` fields now read `unknown` / `object |
unknown`. That comes from how the generator renders the new schema
unions, not from a CLI change. 1.53.0 didn't change them again.
- `pnpm run --filter @sentry/mcp-core generate-definitions` reports the
definitions are up to date. Tool definitions didn't change, so
`measure-tokens` isn't affected.

## Quality gate (local sandbox, on 1.53.0)

- `pnpm run tsc`: passes.
- `pnpm run lint`: passes.
- Tests: mcp-core, toolkit-core, mcp-cloudflare, mcp-test-client,
logger, apps/local, apps/docs-mcp and apps/games-api all pass. The CLI
passes 12951 tests with 6 failures. The same 6 fail on unchanged `main`
in this sandbox and passed in this PR's CI on 1.52.0: permission and
EACCES cases in completions, upgrade lock, resilient DB and
code-scanner, and a delta-upgrade patch case. `@sentry/cli3to4` can't
run here because its `codemod` binary needs GLIBC 2.35.

No UI change, so no screenshots.

The branch is still named `deps/sentry-api-1.52.0`, so the PR stays the
same.

Please keep this trailer in the squash commit message:

Co-Authored-By: BYK <[email protected]>

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Ad31ca5f1f079a8864e79400fd1e95da4 -->

--

[View Session in
Sentry](https://sentry.sentry.io/explore/conversations/agent%3Ad31ca5f1f079a8864e79400fd1e95da4/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>
BYK added a commit that referenced this pull request Nov 9, 2026
)

From 11-07 to 11-09, `@sentry/api` didn't release for 2 days and nobody
noticed. Build was red on `main`, and every Release run failed on the
stale `release/1.52.0` branch, but nothing reported it. Releases can
also get stuck with no failing run at all. 83a2b74, for example, landed
while 1.52.0 was pending and sat unreleased.

This PR adds a `Release pipeline health` workflow. It keeps one issue,
**"Release pipeline failing on main"**, open while the pipeline is
broken.

**Failure alerts.**
- When Build (push builds only) or Release fails on `main`, the workflow
opens the issue, or comments on it if it's already open.
- Each message links the run and the commit.
- The issue body mentions @BYK, which subscribes him to later comments.

**Recovery.**
- The next successful Release run closes the issue and links that run.
- Skipped and cancelled runs don't count.

**Daily staleness check.** At 08:23 UTC, and on manual dispatch, the
workflow reports to the same issue in either of these cases:
- The oldest "Generated" commit on `main` that isn't in the newest npm
release is more than 24h old. The newest npm release comes from `npm
view @sentry/api version`, matched to its git tag. A missing tag is
reported too.
- An open getsentry/publish request for this repo has had `ci-failed`
for more than 24h, counted from when the label was added.

The first check measures how long a schema commit has been waiting. A
commit that landed 1h after a long quiet stretch doesn't trigger it. A
commit stranded a minute after a release, like 83a2b74, still does.

The workflow uses the default `GITHUB_TOKEN` with `contents: read` and
`issues: write`. getsentry/publish is public, so that token can read its
issues and their events. No new secrets, no Slack.

## Testing

I ran both scripts under `dash`.

**Staleness check on real data:**
- Today's `main` is reported as up to date.
- With the clock moved 2 days ahead, it reports 83a2b74.
- At 8234586, with npm at 1.51.0 and the clock at 11-09 15:00Z, it
reports 6 unreleased "Generated" commits, the oldest being dc25434 from
44h earlier. The 11-07 incident would have alerted about a day in.

**Stubbed runs:**
- A `ci-failed` request older than 24h is reported. A newer one, and
requests for other repos, are not.
- When `npm`, the issue list, or the events fetch fails, the run fails.
- The issue script opens, comments on, or closes the issue, or does
nothing when no issue is open. It exits non-zero when listing or writing
issues fails.

`actionlint` and `shellcheck --shell=sh
--enable=check-extra-masked-returns` pass.

No UI changes, so no screenshots.

## Notes

- This works with or without the companion Release PR (#137), and it
assumes #136, which is merged.
- If the staleness check itself fails, for example because npm is down,
GitHub's usual failed-run email for scheduled workflows is the only
signal.
- No admin setup is needed.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A3469a89d1b152f2e4ef70bbb981e697e -->

--

[View Session in
Sentry](https://sentry.sentry.io/explore/conversations/agent%3A3469a89d1b152f2e4ef70bbb981e697e/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

publish: getsentry/[email protected]

1 participant