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

Fix `-pr` flag to process either a single PR or a specified list of PRs #51

Closed
mbrukman opened this issue Dec 7, 2019 · 0 comments
Closed
Assignees

Comments

@mbrukman
Copy link
Member

@mbrukman mbrukman commented Dec 7, 2019

Right now, the -pr flag doesn't seem to be parsed correctly, leading to crbot processing all open PRs in the repo anyway. This should be a simple fix.

@mbrukman mbrukman self-assigned this Dec 7, 2019
mbrukman added a commit to mbrukman/code-review-bot that referenced this issue Dec 11, 2019
Previously, we were creating a new variable `prNumbers` in each loop
iteration, which was shadowing the variable outside of the loop, and
hence we were always passing in an empty list of PR numbers to the
processing function, which then defaulted to querying all open PRs in
the given repo.

Also fixed other minor issues: typo in the API method (which was
generating mocks of the same name, but which didn't match the actual
struct method, and fixed the type of pull request numbers (`int`, not
`uint64`).

Made the specific list of PR processing match the whole-repo processing
by querying for complete `github.PullRequest` records via the API.

Added tests to validate both processing options: specific list of PR
numbers as well as querying the repo for the full list of open PRs.

Fixes google#51.
mbrukman added a commit to mbrukman/code-review-bot that referenced this issue Dec 11, 2019
Previously, we were creating a new variable `prNumbers` in each loop
iteration, which was shadowing the variable outside of the loop, and
hence we were always passing in an empty list of PR numbers to the
processing function, which then defaulted to querying all open PRs in
the given repo.

Also fixed other minor issues: typo in the API method (which was
generating mocks of the same name, but which didn't match the actual
struct method, and fixed the type of pull request numbers (`int`, not
`uint64`).

Made the specific list of PR processing match the whole-repo processing
by querying for complete `github.PullRequest` records via the API.

Added tests to validate both processing options: specific list of PR
numbers as well as querying the repo for the full list of open PRs.

Fixes google#51.
@mbrukman mbrukman closed this in #52 Dec 11, 2019
mbrukman added a commit that referenced this issue Dec 11, 2019
Previously, we were creating a new variable `prNumbers` in each loop
iteration, which was shadowing the variable outside of the loop, and
hence we were always passing in an empty list of PR numbers to the
processing function, which then defaulted to querying all open PRs in
the given repo.

Also fixed other minor issues: typo in the API method (which was
generating mocks of the same name, but which didn't match the actual
struct method, and fixed the type of pull request numbers (`int`, not
`uint64`).

Made the specific list of PR processing match the whole-repo processing
by querying for complete `github.PullRequest` records via the API.

Added tests to validate both processing options: specific list of PR
numbers as well as querying the repo for the full list of open PRs.

Fixes #51.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.