Skip to content

Clear not_landed needinfos after patches land - #3004

Open
loganrosen wants to merge 2 commits into
mozilla:masterfrom
loganrosen:loganrosen-clear-not-landed-needinfos
Open

Clear not_landed needinfos after patches land#3004
loganrosen wants to merge 2 commits into
mozilla:masterfrom
loganrosen:loganrosen-clear-not-landed-needinfos

Conversation

@loganrosen

@loganrosen loganrosen commented Aug 29, 2026

Copy link
Copy Markdown

Closes #3003.

Summary

  • track the exact Phabricator revisions that caused each not_landed needinfo
  • run cleanup in a dedicated scheduled rule that queries current pending BugBot needinfos and matches them to not_landed comments
  • clear only needinfo flags attributable to the rule when every tracked revision is published or the bug is closed
  • recover revision IDs for legacy needinfos once, retry inaccessible bugs on later runs, and cap cleanup at 50 bugs per run
  • cover landing, resolution, historical comments, legacy tracking, and unrelated-flag safety cases

Testing

  • uv run pytest -q tests/rules/test_not_landed.py tests/rules/test_not_landed_cleanup.py
  • pre-commit run --all-files
  • uv run python -m bugbot.rules.not_landed_cleanup (authenticated live dry run; 50 expected flag clears, capped at 50)

Checklist

  • Type annotations added to new functions
  • Docs added to functions touched in main classes
  • Dry-run produced the expected results
  • The to-be-announced tag added if this is worth announcing

Track the exact Phabricator revisions behind each not_landed needinfo and clear only the matching BugBot-created flags after those revisions publish or the bug closes. Retire completed tracking records and cover landing, resolution, legacy, and unrelated-flag safety cases.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@suhaibmujahid suhaibmujahid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We need to check with @mozilla/release-management to make sure that they agree.

In any case, this fits to be in its own rule instead of an addition to the existing not_landed rule.

@suhaibmujahid
suhaibmujahid requested a review from a team August 30, 2026 15:41
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@loganrosen

Copy link
Copy Markdown
Author

Moved the cleanup into a separate not_landed_cleanup rule and scheduled it after not_landed. The new rule queries live pending needinfos, verifies that each flag matches a BugBot not_landed comment by setter and timestamp, and clears it only when the bug is closed or all tracked revisions are published. It also handles legacy needinfos conservatively and caps cleanup at 50 bugs per run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[not_landed] Clear BugBot needinfos after the patch lands

2 participants