-
Notifications
You must be signed in to change notification settings - Fork 310
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
feature: Pause application webhooks #7247
Conversation
bbdd872
to
9cc125d
Compare
Code looks good to me. I guess we want Console support for this as well? Do we need to add an end-to-end test? Backlog is not a good milestone for a PR. |
For now I placed it in the Backlog milestone as the issue is also in Backlog. |
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.
Base functionality looks great.
A few comments
- Please run
tools/bin/mage jsSDK:definitions
which should fix some of the CI errors. - Indeed this needs Console support, I'll comment in the source issue and check with the frontend team
- Please add CLI Support, look for
applicationsWebhooksSetCommand
in thecmd/commands/applications_webhooks.go
- This needs a CHANGELOG entry.
- I think we should trigger a notification to the users when a Webhook is paused or unpaused. I don't think we currently have a mechanism for TTS components to trigger a notification in the IS since
CreateNotificationRequest
is currently only used internally by the IS. @nicholaspcr is this correct?
As a side note:
curl -H "Authorization: $AUTH_TOKEN" 'http://localhost:1885/api/v3/as/webhooks/app1' -d '{"webhook":{"base_url":"https://webhook.site/1e8cc8cf-1b46-4da5-92ea-711b818ba6ec","paused": false,"field_mask":{"paths":[]},"format":"json","ids":{"webhook_id":"wh4"}},"field_mask":{"paths":["base_url","field_mask","format","ids.webhook_id","paused"]}}'
Does this call actually work? I think we require bearer tokens so Authorization: Bearer <token>
https://github.com/TheThingsNetwork/lorawan-stack/blob/v3.32/pkg/webmiddleware/log.go#L76-L83
Regarding milestones, |
@vlasebian: On second thought, let's skip this. This would make this PR more complex than it is. I would however like to emit an event when the user pauses/unpauses a webhook. |
It is there, yes, in the |
9cc125d
to
d2e1c82
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.
Code looks good. Please fix CI using the following mage commands
mage proto:all
mage go:messages
mage jsSDK:definitions
579bbe1
to
9564b13
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.
One comment, otherwise LGTM
00a8663
to
9343bd2
Compare
9343bd2
to
a0c23c0
Compare
Summary
References #7223
Changes
paused
boolean field to the ApplicationWebhook objectpaused
field set to TrueTesting
Steps
Regressions
I checked if an existing webhook created in a previous version is affected by this change. This are the steps that I did:
Notes for Reviewers
Both uplink and downlink webhooks are paused if the flag is set.
Checklist
README.md
for the chosen target branch.CHANGELOG.md
.CONTRIBUTING.md
, there are no fixup commits left.