Support migrated GitLab work items in issue:branch and bare NID resolution - #385
Merged
Merged
Conversation
… found" Drupal.org answers a migrated node ID with a stub whose only field is new_url. getNode() read that as a missing node. It now throws MigratedIssueException carrying the parsed work item ref, and the message names the qualified ref to pass. IssueProjectResolver takes the project from that ref, so a bare NID resolves for issue:get-fork, issue:setup-remote, and issue:checkout without a qualifier. Refs #380 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
No behavior change. The slug and version-branch rules move to IssueBranchNaming so a GitLab work item can name its branch the same way a Drupal.org issue does. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The command parsed project#nid and work item URLs but then discarded the ref and read the Drupal.org node, which fails for migrated issues. The action now takes the ref, or follows a migrated node to GitLab, and names the branch from the work item title and its version label (for example v2.0.x-dev). Work items without a version label fall back to the project's default branch. Fixes #380 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ue error Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…item ref IssueCommandBase returned early after parsing project#nid or a work item URL and never opened the repository, so issue:branch crashed with an uninitialized property for those forms. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A bare NID for a migrated issue now renders the work item instead of stopping with the migration error. The command already had the GitLab path; it only needed to catch MigratedIssueException and reuse it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…he repository The generic collision message offered a Drupal.org issue that no longer exists. A migrated issue in another project now says where the work item lives and asks for a clone of that project. Co-Authored-By: Claude Fable 5.1 <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.
Fixes #380.
issue:branchfailed for an issue that migrated from Drupal.org to a GitLab work item, in every form the reporter tried: bare NID,project#nid, and the work item URL. The error said the node was not found, which was wrong.What changed
new_url.Client::getNode()now throwsMigratedIssueExceptioncarrying the parsed work item ref. The message names the qualified ref to pass. Commands without work item support show that instead of "not found".IssueProjectResolvertakes the project from that ref, soissue:get-fork 3617735,issue:setup-remote 3617735, andissue:checkout 3617735work with no qualifier and no extra request.issue:branchsupports work items. The action takes the ref, or follows a migrated node to GitLab. The branch slug comes from the work item title. The base branch comes from the version label (v2.0.x-devgives2.0.x) and falls back to the project's default branch when there is no version label, which is the case on ai_context.issue:showfollows the migration. A bare NID for a migrated issue renders the work item instead of stopping with the migration error.IssueCommandBaseopens the repository for work item refs. It returned early after parsingproject#nidor a URL, so any command that used the repository crashed with an uninitialized property.IssueNodetoIssueBranchNamingso both sources name branches the same way. That commit is a pure refactor.Testing
Unit tests cover the migrated stub in
getNode(), the resolver with and without a repository project, the collision case, work items with and without a version label, and a bare NID that follows the redirect to GitLab.Live, in a clone of restrict_route_by_ip, without a token:
Each checks out
2.0.xand creates3617735-fix_js_on_add_form_a.issue:show 3617735,issue:get-fork 3617735, andissue:checkout 3617735also work with the bare NID.issue:setup-remote 3617735from a clone of poll prints the work item collision message and adds no remote.🤖 Generated with Claude Code