-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add logic to filter PRs based on the last commit status #101
Conversation
- Modify the PullRequest() constructor to build from github.PullRequest - Modify the PullRequest() object creation across the code - Add get_issue() method to retrieve the issue associated to the PR - Add get_last_commit() method to retrieve the head commit using the sha1 - Add get_last_status() method to retrieve the last status of the last comment
This commit defines a new flag argument --check-commit-status for all commands derived from the FilteredPullRequestCommand abstract class. The find_candidates() method is updated to add an extra filtering step if this flag is passed. This commit provides the default framework to close ome#41. Extra granularity on the status filters can be implemented when necessary.
- Create new branch/PR for each test - Add isMerged() method to TestMerged - Combine remote tests
Testing on
looks good, but I do wonder if we don't need a section here for the status-excluded PRs as with the conflict-excluded PRs. Would that be possible? |
Also add the returned log to the info log generated by the `scc merge` and `scc set-commit-status` commands
With the latest commit,
|
Does |
Yes with |
Gotcha. Generally looks good then. |
This commit should allow the testStatus to pass for any user. Since the commit is retrieved from the head repo, the authenticated user should have permissions to set the status on the commit.
certainly looks good. SCC isn't self-omitting non-checked status PRs, but otherwise ... 😏 Merging. |
Add logic to filter PRs based on the last commit status
This PR adds some logic to filter PRs by status namely
scc merge <branch> --check-commit-status
excludes PRs which status attached to the last commit is not strictlysuccess
testStatus
is added toTestMerge
where a PR is opene, its status is modified (none, pending, failure and success) and the outcome ofscc merge --check-commit-status
is checked for each statusAs part of these changes, the following changes have been brought:
PullRequest
object inscc.py
has been refactored and minimally acts as a wrapper of the github.PullRequest object. New methods have been added to retrieve the corresponding issue, last commit and last status. The construction changes have been applied to the rest of the codeTestMerge
integration tests have been rewritte: a new PR is created for each test and the outcome of thescc merge
command is systematically checked for each testtest/unit
andtest/integration
. At the moment only unit tests are run by the Travis build (dropping all the Github part) and the entire test suite is expected to be run under hudson./cc @mtbc, @joshmoore
Immediate build candidates for applying these changes once merged are the documentation builds where the Travis output is very reliable.