Closed danuker closed 2 years ago
This is a pull request comment.
another comment
needs-review
needs-changes
changes-approved
changes-needed
needs-changes
needs-review
needs-review
needs-review
Testing with deployed endpoint
changes-approved
All right, the hook is now deployed to Azure.
needs-review
just testing
needs-changes
needs-review
just testing needs-review
Looks like the used token does not have enough permissions, for the sftpplus.com repository:
Traceback (most recent call last):
File "/home/site/wwwroot/chevah/github_hooks_server/server.py", line 72, in hook
response = handle_event(event)
File "/home/site/wwwroot/chevah/github_hooks_server/server.py", line 131, in handle_event
return handler.dispatch(event)
File "/home/site/wwwroot/chevah/github_hooks_server/handler.py", line 47, in dispatch
return handler(event)
File "/home/site/wwwroot/chevah/github_hooks_server/handler.py", line 85, in pull_request_review
self._setApproveChanges(
File "/home/site/wwwroot/chevah/github_hooks_server/handler.py", line 163, in _setApproveChanges
issue.edit(assignees=[author_name])
File "/home/site/wwwroot/.python_packages/lib/site-packages/github3/decorators.py", line 24, in auth_wrapper
return func(self, *args, **kwargs)
File "/home/site/wwwroot/.python_packages/lib/site-packages/github3/issues/issue.py", line 236, in edit
json = self._json(self._patch(self._api, data=dumps(data)), 200)
File "/home/site/wwwroot/.python_packages/lib/site-packages/github3/models.py", line 153, in _json
raise exceptions.error_for(response)
github3.exceptions.ForbiddenError: 403 Must have admin rights to Repository.
And this is why it could not update the user in this PR.
Looks like the used token does not have enough permissions, for the sftpplus.com repository:
can you enable default python output via the logging system so that we can see these errors in azure?
can you enable default python output via the logging system so that we can see these errors in azure?
I can see the log of this error already. You can see it by running the following query here:
traces
| order by timestamp
| where timestamp > datetime(12/17/2021, 12:40:06.847 AM)
| where timestamp < datetime(12/17/2021, 12:40:06.849 AM)
| project timestamp, message, severityLevel
I don't think it's worth redirecting stdout and stderr; it might pointlessly increase the amount of logs.
I made sure the
issue_comment
hook works. But there is still thepull_request_review
hook, so please request changes from GitHub (GH won't let me review my own code).What is removed: there is no security right now, seems like the request does not have the client IP. So, the IP allow-list is not enforced. We could use the GitHub webhook secret for this. Should it be done in this PR?
Also, I have not touched the tests. Should I update them in this PR?
The token currently deployed on Azure is from @chevah-robot token. It was deployed via
config.ini
in the latest uploaded artifact. Tell me if you would prefer to use environment variables which only appear here and not in the filesystem.reviewers: @adiroiban @ioanacristinamarinescu