Skip to content

Pass request to incident update actions #1497

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

Merged
merged 1 commit into from
Jun 6, 2025

Conversation

jladd-geant
Copy link
Contributor

@jladd-geant jladd-geant commented May 28, 2025

Scope and purpose

Incident update actions currently dont have any good way to report errors to the UI beyond causing a 500 and can fail silently. This PR passes the request to bulk actions to allow for sending messages to UI when errors occur. geant-argus has bulk actions which interact with external services which can be much less obvious if broken. Also extra checks such as checking for a user's write permission before executing some actions which need to send messages to indicate insufficient permissions in the UI.

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to Argus can be found in the
Development docs.

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation
  • Linted/formatted the code with ruff and djLint, easiest by using pre-commit
  • The first line of the commit message continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See our how-to

@codecov-commenter
Copy link

codecov-commenter commented May 30, 2025

Codecov Report

Attention: Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.

Project coverage is 79.50%. Comparing base (719c987) to head (b9aec97).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/argus/htmx/incident/views.py 0.00% 1 Missing ⚠️
src/argus/htmx/utils.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1497      +/-   ##
==========================================
+ Coverage   79.49%   79.50%   +0.01%     
==========================================
  Files         121      121              
  Lines        5417     5422       +5     
==========================================
+ Hits         4306     4311       +5     
  Misses       1111     1111              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@elfjes elfjes left a comment

Choose a reason for hiding this comment

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

Nice, I like this. Small comment below.

@elfjes
Copy link
Collaborator

elfjes commented Jun 2, 2025

@jladd-geant what do you want to add to this before marking it as ready?

@jladd-geant
Copy link
Contributor Author

jladd-geant commented Jun 2, 2025

@jladd-geant what do you want to add to this before marking it as ready?

I will mark it as ready now, was just going over it again to see if I needed to do anything else first.

@jladd-geant jladd-geant marked this pull request as ready for review June 2, 2025 09:10
@hmpf
Copy link
Contributor

hmpf commented Jun 6, 2025

I would have preferred sending a message outside of these helpers because then they can be reused in the API but that's probably not gonna happen.

@elfjes
Copy link
Collaborator

elfjes commented Jun 6, 2025

I would have preferred sending a message outside of these helpers because then they can be reused in the API but that's probably not gonna happen.

Well, we need some way to send a message from the helpers. Perhaps what we could do is to decouple "sending a message" from the django.messages framework, and provide some kind of message callback as an argument into the helper. The implementation of this callback can then be tailored to the environment in which the helper is called. But I would argue that that is out of scope of this PR. There are more things that we need to address before we can use the bulk helpers in the API, especially when considering the pluggability of the bulk helpers

@johannaengland johannaengland force-pushed the incident-update-errors branch from b8132bb to b9aec97 Compare June 6, 2025 11:41
Copy link

sonarqubecloud bot commented Jun 6, 2025

@johannaengland johannaengland merged commit f958b31 into Uninett:master Jun 6, 2025
14 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.

5 participants