fix: scope mr:list to the issue fork instead of the whole parent project - #365
Merged
Conversation
mr:list <nid> listed every MR on project/{name}, so an issue with no MRs
returned unrelated project MRs. mr:status and mr:logs auto-selected from
that same list.
GitLab only lists MRs on their target project, so the parent project is
still queried but now filtered with source_project_id set to the issue
fork. A missing fork returns an empty list. The result carries an
issue_fork field so output shows which scope produced the list.
Closes #364
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What changed
mr:list <nid>now returns only MRs opened from the issue's fork. An issue with no fork or no MRs returns an empty list instead of every open MR on the parent project.mr:statusandmr:logsauto-selection uses the same scoped list, so they no longer pick an unrelated MR whenmr-iidis omitted.Closes #364. Reported by @tedbow.
Why
#314 moved
mr:*resolution fromissue/{name}-{nid}toproject/{name}because MR IIDs belong to the target project. That was right formr:diff/mr:status/mr:logs, butmr:listinherited it and lost its issue scope:drupalorg mr:list 3591850returned !16891, !16890, ... fromproject/drupal, none related to the issue.How
GitLab's
GET /projects/:id/merge_requestsonly returns MRs targeting that project, so listing on the fork returns[]. The action keeps querying the parent project and addssource_project_id={fork id}:MergeRequestListResult, no MR request made. Other GitLab errors propagate.MergeRequestListResultgainsissueFork(issue_forkin JSON,<issue_fork>in llm, a line in md). It isnullfor project-wide lists (mr:list project/drupal), which stay unchanged.ListMergeRequestsActionaccepts an optional$projectMachineName, mirroringGetIssueForkAction, so WorkItemRef input (project/ai_context#3586157) skips the Drupal.org node lookup.Testing
vendor/bin/phpcs src tests,vendor/bin/phpstan analyse src,vendor/bin/phpunit(167 tests) all pass.mr:list 3591850→No opened merge requests found for issue fork issue/drupal-3591850.(fork exists, zero MRs)mr:list 3619614→ only !16890mr:list 'project/ai_context#3586157' --state=all→ only !141, no Drupal.org requestmr:list project/drupal→ project-wide,issue_fork: nullmr:status 3619614 -n→ auto-selects !16890🤖 Generated with Claude Code