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

Redeliver failed webhooks to account for temporary errors #5877

Closed
wants to merge 1 commit into from

Conversation

kalikiana
Copy link
Member

@kalikiana
Copy link
Member Author

This is an alternative to #5876 which I found after preparing the draft based on the boilerplate from official GitHub docs, and probably what we would prefer as we don't need to maintain this in the repo plus it already supports multiple hooks out of the box.

@Martchus
Copy link
Contributor

Did you have a look at the code this executes? I haven't and thus cannot really approve this PR. As mentioned in the other PR we should probably test what implications this can have for the various webhooks we have. (We don't want things to happen twice or e.g. re-trigger CI checks based on an old state.)

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gateixeira/retrigger-webhook-action@main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This action doesn't seem to be an official github action.
Also I think we should never use the main version of a third party action we don't control.
And also the usage
https://github.com/gateixeira/retrigger-webhook-action
seems to be totally different. It should not be a scheduled workflow on its own. It says "Add the following snippet to an existing workflow file".
And I think this should really be tested somehow, maybe you can add a dummy workflow in your fork.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What existing workflow would this be if not this one? I read existing as any workflow where this action is useful, and the schedule is what GitHub docs recommend.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative is #5876 where we implement it from scratch.

I agree on adding a version, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What existing workflow would this be if not this one? I read existing as any workflow where this action is useful, and the schedule is what GitHub docs recommend.

I don't know. I don't find the documentation of that action very useful and also not very reassuring :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't find it worse than many of the Perl modules we rely on to be honest. It was a quick proof of concept either way, so no hard feelings if you're not fond of the general idea of the redelivery approach either.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never said that I don't like the idea.

And for a proof of concept we still need the proof :)

token: ${{ secrets.GH_TOKEN_FOR_ACTIONS }}
owner: ${{ github.repository_owner }}
repo: ${{ github.event.repository.name }}
last_redelivery_variable_name: 'LAST_WEBHOOK_REDELIVERY'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does that come from? I don't really understand the documentation of the action.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, which webhook should it attempt to redeliver? we have more than one and probably need to give it an id, e.g. like documented webhook_id: 'YOUR_HOOK_ID'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. I forgot to add the comment here. This is to store the last timestamp in a variable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would still need the webhook id.

@kalikiana kalikiana force-pushed the redeliver-gateixeira branch from 22a075e to 07067a2 Compare August 21, 2024 13:14
@kalikiana
Copy link
Member Author

Did you have a look at the code this executes? I haven't and thus cannot really approve this PR. As mentioned in the other PR we should probably test what implications this can have for the various webhooks we have. (We don't want things to happen twice or e.g. re-trigger CI checks based on an old state.)

https://github.com/gateixeira/retrigger-webhook-action/blob/f606bae35fe73db18b10fe1ce6b5e52a734b6062/src/main.ts

It is based on the officially documented boilerplate and uses the same pattern to avoid retriggering hooks more than once.

@okurz
Copy link
Member

okurz commented Sep 13, 2024

With openSUSE/open-build-service#16834 this shouldn't be necessary anymore, right?

@kalikiana
Copy link
Member Author

With openSUSE/open-build-service#16834 this shouldn't be necessary anymore, right?

Ack.

@kalikiana kalikiana closed this Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants