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 #11827: quality assistant cannot merge approved PR #337

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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