Repository navigation
bot: trim each recycled tag in the file the PR tagged it in - #96
Merged
Merged
Conversation
split.py located each recycled QID with a substring grep over the whole checkout, which includes upstream files, and took the first file listed. A longer QID (Q123 for Q12) or an upstream copy of the tag could win, the real tag stayed on the PR, and the poller re-settled and re-triaged it on every tick while the header counted it as removed. settle.classify already records each tag's file from the PR diff. poll.py and daily_bot.py now pass QID=FILE pairs, and split.py looks only there, matching whole words. On --apply it plans against the fetched tip only, refuses when a tag isn't in its file, and refuses (restoring the files) when a tag is still present after the edit, so the tick goes red instead of looping. Fixes #86.
…plit-trim-file # Conflicts: # scripts/ci-python.sh
From the review of this PR: - bot/README.md lists the two new red-tick messages and how to tell a stale diff (dispatch again) from a moved or doubly tagged file. - A test pins settle.classify's per-tag file to the repo-relative path split.py joins onto the checkout (it fails if the b/ prefix survives). - split.py's docstring said --apply amends and force-pushes; it commits and pushes fast-forward on the fetched tip.
Owner
Author
|
Merged ( Posted by the WikiLean PR swarm (lead). |
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.
Fixes #86.
What changed
bot/split.py:--recycletakesQID=FILEpairs.plan()looks for each QID only in its file (the pathsettle.classifyrecords from the PR diff) and only as a whole word. Before, it ran a substring grep over the whole checkout, upstream files included, and took the first file listed.--apply, the trim plans once against the fetched branch tip and prints that plan. Before, it printed a preview planned against whatever was checked out (master, in the poller's clone) and never printed the plan it applied.poll.pyalready runs the split withcheck=True, so the tick goes red instead of re-settling and re-triaging the same tags every tick.bot/poll.pyandbot/daily_bot.pypass the pairs.Tests
bot/test_split.py, added toscripts/ci-python.sh. It runssplit.py --apply --no-buildagainst a local bare repo shaped like the poller's clone (on master, with anupstreamremote), where master carriesQ12in another file andQ123in a third:Q12where onlyQ123is, an untagged QID, a missing file) fails and the branch doesn't move;bot/test_poll.py:do_settlepassesQ3=Mathlib/Order/Basic.leanto split.py.test_split4/4,test_poll43/43,test_settle_gate11/11,scripts/check_ci_python_tests.pyOK.Notes
bot/andscripts/ci-python.shonly). Merges cleanly with main at905c6def.split.pyruns need theQID=FILEform; the docstring shows it.