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

Add headers to webhook alerts #320

Merged
merged 14 commits into from
Feb 25, 2025
Merged

Add headers to webhook alerts #320

merged 14 commits into from
Feb 25, 2025

Conversation

f-wright
Copy link
Contributor

@f-wright f-wright commented Feb 24, 2025

This PR allows the user to customize the headers field for their webhook alerts in addition to the payload. This will enable auth, which is required by a lot of different platforms.

@f-wright f-wright marked this pull request as ready for review February 25, 2025 00:41
Copy link
Collaborator

@brandon-groundlight brandon-groundlight left a comment

Choose a reason for hiding this comment

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

Could you double check that the generated files are up to date? Also, it's worth considering modeling the data types for the headers. Everything else about the webhooks is modeled pretty well, and without looking at the zuuul side I believe all you would need to do is nest a header serializer inside the webhood serializer.

@@ -1242,6 +1242,8 @@ components:
properties:
template:
type: string
headers:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there no openapi type for the headers? In the client I see that the headers are expected to be a Optional[Dict[str, str]]. Should we model that here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point -- I'll make the cloud service changes so that makes it into the spec.

@@ -251,7 +253,7 @@ class MultiClassificationResult(BaseModel):
class TextRecognitionResult(BaseModel):
confidence: Optional[confloat(ge=0.0, le=1.0)] = None
source: Optional[Source] = None
text: Optional[str] = Field(...)
text: str
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you double check how this got changed? I'm not seeing a corresponding change in the public-api.yaml file. My expectation is that this line should mean that this is still optional. Is it possible that you generated the file with a work in progress yaml spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how it got changed, but regenerating seems to have solved it.

@@ -29,6 +29,11 @@ docs/ImageQueriesApi.md
docs/ImageQuery.md
docs/ImageQueryTypeEnum.md
docs/InlineResponse200.md
docs/InlineResponse2001.md
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unrelated to my change -- not sure if I should keep those changes out of the public-api.yaml file when generating?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is related to #319. You can either ignore it here, or you can let me merge the other PR first and then you can merge main into your PR to get a cleaner diff

Copy link
Collaborator

@brandon-groundlight brandon-groundlight left a comment

Choose a reason for hiding this comment

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

LGTM

@f-wright f-wright merged commit f5c7f6a into main Feb 25, 2025
8 checks passed
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.

2 participants