[FIX] forwardport: don't use token field for tags update

Turns out tagging PRs requires a pretty significant level of ACLs
which we may not want to give to the forwardbot?

Anyway use the mergebot ACLs (which already include tagging) for this.
This commit is contained in:
Xavier Morel 2019-10-14 10:07:41 +02:00
parent 8f3f773eef
commit 97999318be

View File

@ -86,10 +86,9 @@ class Project(models.Model):
to_remove = []
for f in self.env['forwardport.tagging'].search([]):
repo = f.repository
key = (repo, f.token_field)
gh = ghs.get(key)
gh = ghs.get(repo)
if not gh:
gh = ghs[key] = repo.github(f.token_field)
gh = ghs[repo] = repo.github()
try:
gh('POST', 'issues/{}/labels'.format(f.pull_request), json={
@ -598,7 +597,6 @@ More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port
'repository': new_pr.repository.id,
'pull_request': new_pr.number,
'to_add': json.dumps(labels),
'token_field': 'fp_github_token',
})
# not great but we probably want to avoid the risk of the webhook
# creating the PR from under us. There's still a "hole" between