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

Cancel scheduled maintenance tasks when all their components are missing #3235

Merged

Conversation

lunkwill42
Copy link
Member

This changes the maintengine to automatically cancel active maintenance tasks if they have no valid components referenced (i.e. if the task has 0 components, or all referenced components have been deleted from the database).

It does not cancel scheduled tasks, as they may still become valid before they are activated (someone could still be editing them).

Fixes #3229
Fixed #2243

During task state transition updates, if there are active maintenance
tasks that don't reference any non-deleted components, take care to
cancel it.

It only makes sense to cancel active tasks.  Scheduled tasks could still
be in the process of being edited by an admin, and we don't want to
alter them under the users' nose.
Copy link

sonarcloud bot commented Nov 21, 2024

Copy link

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 992 0 12.75s
✅ PYTHON ruff 988 0 0.1s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

Copy link

Test results

    9 files      9 suites   8m 40s ⏱️
2 142 tests 2 142 ✅ 0 💤 0 ❌
4 023 runs  4 023 ✅ 0 💤 0 ❌

Results for commit fa8994b.

Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.41%. Comparing base (27b12b5) to head (fa8994b).
Report is 62 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3235      +/-   ##
==========================================
+ Coverage   60.39%   60.41%   +0.02%     
==========================================
  Files         605      605              
  Lines       43687    43695       +8     
  Branches       48       48              
==========================================
+ Hits        26383    26398      +15     
+ Misses      17292    17285       -7     
  Partials       12       12              

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

@lunkwill42 lunkwill42 merged commit 2acf2ce into master Nov 29, 2024
14 checks passed
@lunkwill42 lunkwill42 deleted the feature/cancel-maintenance-tasks-without-components branch November 29, 2024 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants