As a Minder rule author
I want to write a rule that comments on a pull request if there is an evaluation failure
so that I can alert the PR author in the environment they are already using
Background
We already have existing ruletypes that comment on pull requests (e.g trusty and OSV), but there is nothing in the ruletype definition that explicitly states that commenting will be the action taken if the PR is not compliant.
Furthermore, the logic to comment on a PR is internal to Minder and not available to be reused by external authors of new ruletypes.
Acceptance Criteria
Given that I'm a Minder user
and I've written a rule with the alert type pull_request_comment
and the rule is part of a profile on my project
when the rule evaluation fails
then Minder comments on my pull request
Given I have a rule in a profile with the alert type pull_request_comment
and I've defined the summary in my alert as "This PR has issues"
then Minder comments on my pull request with the message "This PR has issues"
Given I have a rule in a profile with the alert type pull_request_comment
and I've defined the line_comments in my alert as follows
line_comments:
- lineStart: 110
lineEnd: 110
comment: This dependency needs to be updated
- lineStart: 120
lineEnd: 130
comment: These lines of code need to be updated
then Minder comments on line 110 with the message "This dependency needs to be updated"
and Minder comments on lines 120 to 130 with the message "These lines of code need to be updated"
User Story Description
As a Minder rule author I want to write a rule that comments on a pull request if there is an evaluation failure so that I can alert the PR author in the environment they are already using
Background
We already have existing ruletypes that comment on pull requests (e.g trusty and OSV), but there is nothing in the ruletype definition that explicitly states that commenting will be the action taken if the PR is not compliant.
Furthermore, the logic to comment on a PR is internal to Minder and not available to be reused by external authors of new ruletypes.
Acceptance Criteria
pull_request_comment
and the rule is part of a profile on my project when the rule evaluation fails then Minder comments on my pull requestpull_request_comment
and I've defined thesummary
in my alert as "This PR has issues" then Minder comments on my pull request with the message "This PR has issues"pull_request_comment
and I've defined theline_comments
in my alert as followsthen Minder comments on line 110 with the message "This dependency needs to be updated" and Minder comments on lines 120 to 130 with the message "These lines of code need to be updated"
Additional Resources
No response
Tasks