Skip to content
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

Pull request alert types #5024

Open
1 task
eleftherias opened this issue Nov 22, 2024 · 0 comments
Open
1 task

Pull request alert types #5024

eleftherias opened this issue Nov 22, 2024 · 0 comments
Assignees

Comments

@eleftherias
Copy link
Contributor

eleftherias commented Nov 22, 2024

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

  • 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"

Additional Resources

No response

Tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant