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

[Feature][GitHub] allow filtering PRs. #8289

Open
3 tasks done
KyriosGN0 opened this issue Feb 7, 2025 · 4 comments
Open
3 tasks done

[Feature][GitHub] allow filtering PRs. #8289

KyriosGN0 opened this issue Feb 7, 2025 · 4 comments
Labels
component/plugins This issue or PR relates to plugins improvement type/feature-request This issue is a proposal for something new

Comments

@KyriosGN0
Copy link

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Use case

we use renovate bot to open PRs to update packages, those PRs count towards our lead time for changes, which we found useless since pickup time can be high (if no one has time or just missed the PR)

Description

allow filtering by the Github plugins that it scans, preferably we would like to do it in the scope config

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@KyriosGN0 KyriosGN0 added the type/feature-request This issue is a proposal for something new label Feb 7, 2025
@dosubot dosubot bot added component/plugins This issue or PR relates to plugins improvement labels Feb 7, 2025
@klesh
Copy link
Contributor

klesh commented Feb 11, 2025

Is it possible to filter them out directly in the SQL query from the Grafana dashboard?

@KyriosGN0
Copy link
Author

@klesh it is possible to filter them in some dashboards that relay in the PR table, but the main DORA dashboard can't.

@karpanin
Copy link

Similar functionality is needed to filter bots when calculating pr_pickup_time metrics.

func getFirstReview(prId string, prCreator string, db dal.Dal) (*code.PullRequestComment, errors.Error) {
// Initialize a review comment object
review := &code.PullRequestComment{}
// Define the SQL clauses for the database query
commentClauses := []dal.Clause{
dal.From(&code.PullRequestComment{}), // Select from the "pull_request_comments" table
dal.Where("pull_request_id = ? and account_id != ?", prId, prCreator), // Filter by the PR ID and exclude comments from the PR creator
dal.Orderby("created_date ASC"), // Order by the created date of the review comments (ascending)
}
// Execute the query and retrieve the first review comment
err := db.First(review, commentClauses...)
// If any other error occurred, return nil and the error
if err != nil {
// If the error indicates that no review comment was found, return nil and no error
if db.IsErrorNotFound(err) {
return nil, nil
}
return nil, err
}
// If there were no errors, return the first review comment and no error
return review, nil
}

In the current implementation, the metric will be calculated from the first comment by the bot. We use Sonarqube and comments from sonarqube in Gitlab MR.

@klesh
Copy link
Contributor

klesh commented Feb 12, 2025

I see.
Maybe we could add an optional Environment Variable for the purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/plugins This issue or PR relates to plugins improvement type/feature-request This issue is a proposal for something new
Projects
None yet
Development

No branches or pull requests

3 participants