Repository navigation
fix(ci): Keep decision model lint comments within size limits - #131780
Merged
Merged
Conversation
The decision-model lint step failed on a 3k-file PR with "gh: Argument list too long" because the whole report went to gh as one argument. Skip the linter when a PR changes more than 1000 files, like other PR jobs do; a skip only replaces an earlier lint comment. Pass the comment body to gh from a file, and cut reports longer than a GitHub comment allows, keeping the full report in the job summary. The step's shell moves to a POSIX script checked by shellcheck. Co-Authored-By: Dominik Dorfmeister <1021430+TkDodo@users.noreply.github.com>
Upload reports over 1 MiB as workflow artifacts and link to them from the PR comment. Keep the shell code in the workflow so the diff shows the behavior changes.
TkDodo
marked this pull request as ready for review
November 19, 2026 14:21
azulus
approved these changes
Nov 19, 2026
joshuarli
approved these changes
Nov 19, 2026
joshuarli
added a commit
that referenced
this pull request
Nov 19, 2026
Workflow logic in YAML strings is never linted and can't be tested. This
moves the significant inline `run:` blocks in `.github/workflows/*.yml`
into `.github/workflows/scripts/`, and each step now calls its script.
Values reach the scripts through env vars or arguments, never `${{ }}`
templating. Exit codes, `GITHUB_OUTPUT`/`GITHUB_ENV` writes, and stdout
stay the same.
Known stderr differences, accepted on purpose:
- Three steps ran with `set -x` (bump-version, bump-sentry-in-getsentry,
the prek run in pre-commit.yml). Under dash or Python their trace lines
look a little different than they did under bash.
- On paths that can't happen in CI, such as a missing command, the error
text dash prints differs from bash's.
**POSIX `sh`** (mostly CLI commands in order). The `shellcheck (POSIX
sh)` hook in `.pre-commit-config.yaml` no longer keeps a list of files.
It now checks every script in `.github/workflows/scripts/` whose shebang
is `sh` (`types: [sh]`). That also brings two existing scripts under
shellcheck: `api-package-release-preflight.sh` and
`install-chrome-for-testing.sh`.
- backend.yml / acceptance.yml: `inspect-failure.sh` (one script for all
7 "Inspect failure" steps), `download-coverage-db.sh`,
`reconnect-postgres-socket.sh`, `install-odiff.sh`,
`run-backend-tests.sh`, `run-acceptance-tests.sh`, `warm-up-chrome.sh`
- frontend.yml: `check-generated-file.sh FILE DESCRIPTION COMMAND`,
shared by the form field registry and embed widget checks
- frontend-snapshots.yml: `install-playwright.sh deps|browser`,
`get-snapshot-merge-base.sh`
- type-coverage-diff.yml: `get-base-commit.sh`
- pre-commit.yml: `run-prek.sh`
- bump-sentry-in-getsentry.yml: `bump-sentry-in-getsentry.sh`, run from
the `sentry/` checkout
- update-baseline.yml: `publish-baseline-browser-mapping-pr.sh`
- update-public-suffix-list.yml: `publish-public-suffix-list-pr.sh`,
`send-public-suffix-list-checkin.sh`
- prune-oxlint-suppressions.yml: `publish-oxlint-suppressions-pr.sh`
- react-to-product-owners-yml-changes.yml: `install-pyyaml.sh`, now its
own step before `./bin/react-to-product-owners-yml-changes.sh`
- decision-model-lint.yml: `run-decision-model-lint.sh`, the lint step
as merged in #131780. Two small changes satisfy
shellcheck without changing output: the notes that contain backticks are
double-quoted, and the oversized-report branch writes to the comment
body with one grouped redirect. knip can't see the `pnpm exec
decision-model-linter` call inside a shell script, so `knip.config.ts`
now lists `@sentry/decision-model-linter` under `ignoreDependencies`.
`run-prek.sh` and `install-pyyaml.sh` replace `shell: bash` steps that
used `pipefail` pipelines. They save each stage's exit status and exit
with the status of the last stage that failed, the same way `pipefail`
did. Every stage still runs, and the step fails with the same code.
**Python 3, standard library only**, on the runner's system `python3`.
Nothing in it is newer than 3.12, the oldest Python on these images:
- bump-version.yml: `bump-version.py`. `PR_OPTIONS` splitting matches
the old `read -r -a`: first line only, split on spaces and tabs, no
quote or glob processing. The `latest` lookup still runs `curl -sL | jq
-r .info.version`, and on failure it exits with the same status the old
`pipefail` pipeline did.
- frontend-snapshots.yml: `write-vcs-metadata.py`. It writes the same
bytes as the old `jq -n` call.
**Node**: prune-oxlint-suppressions.yml's heredoc is now
`bundle-oxlint-suppressions.js`, unchanged.
**Left inline on purpose**
- frontend-snapshots-upload.yml (`workflow_run`, privileged),
self-hosted.yml manifests, dispatch-api-consumers.yml: these jobs have
no checkout.
- package-pack.yml: its sparse checkout of `static/packages` would leave
the script out.
- fast-revert.yml "comment on failure": `pull_request_target`, and the
revert action rewrites the worktree before this step runs, so a script
there could be the reverted version.
- Kafka healthcheck swap in backend.yml and acceptance.yml: it relies on
bash's `time` keyword, and POSIX sh would change that output.
- "Get changed files" in backend.yml, acceptance.yml,
getsentry-dispatch.yml: one pipe into `parse-pr-files.py`. A `gh`
failure there gives empty lists, which runs the full suite. Splitting
the pipe for POSIX sh would risk changing that.
- One- and two-command steps (matchers, cache paths, the lint ratchet
if/else, migrations output, requirements check).
**Open questions for owners** (existing bugs, not touched here)
- backend.yml typing, mypy message greps: under `set -e`, a `! grep`
line never aborts, so only the last pattern is enforced.
- development-environment.yml direnv activation: `| tee direnv.log`
hides the exit status of the `direnv exec ... test` check.
<!-- junior-request-attribution:start -->
via @joshuarli, @TkDodo.
<!-- junior-request-attribution:end -->
<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A7217252d5acb73d5414c0eb9b5f3876f -->
--
[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A7217252d5acb73d5414c0eb9b5f3876f)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A7217252d5acb73d5414c0eb9b5f3876f/?project=4510944073809921)
<!-- junior-session-footer:end -->
---------
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Joshua Li <14209781+joshuarli@users.noreply.github.com>
Co-authored-by: joshuarli <joshuarli98@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Decision model lint checks every changed file. It passes the PR comment body to
ghthrough a temporary file. This avoids the operating system argument limit that caused the failure on #131758.For reports over 60,000 bytes, the PR comment shows an excerpt and links to the workflow run. The job summary shows the full report up to GitHub's 1 MiB limit. Above that limit, the excerpt remains available in the PR comment, and GitHub adds an annotation without changing the job result.
via @TkDodo.
--
View Session [Sentry]