fix: bug: dispatcher PR lookup fails — --diff-filter=A misses merge commits (#129) #130
No reviewers
Labels
No labels
action
backlog
blocked
in-progress
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: johba/disinto#130
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-129"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #129
Changes
AI Review
Summary
This PR fixes two real bugs and adds missing compose env vars:
get_pr_for_filerewrite — The original code used--diff-filter=Awhich never matches merge commits, so PR lookup always failed. The two-step approach (find the adding commit, then walk to the merge commit via--ancestry-path) is conceptually correct.get_pr_mergerops-repo fix — Was queryingFORGE_API(disinto repo) instead of the ops repo. Now correctly usesFORGE_OPS_REPO.export USERin entrypoint — Alpine does not setUSER;env.shderivesPROJECT_REPO_ROOTfrom it, so this was producing a bad default path.launch_runner— Loosens the hard error to a log message, allowing formula-only actions with no declared secrets.FORGE_REPO,FORGE_OPS_REPO,FORGE_TOKEN,OPS_REPO_ROOT,PROJECT_REPO_ROOT,PRIMARY_BRANCHwhich dispatcher.sh requires but were missing from the edge service config.Issues
medium
docker/edge/dispatcher.sh:123-124:head -1returns the most recent merge commit in the ancestry path, not the earliest (the direct PR merge).git log --merges --ancestry-path add_commit..HEADemits commits newest-first, sohead -1picks the latest merge on main — which is likely a completely different PR.Concrete failure scenario: vault action file arrives via PR #50. A few minutes later PR #51 is merged. Dispatcher polls — ancestry-path lists PR #51's merge commit first, so
head -1returns 51 instead of 50. Admin-verification then checks PR #51, not PR #50. If #51 was merged by a non-admin the legitimate action is blocked; if #51 does not exist the lookup fails silently.Fix: add
--reverseso the first output line is the oldest (direct) merge:Everything Else
--diff-filter=Abug.get_pr_mergeris correct.USERexport beforeenv.shis the right Alpine fix.Verdict
REQUEST_CHANGES — get_pr_for_file uses head -1 on the merge-commit log, returning the newest merge instead of the direct PR merge commit
Reviewed at
e40ea2a| AGENTS.mdAI Review: REQUEST_CHANGES — get_pr_for_file uses head -1 on the merge-commit log, returning the newest merge instead of the direct PR merge commit
AI Re-review (round 2)
Previous Findings\n\n- medium
dispatcher.sh:123-124—head -1returns newest merge commit instead of direct PR merge → FIXED:--reverseadded sohead -1now returns the oldest (closest toadd_commit) merge commit, exactly as requested.\n\n### New Issues\n\nNone.Verdict
APPROVE — Previous finding fixed: --reverse added so head -1 returns the oldest (direct PR) merge commit, not the newest
Reviewed at
978dd88| Previous:e40ea2a| AGENTS.mdAI Re-review (round 2): APPROVE — Previous finding fixed: --reverse added so head -1 returns the oldest (direct PR) merge commit, not the newest