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

Ignore updates from specified users / enable validation through HV / draft for handling automation events from downstream #57

Merged

Conversation

marko-bekhta
Copy link
Member

I tested this a bit with JIRATEST1.

@@ -307,12 +312,40 @@ public void acknowledge(String project, JiraWebHookEvent event) {
throw new ConstraintViolationException("Project " + project + " is not configured.", Set.of());
}

if (context.isUserIgnored(triggeredByUser)) {
Copy link
Member

Choose a reason for hiding this comment

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

Note this means we will buffer a request body and deserialize the event before we check whether we ignore the request entirely (because of the user).
A potential improvement for later, to reduce the stress on the app, would be to implement this check as a filter instead. This might avoid the deserialization -- though probably not the buffering of the request body.
I say for later, because I'm not sure we even need such an optimization without our current workload :)

@marko-bekhta marko-bekhta force-pushed the feat/validation-and-user-ignore branch from 478ba6d to 224ca18 Compare November 29, 2024 14:38
since `notifyUsers=false` does not apply to all requests and we've disabled notifications downstream this query param is not sent anymore to allow automation updating upstream issues to work with a non-admin user.
@marko-bekhta marko-bekhta force-pushed the feat/validation-and-user-ignore branch from 224ca18 to 3ad99a2 Compare December 4, 2024 11:14
@marko-bekhta marko-bekhta marked this pull request as ready for review December 4, 2024 11:51
@marko-bekhta marko-bekhta merged commit c628dbf into hibernate:main Dec 4, 2024
1 check 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