Skip to content

Conversation

@hmpf
Copy link
Contributor

@hmpf hmpf commented Dec 5, 2025

Scope and purpose

Ensures that notificationprofile and pm tasks use filters the same way.

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, including updates to the user manual if feature flow or UI is considerably changed
  • 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
  • [ ] If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done
  • [ ] If this results in changes in the UI: Added screenshots of the before and after
  • [ ] If this results in changes to the database model: Updated the ER diagram

@hmpf hmpf requested review from a team and johannaengland December 5, 2025 11:38
@hmpf hmpf self-assigned this Dec 5, 2025
@hmpf hmpf added refactor nonews No news fragment is necessary for this PR (e.g. refactoring, cleanups, workflow/development changes) labels Dec 5, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 5, 2025

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

Test results

    4 files    528 suites   10m 36s ⏱️
  628 tests   627 ✅ 1 💤 0 ❌
2 512 runs  2 508 ✅ 4 💤 0 ❌

Results for commit 94aa642.

@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

❌ Patch coverage is 90.90909% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.74%. Comparing base (1bd40eb) to head (94aa642).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/argus/plannedmaintenance/utils.py 88.88% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1667      +/-   ##
==========================================
+ Coverage   79.70%   79.74%   +0.03%     
==========================================
  Files         133      133              
  Lines        6174     6196      +22     
==========================================
+ Hits         4921     4941      +20     
- Misses       1253     1255       +2     

☔ 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.

def current(self):
return self.active_at_time(timezone.now())

def active_at_time(self, time: Optional[datetime] = None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, that one got lost during rebasing 😅

return super().incident_fits(incident)

def event_fits(self, event: Event) -> bool:
is_ongoing = self.is_ongoing(self.timestamp)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a docstring on why you're testing is_ongoing with the PM timestamp? Because from my understanding we only need to test if the time the event happened the PM was ongoing


def event_covered_by_planned_maintenance(event: Event, pm_tasks: Optional[PlannedMaintenanceQuerySet] = None) -> bool:
def event_covered_by_planned_maintenance(
event: Event, pm_tasks: Optional[PlannedMaintenanceQuerySet] = None, timestamp: Optional[datetime] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused by the timestamp here - it is optional all the way until is_ongoing, where it is required, but we never set it if it is None

Copy link
Contributor

Choose a reason for hiding this comment

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

And I don't fully understand what the timestamp is user for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nonews No news fragment is necessary for this PR (e.g. refactoring, cleanups, workflow/development changes) refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants