feat: return GitLab work item comments from issue:show --with-comments - #376
Merged
Conversation
The llm formatter wraps each comment in <comment> elements, and JSON output can carry the same text. Symfony Console treats <comment> as a built-in style and strips the tags, so agents received comment bodies with no enclosing element. Writing with OUTPUT_RAW preserves the formatter output byte for byte. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The policy checkpoints in the bundled skills tell agents to read the whole thread before writing code. For projects on GitLab work items the flag was accepted and ignored, so agents fell back to glab or the user. The GitLab client now reads the notes endpoint it already posted to, following pagination. The action skips system notes to match the Drupal.org path dropping "System Message" comments, and the result carries the remaining notes in the same number/author/created/body shape across text, json, md, and llm output. The skills drop the glab fallback. Closes #374 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ot-comments is passed The work item's labels and assignees already reflect what the bot confirms, so its replies are noise for an agent reading the thread. The flag brings them back when a slash command result needs checking. 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.
What changed
drupalorg issue:show <ref> --with-commentsnow returns the discussion for GitLab work items, not only classic Drupal.org issues. Comments render intext,json,md, andllmoutput using the same number/author/created/body shape as Drupal.org comments, so agents parse both the same way.A second, separate commit fixes a pre-existing output bug found while testing: Symfony Console treats
<comment>as a built-in style and stripped those tags from every--format=llmresponse, including the existing Drupal.org comment thread. Formatted output is now written withOUTPUT_RAW.Why
Closes #374. The AI contribution policy checkpoints merged in #375 tell agents to read the whole thread before writing code. For work item projects the flag was silently ignored, so the skills had to fall back to
glab issue view --comments. That fallback is removed here.How
GitLab\Client::getIssueNotes()reads the notes endpoint the client already posted slash commands to, following pagination at 100 per page in chronological order.GitLabNoteentity.GetGitLabIssueActiontakes a$withCommentsflag and dropssystem: truenotes, matching the Drupal.org path that drops "System Message" comments. Replies fromdrupalbotare dropped too by default, because the work item's labels and assignees already reflect what the bot confirms.--include-bot-commentsbrings them back.GitLabIssueResultcarriescomments, serialized under acommentskey in JSON.issue:showreads the flag before branching on ref type and renders comments in text mode for work items.glabfallback is gone from the policy reference and the work-on-issue skill, and the main skill no longer says the flag is Drupal.org-only.Testing notes
vendor/bin/phpunit: 219 tests pass. NewGetGitLabIssueActionTestcovers no notes request without the flag, system and bot note filtering, the--include-bot-commentsopt-in, and JSON shape. Formatter tests cover the<comments>element and## Commentsheading, present and absent.vendor/bin/phpcs srcandvendor/bin/phpstan analyse srcclean.php drupalorg issue:show ai_context#3586157 --with-comments --format=llmreturns 14 comments, or 17 with--include-bot-comments; without--with-comments, none.php drupalorg issue:show 3383637 --with-comments --format=llmnow shows the<comment>wrapper on all 16 Drupal.org comments, which it did not before the raw-output fix.🤖 Generated with Claude Code