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

Fixes #11794: quality assistant should merge approved PR #333

Conversation

peckpeck
Copy link
Member

@peckpeck
Copy link
Member Author

Commit modified

@peckpeck peckpeck force-pushed the ust_11794/quality_assistant_should_merge_approved_pr branch from c8ec19e to 3be0998 Compare November 28, 2017 14:24
api_url = "https://api.github.com/repos/Normation/{repo}/pulls/{id}/reviews"
url = api_url.format(repo=repo, id=data["number"])
status = {}
for review in github_call(url):
Copy link
Member

Choose a reason for hiding this comment

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

I would reorganize:

reviews = github_call(url)
if len(reviews) == 0:
  skip (no review)
else:
  for review in reviews:
    status[review['user']['login']] = review['state']
  if "CHANGE_REQUESTED" in status.values:
    reassign
  else:
    if freeze:
      skip (freeze)
    else:
      merge

Copy link
Member

Choose a reason for hiding this comment

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

This has also a side effect of reassing at every run (but don't know if it's a problem though)

Copy link
Member Author

@peckpeck peckpeck left a comment

Choose a reason for hiding this comment

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

Test this comment

@peckpeck
Copy link
Member Author

Commit modified

@peckpeck peckpeck force-pushed the ust_11794/quality_assistant_should_merge_approved_pr branch from 3be0998 to c8a87e0 Compare November 30, 2017 14:42
@peckpeck peckpeck force-pushed the ust_11794/quality_assistant_should_merge_approved_pr branch from c8a87e0 to bacc584 Compare November 30, 2017 14:45
@peckpeck
Copy link
Member Author

Commit modified

@Normation-Quality-Assistant

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit bacc584 into Normation:master Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants