Skip to content

Improve Phabricator base-commit resolution - #6525

Open
suhaibmujahid wants to merge 1 commit into
mozilla:masterfrom
suhaibmujahid:worktree-fix-6415-expand-base-commit
Open

Improve Phabricator base-commit resolution#6525
suhaibmujahid wants to merge 1 commit into
mozilla:masterfrom
suhaibmujahid:worktree-fix-6415-expand-base-commit

Conversation

@suhaibmujahid

Copy link
Copy Markdown
Member

Fixes #6415

Copilot AI review requested due to automatic review settings August 6, 2026 01:13
@suhaibmujahid
suhaibmujahid requested a review from a team as a code owner August 6, 2026 01:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Improves Phabricator base-commit expansion so follow-up runs can reliably resolve abbreviated base commits to full fetchable hashes, even when the commit appears mirrored across multiple repositories and Phabricator doesn’t populate identifierMap.

Changes:

  • Enhance PhabricatorClient.resolve_commit() to fall back to a unique prefix match across diffusion.querycommits results when identifierMap is empty.
  • Add client tests covering mirrored commits, non-expansion matches, and ambiguous abbreviations.
  • Emit a broker warning when base-commit expansion fails, and assert that warning in tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
libs/phabricator-client/phabricator_client/client.py Adds fallback logic to expand abbreviated commits via unique prefix match in data when identifierMap is missing.
libs/phabricator-client/tests/test_client.py Adds tests for mirrored repos, filtering non-expansion identifiers, and ambiguity handling.
agents/bug-fix/hackbot_agents/bug_fix/broker.py Logs a warning when base commit cannot be expanded and falls back to the raw base.
agents/bug-fix/tests/test_broker.py Updates the patch-route fallback test to capture and assert the warning log.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/phabricator-client/phabricator_client/client.py Outdated
@suhaibmujahid
suhaibmujahid force-pushed the worktree-fix-6415-expand-base-commit branch from 9ad25d2 to 7f8cc69 Compare August 6, 2026 02:32
@suhaibmujahid
suhaibmujahid force-pushed the worktree-fix-6415-expand-base-commit branch from 7f8cc69 to 3a18d06 Compare August 6, 2026 02:39
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.

Failing to resolve the full commit hash for checkout on follow-up

2 participants