feat: add activation-comments to disable activation/fallback bot comments#17834
feat: add activation-comments to disable activation/fallback bot comments#17834
activation-comments to disable activation/fallback bot comments#17834Conversation
|
@copilot make sure these Remove emoji. |
…omments Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
activation-comments: false to disable activation/fallback bot comments
|
At @copilot, use a templatable boolean for this field. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 8a36a07:
|
|
Use the common helper to add all of your standard XML tags. You can run |
|
I'd profile it, apply the comment above, and make sure the type of the field is a |
|
@copilot and apply the comments above. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in a4f7607. Changed
|
activation-comments: false to disable activation/fallback bot commentsactivation-comments to disable activation/fallback bot comments
…tion comment footers Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 93f6e0d. Extended
Applied in 93f6e0d — |
|
@copilot move activation comments to the top level under safe-outputs. safe-outputs: |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in b49182a. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
Commit pushed: |
|
PR: feat(release): celebrate community issue authors in release highlights
|
|
Smoke Test 22296016213 —
Overall:
|
There was a problem hiding this comment.
This PR cleanly adds activation-comments support to disable bot comments, plus enriches the XML footer with id and workflow_id fields. The early-return guard is well-structured and consistent across all affected files. Minor suggestion: debug-log the config value on the activation-comments check to aid diagnostics.
📰 BREAKING: Report filed by Smoke Copilot
| // Check if activation comments are disabled | ||
| const messagesConfig = getMessages(); | ||
| if (!parseBoolTemplatable(messagesConfig?.activationComments, true)) { | ||
| core.info("activation-comments is disabled: skipping activation comment creation"); |
There was a problem hiding this comment.
Good guard: checking activationComments before proceeding keeps the early-exit clean. Consider logging the config value at debug level to aid troubleshooting when activation-comments is unexpectedly disabled.
| // Add numeric run ID if available | ||
| if (runId) { | ||
| parts.push(`id: ${runId}`); | ||
| } |
There was a problem hiding this comment.
Adding id and workflow_id to the XML marker improves traceability. This pairs nicely with any log-scraping or run-correlation tooling that parses the footer.
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
Commit pushed: |
Smoke Test Results — Run §22296016223Overall: PARTIAL (1 tool unavailable, 2 skipped)
|
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal!
💥 [THE END] — Illustrated by Smoke Claude
There was a problem hiding this comment.
Pull request overview
This PR adds the safe-outputs.activation-comments configuration flag to suppress activation and fallback bot comments (PR/issue creation notifications, run status updates), addressing a feature request for silent automation. It also makes activation link messages templatable and extends XML markers with id and workflow_id for full run traceability.
Changes:
- New
safe-outputs.activation-commentsboolean/expression flag to disable all activation-related comments (run-started, run-success, run-failure, PR/issue creation links) - Activation link messages (pull-request-created, issue-created, commit-pushed) are now customizable via the
safe-outputs.messagesconfiguration - XML markers enhanced with
GITHUB_RUN_IDandGH_AW_WORKFLOW_IDfields for improved workflow run tracing
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/compiler_types.go |
Added ActivationComments, PullRequestCreated, IssueCreated, and CommitPushed fields to SafeOutputMessagesConfig |
pkg/workflow/safe_outputs_config.go |
Added preprocessing and parsing logic for activation-comments at top-level safe-outputs |
pkg/workflow/safe_outputs_config_messages.go |
Added parsing for new message template fields (pull-request-created, issue-created, commit-pushed) |
pkg/workflow/imports.go |
Extended mergeMessagesConfig to merge new message template fields |
pkg/workflow/safe_outputs_test.go |
Added tests for activation-comments parsing (bool true/false, string expression) |
pkg/parser/schemas/main_workflow_schema.json |
Added schema definitions for activation-comments and new message templates |
actions/setup/js/add_workflow_run_comment.cjs |
Added guard to skip initial activation comment creation when disabled |
actions/setup/js/update_activation_comment.cjs |
Added guard to skip activation comment updates and integrated templatable message generation with XML markers |
actions/setup/js/notify_comment_error.cjs |
Added guard to skip completion comment updates when activation comments disabled |
actions/setup/js/messages_run_status.cjs |
Added functions for generating templatable PR/issue/commit creation messages |
actions/setup/js/messages_core.cjs |
Updated JSDoc to document new message template fields |
actions/setup/js/messages_footer.cjs |
Extended generateXMLMarker with GITHUB_RUN_ID and GH_AW_WORKFLOW_ID |
actions/setup/js/generate_footer.cjs |
Extended generateXMLMarker with GITHUB_RUN_ID and GH_AW_WORKFLOW_ID |
actions/setup/js/update_activation_comment.test.cjs |
Updated tests to reflect removal of emojis from default messages |
actions/setup/js/generate_footer.test.cjs |
Added comprehensive tests for new XML marker fields |
.changeset/patch-disable-activation-comments.md |
Added changeset documenting the patch-level change |
tmp-smoke-test-22296016223.txt |
Smoke test file for PR validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Check if activation comments are disabled entirely | ||
| if (!parseBoolTemplatable(messagesConfig?.activationComments, true)) { | ||
| core.info("activation-comments is disabled: skipping activation comment update"); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Missing test coverage for the activation-comments guard. The guard at lines 76-80 skips activation comment updates when activationComments is false, but the existing tests in update_activation_comment.test.cjs do not verify this behavior. Consider adding tests that verify:
- Comment updates are skipped when activationComments is set to false
- Comment updates proceed normally when activationComments is true or undefined
- The guard works correctly with both updateActivationComment and updateActivationCommentWithCommit functions
| // If activation comments are disabled entirely, skip all comment updates | ||
| if (!parseBoolTemplatable(messagesConfig?.activationComments, true)) { | ||
| core.info("activation-comments is disabled: skipping completion comment update"); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Missing test coverage for the activation-comments guard. The guard at lines 64-68 skips completion comment updates when activationComments is false, but there are no tests in notify_comment_error.test.cjs verifying this behavior. Consider adding tests that verify:
- Completion comment updates are skipped when activationComments is set to false
- Completion comment updates proceed normally when activationComments is true or undefined
- The early return at line 67 prevents unnecessary processing when activation comments are disabled
| }, | ||
| "activation-comments": { | ||
| "type": ["boolean", "string"], | ||
| "description": "When set to false or \"false\", disables all activation and fallback comments entirely (run-started, run-success, run-failure, PR/issue creation links). Supports templatable boolean values including GitHub Actions expressions (e.g. ${{ inputs.activation-comments }}). Default: true", |
There was a problem hiding this comment.
Schema inconsistency: The schema description states "When set to false or "false"", suggesting that the string literal "false" is accepted, but the preprocessBoolFieldAsString function in pkg/workflow/templatables.go (lines 63-64) will reject any string that is not a GitHub Actions expression (must start with "${{" and end with "}}"). This means users cannot use the string "false" directly; they must use the boolean value false or a GitHub Actions expression like "${{ inputs.activation-comments }}". Either:
- Update the schema description to clarify that only boolean false or GitHub Actions expressions are accepted, not the string literal "false", or
- Modify the preprocessor to accept the string literals "true" and "false" as valid values alongside booleans and expressions.
Based on the codebase pattern, option 1 is likely the correct approach for consistency with other templatable boolean fields.
| "description": "When set to false or \"false\", disables all activation and fallback comments entirely (run-started, run-success, run-failure, PR/issue creation links). Supports templatable boolean values including GitHub Actions expressions (e.g. ${{ inputs.activation-comments }}). Default: true", | |
| "description": "When set to false, disables all activation and fallback comments entirely (run-started, run-success, run-failure, PR/issue creation links). Supports templatable boolean values via GitHub Actions expressions (e.g. '${{ inputs.activation-comments }}'). String values must be valid GitHub Actions expressions that resolve to a boolean at runtime. Default: true", |
| StagedTitle string `yaml:"staged-title,omitempty" json:"stagedTitle,omitempty"` // Custom styled mode title template | ||
| StagedDescription string `yaml:"staged-description,omitempty" json:"stagedDescription,omitempty"` // Custom staged mode description template | ||
| AppendOnlyComments bool `yaml:"append-only-comments,omitempty" json:"appendOnlyComments,omitempty"` // If true, post run status as new comments instead of updating the activation comment | ||
| ActivationComments string `yaml:"activation-comments,omitempty" json:"activationComments,omitempty"` // If "false", disable all activation/fallback comments entirely. Supports templatable boolean values (literal "true"/"false" or GitHub Actions expressions). Empty/unset preserves default enabled behavior. |
There was a problem hiding this comment.
Documentation inconsistency: The comment states "Supports templatable boolean values (literal 'true'/'false' or GitHub Actions expressions)", but the preprocessBoolFieldAsString function (pkg/workflow/templatables.go, lines 63-64) only accepts boolean values or GitHub Actions expressions (strings starting with "${{" and ending with "}}"). String literals "true" or "false" are not accepted and will result in an error.
Update the comment to accurately reflect the accepted values: "Supports templatable boolean values (booleans or GitHub Actions expressions like '${{ inputs.activation-comments }}'). Empty/unset preserves default enabled behavior."
| ActivationComments string `yaml:"activation-comments,omitempty" json:"activationComments,omitempty"` // If "false", disable all activation/fallback comments entirely. Supports templatable boolean values (literal "true"/"false" or GitHub Actions expressions). Empty/unset preserves default enabled behavior. | |
| ActivationComments string `yaml:"activation-comments,omitempty" json:"activationComments,omitempty"` // If "false", disable all activation/fallback comments entirely. Supports templatable boolean values (booleans or GitHub Actions expressions like '${{ inputs.activation-comments }}'). Empty/unset preserves default enabled behavior. |
| "activation-comments": "false", | ||
| }, | ||
| }, | ||
| expected: "false", |
There was a problem hiding this comment.
Test case inconsistency: The test "activation-comments string value is stored as-is in Messages" at lines 519-527 tests that the string literal "false" is accepted and stored. However, the preprocessBoolFieldAsString function (pkg/workflow/templatables.go, lines 63-64) will reject any string that is not a GitHub Actions expression (must start with "${{" and end with "}}"). This test will fail when the preprocessing step is executed.
Either:
- Update the test to use a GitHub Actions expression like "${{ inputs.activation-comments }}" instead of the string literal "false", or
- Remove this test case if string literals are not intended to be supported.
Based on the codebase pattern and the preprocessor implementation, option 1 is the correct approach.
| "activation-comments": "false", | |
| }, | |
| }, | |
| expected: "false", | |
| "activation-comments": "${{ inputs.activation-comments }}", | |
| }, | |
| }, | |
| expected: "${{ inputs.activation-comments }}", |
| // Check if activation comments are disabled | ||
| const messagesConfig = getMessages(); | ||
| if (!parseBoolTemplatable(messagesConfig?.activationComments, true)) { | ||
| core.info("activation-comments is disabled: skipping activation comment creation"); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Missing test coverage for the new activation-comments guard functionality. The guard at lines 65-70 skips comment creation when activationComments is false, but there are no tests in the corresponding test file verifying this behavior. Consider adding tests that verify:
- Comment creation is skipped when activationComments is set to false
- Comment creation proceeds normally when activationComments is true or undefined
- The parseBoolTemplatable function correctly handles string expressions like "${{ inputs.activation-comments }}"
Workflows that create PRs/issues can generate unwanted bot comments (e.g.
Pull request created: #...) via activation-comment update/fallback logic, with no way to suppress them.Changes
safe-outputs.activation-comments: falsedisables all activation-related comments: initial "run started", PR/issue creation links, and run success/failure notifications. Safe-output actions still execute normally. Supports templatable boolean values including GitHub Actions expressions (e.g.${{ inputs.activation-comments }}).ActivationComments string(templatable boolean) parsed at thesafe-outputstop level and propagated intoSafeOutputMessagesConfigfor serialization. AddedPullRequestCreated,IssueCreated, andCommitPushedtemplate fields. All new fields included inmergeMessagesConfig.add_workflow_run_comment.cjs,update_activation_comment.cjs, andnotify_comment_error.cjsusingparseBoolTemplatable()(handlesfalse,"false", and resolved expression strings). Activation link messages (PR/issue/commit created) are now templateable via themessagesconfig, no longer include emoji in their defaults, and append a full standard XML marker footer viagenerateXMLMarker(includesgh-aw-agentic-workflow,gh-aw-tracker-id,engine,id,workflow_id,run, and other standard identifiers).generateXMLMarkeringenerate_footer.cjsandmessages_footer.cjsextended to includeid(GITHUB_RUN_ID) andworkflow_id(GH_AW_WORKFLOW_ID) for full run traceability.activation-comments(typeboolean | string) added as a top-levelsafe-outputsproperty.pull-request-created,issue-created, andcommit-pushedproperties added tosafe-outputs.messages.Usage
Disable all activation/fallback comments:
Use a GitHub Actions expression:
Customize activation link messages:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Changeset
safe-outputs.activation-commentsflag so activation/fallback bot comments can be silenced and make activation link messages templatable with full XML markers.Warning
The following domain was blocked by the firewall during workflow execution:
github.com✨ PR Review Safe Output Test - Run 22296016223