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

Filter pull requests pulled by Bulldozer #559

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

alankpatel
Copy link
Contributor

@alankpatel alankpatel commented Oct 30, 2024

Currently we have been getting all pull requests in a given repo but the changes proposed here will filter the results to only retrieve the pull requests we care about via SHA or ref.

@alankpatel alankpatel self-assigned this Oct 30, 2024
@alankpatel alankpatel requested a review from a team October 30, 2024 19:28
if err != nil {
return nil, err
if strings.HasPrefix(ref, "refs/heads/") {
ref = strings.TrimPrefix(ref, "refs/heads/")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: TrimPrefix returns the unmodified input if it doesn't contain the prefix, so there's usually no need to test with HasPrefix before calling TrimPrefix. If you do care about knowing if the prefix existed or not, you can also use CutPrefix`.

@alankpatel alankpatel requested a review from bluekeyes October 30, 2024 20:25
@alankpatel alankpatel merged commit f35f98d into develop Oct 30, 2024
8 checks passed
@alankpatel alankpatel deleted the alanp/refactor-get-pull-requests branch October 30, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants