Skip to content

Fail CI on new linter ecosystem panics#23597

Merged
ntBre merged 8 commits intomainfrom
brent/ecosystem-panic
Mar 4, 2026
Merged

Fail CI on new linter ecosystem panics#23597
ntBre merged 8 commits intomainfrom
brent/ecosystem-panic

Conversation

@ntBre
Copy link
Contributor

@ntBre ntBre commented Feb 26, 2026

Summary

The huge number of changes in #22205 (comment) should have
obviously been a red flag, but I think it would be nice if CI failed when new
ecosystem panics were introduced. This PR adds a check for diagnostic lines that
start with panic: Panicked at crates/, raises a ToolError if any are found
in the results from the comparison executable, and then also exits non-zero if
any errors are returned
fails the CI run if the corresponding error message
was printed.

After trying this out in CI, I opted not to change the script's exit code itself
because that suppressed the ecosystem comment. It feels a little hackier
this way but preserves the behavior I wanted of both failing CI and still getting
the ecosystem comment to help with debugging.

Test Plan

Local testing on the 0.15.3 tag showing that ruff-ecosystem exited non-zero and
some manual testing in CI, as you can see below.

Summary
--

The huge number of changes in
#22205 (comment) should have
obviously been a red flag, but I think it would be nice if CI failed when new
ecosystem panics were introduced. This PR adds a check for diagnostic lines that
start with `panic: Panicked at crates/`, raises a `ToolError` if any are found
in the results from the comparison executable, and then also exits non-zero if
any errors are returned.

If exiting non-zero is going too far, we could also just raise the `ToolError`,
as that will at least trigger this message, which was not the case on the
PLR1712 PR:

https://github.com/astral-sh/ruff/blob/f14edd8661e2803254f89265548c7487f47a09f6/python/ruff-ecosystem/ruff_ecosystem/check.py#L103-L106

Another option would be not to exit zero if Ruff panics, even if `--exit-zero`
is used, but I saw that ty has the same behavior and assumed that that was
intentional.

Test Plan
--

Local testing on the 0.15.3 tag showing that ruff-ecosystem exited non-zero. I
can also introduce a panic into a lint rule to test this in CI
@ntBre ntBre added the ci Related to internal CI tooling label Feb 26, 2026
@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 26, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@ntBre
Copy link
Contributor Author

ntBre commented Feb 26, 2026

Exiting non-zero is probably going to disrupt the bot comment, which seems annoying for tracking down the cause of the panic. Testing that now.

@ntBre ntBre force-pushed the brent/ecosystem-panic branch from 87054ba to 0e2f588 Compare February 26, 2026 21:54
@ntBre ntBre force-pushed the brent/ecosystem-panic branch from 0e2f588 to 5a2d882 Compare February 26, 2026 22:11
@ntBre
Copy link
Contributor Author

ntBre commented Feb 26, 2026

That successfully got an ecosystem comment while still failing the ecosystem check, so I reverted the intentional panic.

@ntBre ntBre marked this pull request as ready for review February 26, 2026 23:52
@ntBre ntBre changed the title Raise ToolError and exit non-zero on ecosystem panics Raise ToolError and fail CI on new ecosystem panics Feb 27, 2026
@ntBre ntBre changed the title Raise ToolError and fail CI on new ecosystem panics Fail CI on new linter ecosystem panics Feb 27, 2026
@ntBre ntBre requested a review from MichaReiser March 4, 2026 15:00
@ntBre ntBre merged commit d7efaf4 into main Mar 4, 2026
47 checks passed
@ntBre ntBre deleted the brent/ecosystem-panic branch March 4, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Related to internal CI tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants