FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove any "awaiting.." labels when a PR is merged. by Mariatta · Pull Request #58 · python/bedevere · GitHub

Repository navigation

Remove any "awaiting.." labels when a PR is merged. - #58

Merged
Mariatta merged 9 commits into
python:masterfrom
Mariatta:issue-53
Oct 4, 2017
Merged

Mariatta merged 9 commits into
python:masterfrom
Mariatta:issue-53

Conversation

Copy link
Copy Markdown
Member

Closes #53

brettcannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The approach LGTM! Some minor PEP 8 things, a failing test, and there should be an explicit test in test_stage for the change.

Comment thread bedevere/stage.py Outdated

@router.register("pull_request", action="closed")
async def closed_pr(event, gh, *args, **kwargs):
"""Remove all `awaiting ... ` label when PR was merged"""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Missing a period.

Comment thread bedevere/stage.py Outdated
issue = await util.issue_for_PR(gh, event.data["pull_request"])
for label_data in issue["labels"]:
if LABEL_PREFIX in label_data['name']:
await gh.delete(label_data["url"]) No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Missing a newline.

Comment thread tests/test___main__.py Outdated
"issue_url": "https://api.github.com/repos/python/cpython/issues/10",
"number": 10,
"state": "closed",
"merged": True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Missing a trailing comma.

Comment thread tests/test___main__.py Outdated
# Sending a payload that shouldn't trigger any networking, but no errors
# either.
data = {"action": "closed"}
data = {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This test is now failing, probably because closing a PR now triggers networking calls (see the comment in line 24). It probably needs to perform an action that isn't registered with the router to perform the same intent in testing.

codecov Bot commented Sep 23, 2017 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #58 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master    #58   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          14     14           
  Lines         850    872   +22     
  Branches       49     50    +1     
=====================================
+ Hits          850    872   +22
Impacted Files Coverage Δ
tests/test_stage.py 100% <100%> (ø) ⬆️
bedevere/stage.py 100% <100%> (ø) ⬆️
tests/test___main__.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 281cd30...883f01e. Read the comment docs.

Copy link
Copy Markdown
Member

Just in case you didn't notice, codecov says you're no longer exercising the new code.

Copy link
Copy Markdown
Member Author

Thanks! The coverage looks good now 😃

Copy link
Copy Markdown
Member

I did one minor refactoring as I realized that there were two places in the code now trying to remove labels. Once Travis verifies I didn't botch anything you can feel free to merge!

Copy link
Copy Markdown
Member

OK, everything should be good but feel free to double-check me.

And I think the initial logic was wrong because I believe you were going to delete the label from the entire repository instead of remove it from the issue initially. 😉

Mariatta commented Oct 3, 2017

Copy link
Copy Markdown
Member Author

😱
Thanks 😅 I will take another look later this evening...
Does this get deployed automatically once merged?

Comment thread bedevere/stage.py Outdated


async def _remove_stage_labels(gh, issue):
"""Remove all "awaiting" labels."""

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should use 4 space indentation.

Copy link
Copy Markdown
Member

Yep, there's a webhook so that Heroku will pick up any changes to the master branch and automatically deploy it.

Mariatta commented Oct 4, 2017

Copy link
Copy Markdown
Member Author

Thanks! Then I'll merge this now 😁

Mariatta merged commit 1542033 into python:master Oct 4, 2017
Mariatta deleted the issue-53 branch October 4, 2017 17:33

Mariatta commented Oct 4, 2017

Copy link
Copy Markdown
Member Author

It works! python/cpython#3886 (comment)

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL