-
Notifications
You must be signed in to change notification settings - Fork 34
Add hide-older-comments and allowed-reasons fields to add-comment and hide-comment safe outputs #6073
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: pelikhan <[email protected]>
Co-authored-by: pelikhan <[email protected]>
Co-authored-by: pelikhan <[email protected]>
|
@copilot the user should be able to specify a set of "allowed-reasons" to limit how/why the agent is minimizing the comment. Default is all. |
Co-authored-by: pelikhan <[email protected]>
|
@copilot add flag to smoke agentic workflows |
Co-authored-by: pelikhan <[email protected]>
Added Configuration example: safe-outputs:
add-comment:
hide-older-comments: true
allowed-reasons: [OUTDATED, RESOLVED]Commit: 74ac24b |
Co-authored-by: pelikhan <[email protected]>
Added
Smoke tests will now automatically hide older status comments when posting new ones. Commit: d75030d |
|
@copilot restrict ai-moderztor to spam reason |
|
@copilot tracker-id AND workflow id |
…-moderator to SPAM Co-authored-by: pelikhan <[email protected]>
Added Also implemented
Commit: 47bfc88 |
|
@copilot add support for lower case reasons, not uppercase |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot the reaction/conclusion comments should not be hidden. Ignore them for now. Store the comment type in the metadata and ignore reaction comments. |
…ents Co-authored-by: pelikhan <[email protected]>
Added comment-type markers to distinguish reaction from add-comment comments. Reaction comments are now excluded from hide-older-comments logic. Changes:
When hide-older-comments is enabled, the system now:
This ensures workflow status indicators (reaction comments) remain visible as a permanent record of workflow activity. Commit: 7499285 |
|
💥 WHOOSH! Smoke Claude springs into action on this pull request! [Panel 1 begins...] |
|
🔮 The ancient spirits stir... Smoke Codex awakens to divine this pull request... |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
📰 BREAKING: Smoke Copilot Playwright is now investigating this pull request. Sources say the story is developing... |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
Smoke Test ResultsTest Results:
Overall Status: FAIL File test successful, but GitHub MCP and Serena MCP tools unavailable in environment. 📰🔥📋 https://github.com/githubnext/gh-aw/actions/runs/20121176014 fer issue #6073 🗺️ |
|
Recent merged PRs: 6083 “Add runtime-import macro for dynamic markdown inclusion”; 6086 “Fix shellcheck violations in safe-inputs server startup script”
|
Smoke Test Results - Claude EngineLast 2 Merged PRs:
Test Results:
Status: PASS (5/6 tests passed)
|
Copilot Smoke Test ResultsLast 2 Merged PRs:
Test Results:
Status: PASS
|
Smoke Test Results✅ Playwright MCP: Page loaded successfully, title contains "GitHub" Overall Status: FAIL (1/3 tests passed) Note: GitHub CLI tool encountered connection issues with the API endpoint.
|
Adds
hide-older-commentsboolean field to theadd-commentsafe output andallowed-reasonsarray field to bothadd-commentandhide-commentsafe outputs. Whenhide-older-commentsis enabled, minimizes all previous add-comment outputs from the same workflow (identified by workflow ID fromGITHUB_WORKFLOWenvironment variable) before creating a new comment. Reaction comments are excluded from hiding to preserve workflow status history. Theallowed-reasonsconfiguration restricts which reasons can be used for hiding comments. Only lowercase reason values are supported.Changes
Schema
hide-older-commentsfield toadd-commentconfiguration inmain_workflow_schema.jsonallowed-reasonsarray field toadd-commentconfiguration with enum validation for lowercase only: spam, abuse, off_topic, outdated, resolvedallowed-reasonsarray field tohide-commentconfiguration with enum validation for lowercase only: spam, abuse, off_topic, outdated, resolvedGo Implementation
HideOlderCommentsfield toAddCommentsConfigstructAllowedReasonsfield toAddCommentsConfigstructAllowedReasonsfield toHideCommentConfigstructparseCommentsConfig()andparseHideCommentConfig()for new fieldsGH_AW_HIDE_OLDER_COMMENTS,GH_AW_ALLOWED_REASONS, andGH_AW_HIDE_COMMENT_ALLOWED_REASONSpassed to JavaScriptcompiler_jobs.goto passGH_AW_TRACKER_IDenvironment variable to activation job for reaction commentsJavaScript Implementation
GITHUB_WORKFLOWenvironment variable (automatically set by GitHub Actions) to identify comments from the same workflowhideOlderComments()orchestrates the hiding logic with reason validation inadd_comment.cjsfindCommentsWithTrackerId()for issue/PR comments (REST API with pagination) - searches for workflow-id markers and filters out reaction commentsfindDiscussionCommentsWithTrackerId()for discussion comments (GraphQL with pagination) - searches for workflow-id markers and filters out reaction commentsminimizeComment()uses GraphQL mutation with configurable classifier (default: "outdated")add_comment.cjsandhide_comment.cjsadd_comment.cjs<!-- workflow-id: ... -->for workflow identification<!-- comment-type: add-comment -->add_reaction_and_edit_comment.cjsto add workflow-id, tracker-id, and<!-- comment-type: reaction -->markers to reaction commentsTests
GITHUB_WORKFLOW.github/workflows/test-hide-older-comments.mdDocumentation
docs/src/content/docs/reference/safe-outputs.mdwith usage examples and requirementsGITHUB_WORKFLOWenvironment variableSmoke Test Integration
hide-older-comments: trueto all smoke test workflows:tracker-idfrom smoke test workflows (no longer needed)AI Moderator Integration
allowed-reasons: [spam]to ai-moderator workflow to restrict comment hiding to spam reason onlyComment Type Markers
<!-- comment-type: add-comment -->marker<!-- comment-type: reaction -->markerUsage
add-comment with hide-older-comments
hide-comment with allowed-reasons
Workflow ID is automatically obtained from the
GITHUB_WORKFLOWenvironment variable (set by GitHub Actions). Only add-comment outputs with matching workflow ID are hidden - reaction comments are preserved to maintain workflow status history. Ifallowed-reasonsis specified, only the listed reasons can be used (if the default reason is not in the list, hiding will be skipped with a warning). Failures to hide individual comments are logged but don't block the workflow. Default behavior allows all reasons when not specified.Only lowercase values (spam, abuse, off_topic, outdated, resolved) are accepted for allowed-reasons. Uppercase values will be rejected by schema validation. JavaScript internally normalizes these to uppercase before sending to GitHub's API.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Changeset
hide-older-commentsboolean andallowed-reasonsarray fields toadd-commentandhide-commentsafe outputs; includes parsing, JavaScript hiding logic, tests, and documentation updates.Changeset
hide-older-commentsboolean andallowed-reasonsarray fields toadd-commentandhide-commentsafe outputs; includes parsing, JavaScript hiding logic, tests, and documentation updates.Changeset
hide-older-commentsboolean andallowed-reasonsarray fields toadd-commentandhide-commentsafe outputs; includes parsing, JavaScript hiding logic, tests, and documentation updates.Changeset
hide-older-commentsboolean andallowed-reasonsarray fields toadd-commentandhide-commentsafe outputs; includes parsing, JavaScript hiding logic, tests, and documentation updates.Changeset
hide-older-commentsboolean andallowed-reasonsarray fields toadd-commentandhide-commentsafe outputs; includes parsing, JavaScript hiding logic, tests, and documentation updates.