Skip to content

Stop using media_slugs verbatim - #1953

Merged
aleksfl merged 1 commit into
mainfrom
finish-cleaning-up-media-so-media_slug-is-less-commonplace
Jun 24, 2026
Merged

Stop using media_slugs verbatim#1953
aleksfl merged 1 commit into
mainfrom
finish-cleaning-up-media-so-media_slug-is-less-commonplace

Conversation

@aleksfl

@aleksfl aleksfl commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Scope and purpose

Fixes #1923.
Add a description of what this PR does and why it is needed. If a linked ticket(s) fully
cover it, you can omit this.

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/amended tests for new/changed code
  • 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

@aleksfl
aleksfl requested a review from a team June 17, 2026 12:19
@aleksfl aleksfl self-assigned this Jun 17, 2026
@aleksfl aleksfl added refactor nonews No news fragment is necessary for this PR (e.g. refactoring, cleanups, workflow/development changes) labels Jun 17, 2026
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

Test results

    8 files  1 744 suites   3m 12s ⏱️
  943 tests   942 ✅ 1 💤 0 ❌
7 544 runs  7 536 ✅ 8 💤 0 ❌

Results for commit c44d281.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.61%. Comparing base (19fa02e) to head (c44d281).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1953      +/-   ##
==========================================
+ Coverage   88.52%   88.61%   +0.08%     
==========================================
  Files         148      148              
  Lines        7135     7173      +38     
==========================================
+ Hits         6316     6356      +40     
+ Misses        819      817       -2     

☔ View full report in Codecov by Harness.
📢 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is such a thing as too much consistency.

I'm thinking we should instead have a constant "EMAIL_DESTINATION_SLUG", as nothing not in the tree below argus.notificationprofile.media should be imported out. But where to put it? It could be on argus.notificationprofile.media, it could be on argus.notificationprofile too maybe.

None of the other media types are special cased like this.

Another possibility is moving the signal and only attaching it if the email plugin is in use but that's a lot more work and takes more thinking.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is more okay with the v2 API since that is deprecated anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added the constant to media since that seemed most natural. It's not ideal but it works.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See the comment on signals. I could have said the same here but this serializer is after all deprecated so when it is deleted all sins will be forgotten =)

@hmpf
hmpf requested a review from a team June 19, 2026 06:08
@aleksfl
aleksfl requested a review from hmpf June 22, 2026 08:30
@aleksfl
aleksfl force-pushed the finish-cleaning-up-media-so-media_slug-is-less-commonplace branch from 994dc73 to c44d281 Compare June 24, 2026 07:33
@aleksfl
aleksfl merged commit fe78aba into main Jun 24, 2026
19 checks passed
@aleksfl
aleksfl deleted the finish-cleaning-up-media-so-media_slug-is-less-commonplace branch June 24, 2026 07:56
@sonarqubecloud

Copy link
Copy Markdown

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.

Finish cleaning up media so media_slug is less commonplace

2 participants