Improve Phabricator base-commit resolution - #6525
Open
suhaibmujahid wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
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 acrossdiffusion.querycommitsresults whenidentifierMapis 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.
suhaibmujahid
force-pushed
the
worktree-fix-6415-expand-base-commit
branch
from
August 6, 2026 02:32
9ad25d2 to
7f8cc69
Compare
suhaibmujahid
force-pushed
the
worktree-fix-6415-expand-base-commit
branch
from
August 6, 2026 02:39
7f8cc69 to
3a18d06
Compare
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 #6415