Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
References https://github.com/TheThingsIndustries/lorawan-stack/issues/4163
References https://github.com/TheThingsIndustries/lorawan-stack/pull/4183
This PR backports the changes related to webhook durability in order to lower the reviewable diff in enterprise.
Changes
web
package.webhooks
struct and so forth.webhooks.go
got split a bit, specifically functionality which wasn't really part of thewebhooks
object was split into smaller components in order to allow reusability and more focused testing.web
and got their own dedicated package.internal
package and got compressed into a singlecontext.WithValue
in order to lower the number of allocations a bit. Just chainingcontext.WithValue
3 times when we always do it in the same order and with the same structure is just wasteful.Testing
This is strictly a refactoring without new functionality changes. Most of the code is just strategically moved around in order to decouple it. No manual testing is required, and the existing unit tests should suffice.
Regressions
N/A.
Checklist
README.md
for the chosen target branch.CHANGELOG.md
.CONTRIBUTING.md
, there are no fixup commits left.