Skip to content

Commit

Permalink
Fixes #11827: quality assistant cannot merge approved PR
Browse files Browse the repository at this point in the history
  • Loading branch information
peckpeck committed Dec 5, 2017
1 parent faa9797 commit f00b0ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/rudder-dev/quality-assistant
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def repo_merge(repo, alt_dir):
freeze = True

# List approved PR
api_url = "https://api.github.com/repos/Normation/{repo}/pulls?state=open"
api_url = "https://api.github.com/repos/Normation/{repo}/issues?state=open"
url = api_url.format(repo=repo)
data = github_call(url)
for pr_info in data:
Expand Down
12 changes: 7 additions & 5 deletions scripts/rudder-dev/redmine.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def _update_issue(self, change, message=None, alt_message=None):
info = { 'issue': { 'notes': alt_message } }

# send info
ret = self.server._query("/issues/" + str(self.id) + ".json", post_data=json.dumps(info))
ret = self.server._query("/issues/" + str(self.id) + ".json", put_data=json.dumps(info))
if ret.status_code != 200:
logfail("Issue Update error: " + ret.reason)
print(ret.text)
Expand Down Expand Up @@ -275,12 +275,14 @@ def __init__(self, internal):
self.api_url = Config.REDMINE_API_URL
self.nrm_group = Config.REDMINE_NRM_GROUP

def _query(self, query, post_data=None):
def _query(self, query, post_data=None, put_data=None):
""" Function to directly request the right redmine server """
if post_data is None:
ret = requests.get(self.api_url + query, headers = {'X-Redmine-API-Key': self.token })
else:
if post_data is not None:
ret = requests.post(self.api_url + query, headers = {'X-Redmine-API-Key': self.token, 'Content-Type': 'application/json' }, data = post_data)
elif put_data is None:
ret = requests.put(self.api_url + query, headers = {'X-Redmine-API-Key': self.token, 'Content-Type': 'application/json' }, data = put_data)
else:
ret = requests.get(self.api_url + query, headers = {'X-Redmine-API-Key': self.token })
return ret

def create_issue(self, project_id, subject, description, tracker_id, version_id):
Expand Down
3 changes: 3 additions & 0 deletions scripts/rudder-dev/rudder-dev-src
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,10 @@ if __name__ == "__main__":
elif arguments['technique']:
technique(arguments['<version>'], arguments['<comment>'])
elif arguments['subtask']:
stash()
subtask(arguments['<next_branch>'], arguments['--title'], arguments['--base'], arguments['--bug'])
unstash()
stash_info()
elif arguments['wip']:
wip()
elif arguments['commit']:
Expand Down

0 comments on commit f00b0ec

Please sign in to comment.