Skip to content

Conversation

@kim-em
Copy link
Contributor

@kim-em kim-em commented Jan 4, 2026

When no PRs are found between old and new nightlies, the prs.txt file is empty. An empty pattern file causes grep -f prs.txt to match ALL lines, which incorrectly selects every lean-pr-testing-* branch for merging.

This caused a catastrophic failure on 2026-01-04 where the workflow attempted to merge 600+ old adaptation branches into nightly-testing, including branches for PRs that aren't even in the nightly (like lean-pr-testing-10387 from September 2025, and lean-pr-testing-2714 from October 2023!).

The fix checks if PRS is empty and exits early, setting branches_exist=false.

See workflow run: https://github.com/leanprover-community/mathlib4-nightly-testing/actions/runs/20690417192

🤖 Generated with Claude Code

… branches

When no PRs are found between old and new nightlies, the `prs.txt` file
is empty. An empty pattern file causes `grep -f prs.txt` to match ALL
lines, which incorrectly selects every `lean-pr-testing-*` branch for
merging.

This caused a catastrophic failure on 2026-01-04 where the workflow
attempted to merge 600+ old adaptation branches into nightly-testing,
breaking the build.

The fix checks if PRS is empty and exits early, setting branches_exist=false.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Jan 4, 2026

PR summary 6f1904fdcc

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions bot added the CI Modifies the continuous integration setup or other automation label Jan 4, 2026
kim-em added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jan 4, 2026
Reverts the following branches that were incorrectly merged due to a bug
in discover-lean-pr-testing.yml where an empty prs.txt caused grep to
match ALL lean-pr-testing branches:

- lean-pr-testing-2714 (from Oct 2023!)
- lean-pr-testing-11455
- lean-pr-testing-11163
- lean-pr-testing-10231
- lean-pr-testing-10178
- lean-pr-testing-10059

These PRs are not in nightly-2026-01-04, so their adaptations should not
be merged.

The bug fix is in: leanprover-community#33546

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Collaborator

@adomani adomani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable: let's see how it works!

bors merge

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the ready-to-merge This PR has been sent to bors. label Jan 4, 2026
mathlib-bors bot pushed a commit that referenced this pull request Jan 4, 2026
… branches (#33546)

When no PRs are found between old and new nightlies, the `prs.txt` file is empty. An empty pattern file causes `grep -f prs.txt` to match ALL lines, which incorrectly selects every `lean-pr-testing-*` branch for merging.

This caused a catastrophic failure on 2026-01-04 where the workflow attempted to merge 600+ old adaptation branches into nightly-testing, including branches for PRs that aren't even in the nightly (like lean-pr-testing-10387 from September 2025, and lean-pr-testing-2714 from October 2023!).

The fix checks if PRS is empty and exits early, setting `branches_exist=false`.

See workflow run: https://github.com/leanprover-community/mathlib4-nightly-testing/actions/runs/20690417192

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jan 4, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title fix(CI): prevent empty grep pattern from matching all lean-pr-testing branches [Merged by Bors] - fix(CI): prevent empty grep pattern from matching all lean-pr-testing branches Jan 4, 2026
@mathlib-bors mathlib-bors bot closed this Jan 4, 2026
@mathlib-bors mathlib-bors bot deleted the fix-discover-lean-pr-testing-empty-grep branch January 4, 2026 12:23
kim-em added a commit to kim-em/mathlib4 that referenced this pull request Jan 6, 2026
… branches (leanprover-community#33546)

When no PRs are found between old and new nightlies, the `prs.txt` file is empty. An empty pattern file causes `grep -f prs.txt` to match ALL lines, which incorrectly selects every `lean-pr-testing-*` branch for merging.

This caused a catastrophic failure on 2026-01-04 where the workflow attempted to merge 600+ old adaptation branches into nightly-testing, including branches for PRs that aren't even in the nightly (like lean-pr-testing-10387 from September 2025, and lean-pr-testing-2714 from October 2023!).

The fix checks if PRS is empty and exits early, setting `branches_exist=false`.

See workflow run: https://github.com/leanprover-community/mathlib4-nightly-testing/actions/runs/20690417192

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@adomani adomani mentioned this pull request Jan 16, 2026
goliath-klein pushed a commit to PrParadoxy/mathlib4 that referenced this pull request Jan 24, 2026
… branches (leanprover-community#33546)

When no PRs are found between old and new nightlies, the `prs.txt` file is empty. An empty pattern file causes `grep -f prs.txt` to match ALL lines, which incorrectly selects every `lean-pr-testing-*` branch for merging.

This caused a catastrophic failure on 2026-01-04 where the workflow attempted to merge 600+ old adaptation branches into nightly-testing, including branches for PRs that aren't even in the nightly (like lean-pr-testing-10387 from September 2025, and lean-pr-testing-2714 from October 2023!).

The fix checks if PRS is empty and exits early, setting `branches_exist=false`.

See workflow run: https://github.com/leanprover-community/mathlib4-nightly-testing/actions/runs/20690417192

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Modifies the continuous integration setup or other automation ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants