-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add support for test/retest command in pull request comment #95
base: main
Are you sure you want to change the base?
Conversation
private static final Logger LOG = Logger.getLogger(PullRequestCommandHandler.class); | ||
|
||
private static final String QUARKUS_BOT_NAME = "quarkus-bot"; | ||
private static final String QUARKUS_TEAM_MEMBERS = "quarkus-push"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be externalized to ease development on test repo
7555b0a
to
97c8931
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! I added a bunch of comments, mostly about details.
As for the rerunning the workflow, AFAIK the API silently ignore these calls if you don't have the permissions. I got hit by that too.
You need to go to this page (well the one of your instance): https://github.com/organizations/quarkusio/settings/apps/quarkus-bot/permissions and make sure you have Read & Write
for Actions
. Also, you will receive an email asking you to confirm the new privileges. If you don't do it, they won't be taken into account.
8f78217
to
6d8374f
Compare
Thanks @gsmet, returning a I'm still unable to get a |
@glefloch I'll have a look tomorrow. |
Rebased and pushed a formatting fix. I will have a look to the behavior now. |
In passing, only post a reaction if a command has been detected.
I pushed a few improvements but... I have the same issue you have. Root cause is we get a 403 with this error:
|
Rerun is working fine in the GitHub API tests so I'm not sure what is going on here... |
It's working fine with the same ID? the url built by the client looks correct. |
Yeah the URL looks correct and is the exact same than the one provided by GitHub in the cancelUrl field of the workflow run object. There's definitely something fishy going on but I have no idea what :/ |
I experimented a lot with this. There seems to be a problem on the GitHub side. Doing the exact same call with a personal access token works and I'm positive the permissions are correct given I can cancel a workflow. I contacted the GitHub support. I'll let you know how it goes. |
Thanks a lot for the investigation @gsmet ! |
@glefloch so the GitHub team confirmed to me it's a bug on their side. No ETA for the fix, I'll work on a workaround tonight and push a commit for you to review. |
Nice thanks! |
There is a bug in the GitHub API and for now it's not possible to trigger a rerun with an installation token. We have no ETA for the fix so using a personal access token is the only workaround for now.
@glefloch I pushed the workaround, could you have a look? I tested it and it seems to work. |
@gsmet it looks good to me! |
@gsmet, I tested it with my playground bot and it works well. |
This branch aims to add commands handling on pull request command.
On a pull request comment, it :
@quarkus-bot
quarkus-push
teamsOnce it is ok, it looks for a
Command
bean that match the comment body.The
RerunWorkflowCommand
acceptstest
andretest
allowing:@quarkus-bot test
command@quarkus-bot retest
commandRegarding the workflow, it looks for Quarkus CI
WorkflowRun
, take the last one, andrerun
it.I created the PR in draft as I'm not able to get a working
rerun
, no error, is thrown by the API. When I log the url of the workflow that should be rerun, it is the correct one. This may come from my repo not providing enough permissions but I'm not able to find what's missing, maybe @gsmet you will have some hints?