feat: support GitLab work items for projects without a Drupal.org issue queue#338
Merged
Conversation
…he Drupal.org issue queue
Projects with `field_project_has_issue_queue: false` now route through
`glab` CLI instead of the Drupal.org API.
- Add `hasIssueQueue` to `Project` entity
- Add `WorkItemRef` to parse `git.drupalcode.org/-/work_items/{id}` URLs
- Add `GetGitLabIssueAction` and `ListGitLabIssuesAction` (glab subprocess)
- Add `GitLabIssueResult` / `GitLabIssuesResult` with full formatter support
- `issue:show` detects GitLab URLs and delegates to glab
- `project:issues` delegates to glab when project has no D.o issue queue
- Register `gitlab_issue_show` and `gitlab_project_issues` MCP tools
Closes #335, closes #337
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GetGitLabIssueAction and ListGitLabIssuesAction now use the existing GitLab\Client (Guzzle) instead of shelling out to glab. Public projects on drupalcode.org require no auth; private projects use DRUPALORG_GITLAB_TOKEN when set. This removes the glab dependency for all read operations. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ands IssueCommandBase now detects work item URLs (git.drupalcode.org/-/work_items), extracts the numeric NID and stores a WorkItemRef. GetIssueForkAction accepts an optional project machine name to skip the D.o node lookup, which fails for GitLab-native work items that have no field_project on drupal.org. issue:get-fork https://git.drupalcode.org/project/ai_context/-/work_items/3586157 mr:list https://git.drupalcode.org/project/ai_context/-/work_items/3586157 Both now resolve the issue fork and project MRs correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…upport Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
WorkItemRef better matches MergeRequestRef's naming convention. Also adds shorthand notation so users can reference work items without full URLs: ai_context#3586157 (project/ prefix assumed) project/ai_context#3586157 (explicit path) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- drupalorg-work-on-issue: accept WorkItemRef inputs (NID, shorthand, URL) - drupalorg-cli: document WorkItemRef formats, GitLab project auto-detection, updated error table with GitLab-specific errors - drupalorg-issue-search: detect GitLab work item projects and skip D.o channels - drupalorg-issue-summary-update: early-exit with clear message for GitLab work items Closes #337 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mr:status, mr:diff, mr:files, and mr:logs all pass $this->mrRef to their actions. When a WorkItemRef is parsed by IssueCommandBase, mrRef was never set, so actions fell through to resolveGitLabProject() which fails for GitLab work item projects (no field_project on the D.o node). Synthesizing a MergeRequestRef from the WorkItemRef's projectPath causes actions to use resolveFromRef() instead, which queries GitLab directly. Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
field_project_has_issue_queue: falseon the D.o project nodeproject:issuesdelegates toglab issue listfor these projects (shows a stderr notice)issue:showacceptsgit.drupalcode.org/-/work_items/{id}and/-/issues/{id}URLs, fetching viaglab issue view--format=json|md|llmsupport via newGitLabIssueResult/GitLabIssuesResulttypes and formatter implementationsgitlab_issue_show(workItemUrl)andgitlab_project_issues(machineName, state, limit)Key detail: On drupalcode.org, the GitLab
iidequals the Drupal.org NID, so the number in/-/work_items/3586157maps directly toglab issue view 3586157.Requires
glabCLI installed and authenticated withgit.drupalcode.org.Closes #335
Closes #337
Test plan
./drupalorg project:issues ai_context— uses glab path, prints notice to stderr./drupalorg project:issues drupal— still uses D.o API path./drupalorg issue:show https://git.drupalcode.org/project/ai_context/-/work_items/3586157./drupalorg project:issues ai_context --format=json./drupalorg issue:show https://git.drupalcode.org/project/ai_context/-/work_items/3586157 --format=llm🤖 Generated with Claude Code