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
ptl-tool: load labeled PRs #18231
ptl-tool: load labeled PRs #18231
Conversation
@liewegas this is that feature you really wanted: getting PRs that you've previously labeled for merging/testing. |
# Adding labeled PR #18192 to PR list | ||
# Will merge PRs: [18192] | ||
# Merging PR #18192 | ||
# Leaving HEAD detached; no branch anchors your commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can add this simple example too:
src/script/ptl-tool.py --base master --merge-branch <wip-test-branch> --pr-label wip-<name>-testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying not to have too many examples. :)
The initial test looks fine. But I will do more testing :-) |
src/script/ptl-tool.py
Outdated
prs = args.prs | ||
if args.pr_label: | ||
payload = {'labels': args.pr_label, 'sort': 'created', 'direction': 'desc'} | ||
labeled_prs = requests.get("https://api.github.com/repos/ceph/ceph/issues", auth=(USER, PASSWORD), params=payload) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See, created the test branch for an invalid pr-label.
$ src/script/ptl-tool.py --base master --merge-branch wip-jcollin-testing --pr-label wip-jcollin-testing2 #or wip-aoeu-testing
Detaching HEAD onto base: master
Will merge PRs: []
Checked out new branch wip-jcollin-testing-20171011
Created tag testing/wip-jcollin-testing-20171011_04
jcollin@smithi042:~/test-ptl-oct11$ git branch
master
* wip-jcollin-testing-20171011
Please check if the branch exists first and drop it. May be move the existing label validation code to a function ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--pr-label ' '
is bypassing it. I have pressed Ctrl+C and it saved me :-D.
jcollin@smithi042:~/test-ptl-oct12$ src/script/ptl-tool.py --base master --merge-branch wip-jcollin-testing --pr-label ' '
Adding labeled PR #18271 to PR list
Adding labeled PR #18270 to PR list
Adding labeled PR #18269 to PR list
Adding labeled PR #18268 to PR list
Adding labeled PR #18267 to PR list
Adding labeled PR #18266 to PR list
Adding labeled PR #18265 to PR list
Adding labeled PR #18264 to PR list
Adding labeled PR #18263 to PR list
Adding labeled PR #18262 to PR list
Adding labeled PR #18261 to PR list
Adding labeled PR #18260 to PR list
Adding labeled PR #18259 to PR list
Adding labeled PR #18257 to PR list
Adding labeled PR #18256 to PR list
Adding labeled PR #18255 to PR list
Adding labeled PR #18254 to PR list
Adding labeled PR #18253 to PR list
Adding labeled PR #18251 to PR list
Adding labeled PR #18250 to PR list
Adding labeled PR #18249 to PR list
Adding labeled PR #18248 to PR list
Adding labeled PR #18247 to PR list
Adding labeled PR #18246 to PR list
Adding labeled PR #18245 to PR list
Adding labeled PR #18244 to PR list
Adding labeled PR #18243 to PR list
Adding labeled PR #18241 to PR list
Adding labeled PR #18240 to PR list
Adding labeled PR #18239 to PR list
Will merge PRs: [18271, 18270, 18269, 18268, 18267, 18266, 18265, 18264, 18263, 18262, 18261, 18260, 18259, 18257, 18256, 18255, 18254, 18253, 18251, 18250, 18249, 18248, 18247, 18246, 18245, 18244, 18243, 18241, 18240, 18239]
Detaching HEAD onto base: master
Merging PR #18271
Labeled PR #18271 wip-jcollin-testing
Merging PR #18270
^CTraceback (most recent call last):
File "src/script/ptl-tool.py", line 308, in <module>
File "src/script/ptl-tool.py", line 305, in main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Check the empty string also.
$ src/script/ptl-tool.py --base master --merge-branch wip-jcollin-testing --pr-label ''
Will merge PRs: []
Detaching HEAD onto base: master
Checked out new branch wip-jcollin-testing-20171013
Created tag testing/wip-jcollin-testing-20171013
Adding labeled PR #18284 to PR list
- Do we need to add and merge an unreviewed / unapproved PR for testing ? Do we need to check the PR status before the add / merge ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the empty string also.
done.
Do we need to add and merge an unreviewed / unapproved PR for testing ? Do we need to check the PR status before the add / merge ?
No, that should stay the ptl's responsibility to check.
6a3f1a5
to
38a9e53
Compare
@batrick I did this to merge Then I want to merge
Is this expected ? This is working as expected, if I try with the PR number: But not with the label feature. |
This lets you label in GitHub the PRs you want to test/merge. Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
38a9e53
to
9978659
Compare
There is no
Looks like you forgot |
@batrick Yes, I missed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@batrick Now it looks like your original example doesn't create a test branch. It leaves the HEAD detached, but no testing branch created.
I have used:
$ src/script/ptl-tool.py --base master --branch HEAD --merge-branch-name master --label - --pr-label wip-ptltool1-testing
Could you please check that ?
@batrick Oh, that is intended.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged as this is an independent script (doesn't break anything else). |
This lets you label in GitHub the PRs you want to test/merge.
Signed-off-by: Patrick Donnelly pdonnell@redhat.com