Repository navigation
Conversation
Paco ReviewThe PR adds support for processing edited GitHub comments as GitOps commands, gated behind a new Paco could not check everything:
[HIGH] Trigger. Run Impact. Unit test CI runs break or include tests that immediately fail because they depend on external E2E infrastructure that is not present. Fix. Restore the Reviewed commit: 57a8adf. 1 verified findings; 1 summary-only. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3051 +/- ##
=======================================
Coverage 91.98% 91.98%
=======================================
Files 167 167
Lines 12973 12976 +3
=======================================
+ Hits 11933 11936 +3
Misses 1039 1039
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Edited commands can select the wrong authorization policy, and test compilation, E2E gating, and ConfigMap selection need correction.
6 open issues
Apply command authorization policy consistently to edited issue comments · New Apply command authorization policy consistently to edited commit comments · New Initialize promoted SupportEditedComments field after PacOpts creation · New Restore E2E build constraint for live GitHub and Kubernetes tests · New Use configured ConfigMap name for edited-comment test setup · New Use configured ConfigMap name in on-comment test setup · New
What changed in this PR
Adds opt-in processing of edited GitHub comments so users can correct GitOps commands or trigger on-comment pipelines without posting a new comment.
Changes:
- Adds the disabled-by-default
support-edited-commentssetting and passes it into GitHub event detection. - Adds detection tests and end-to-end scenarios for edited comments.
- Documents configuration, provider support, and retriggering behavior.
| File | Description |
|---|---|
test/github_pullrequest_test_comment_test.go |
Adds edited-comment E2E scenarios and removes the build constraint. |
pkg/provider/github/detect.go |
Accepts edited issue and commit comments when enabled. |
pkg/provider/github/detect_test.go |
Adds enabled and disabled detection cases. |
pkg/params/settings/config.go |
Defines the new boolean setting. |
pkg/params/settings/config_test.go |
Updates expected configuration values. |
pkg/adapter/adapter.go |
Supplies settings before GitHub event detection. |
pkg/adapter/adapter_test.go |
Updates detection calls to pass options. |
docs/content/docs/guides/gitops-commands/_index.md |
Explains edited-command support and retriggering risks. |
docs/content/docs/api/configmap.md |
Documents the setting and its default. |
config/302-pac-configmap.yaml |
Adds the disabled setting to the deployment ConfigMap. |
Review effort: Balanced
3f9cf71 to
4b260d6
Compare
|
@theakshaypant yeah good point!, at the moment it's getting the login of the person editing the comment but I think it should always be the author of the comment instead of the last one person edited it. at the moment if an unauthorized user makes a comment e.g. |
fc5a8d7 to
b6a425c
Compare
|
|
||
| {{< param name="support-edited-comments" type="boolean" default="false" id="param-support-edited-comments" >}} | ||
|
|
||
| Enables processing of edited comment events. When enabled, editing a comment that contains a GitOps command (such as `/test` or `/retest`) triggers the command as if it were a new comment. This is useful when you need to fix a typo in a command or change a PipelineRun name without posting a new comment. |
There was a problem hiding this comment.
I think the distinction of author's permissions, not the editor, being used should be documented given how this is worded "... as if it were a new comment"
There was a problem hiding this comment.
Consider the scenario you mentioned in an earlier comment, comment author (without permissions on the repo) has a typo /ok-ot-test which is corrected by a repo maintainer, nothing will happen.
There was a problem hiding this comment.
I think we can hold off on this until the original query is addressed
There was a problem hiding this comment.
nothing will happen.
No, it will trigger PipelineRuns
Hmm, I think it should be the person who edits the comment since that is where the event originates. Similar to rerun checks does not take the author PR but the actor who clicks rerun. I do like that we are adding this behind a flag in the configmap. I am a bit concerned about scenarios where pac itself edits comments (webhook mode with comment_strategy update for example), would that cause a burn (and how much) of the rate limit? |
yeah but it would confuse someone that CI is being triggered on unauthorized user's comment.
on every |
@theakshaypant documented it |
b6a425c to
e665e15
Compare
That is true, so changing it to the author only would solve this confusion. |
| support-edited-comments: "true" | ||
| ``` | ||
|
|
||
| Pipelines-as-Code fetches pull request details from the GitHub API before checking a comment for GitOps commands. Enabling edited comment support also makes this API request for each processed comment edit, including edits to ordinary comments or commands intended for other CI systems. Each request counts toward the API rate limit of the token used by Pipelines-as-Code. |
Add a `support-edited-comments` ConfigMap setting (default: false) that allows Pipelines-as-Code to process edited issue and commit comment events on GitHub. When enabled, editing a comment containing a GitOps command (e.g. `/test`, `/retest`) or comment matching on-comment triggers the command as if it were newly created. This is gated behind a setting because re-triggering on every comment edit could cause unexpected processes and logs. Signed-off-by: Zaki Shaikh <zashaikh@redhat.com>
e665e15 to
57a8adf
Compare
|
/paco review |




📝 Description of the Change
Add a
support-edited-commentsConfigMap setting (default: false) that allows Pipelines-as-Code to process edited issue and commit comment events on GitHub. When enabled, editing a comment containing a GitOps command (e.g./test,/retest) or comment matching on-comment triggers the command as if it were newly created.This is gated behind a setting because re-triggering on every comment edit could cause unexpected processes and logs.
🔗 Linked GitHub Issue
Fixes #
🧪 Testing Strategy
🤖 AI Assistance
AI assistance can be used for various tasks, such as code generation,
documentation, or testing.
Please indicate whether you have used AI assistance
for this PR and provide details if applicable.
Important
Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project's standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.
If the majority of the code in this PR was generated by an AI, please add a
Co-authored-bytrailer to your commit message.For example:
Co-authored-by: Claude noreply@anthropic.com
✅ Submitter Checklist
fix:,feat:) matches the "Type of Change" I selected above.make testandmake lintlocally to check for and fix anyissues. For an efficient workflow, I have considered installing
pre-commit and running
pre-commit installtoautomate these checks.