Skip to content

Commit bc45032

Browse files
Merge branch 'Uninett:main' into main
2 parents 11cb07b + 9e5c2af commit bc45032

File tree

213 files changed

+5234
-7929
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+5234
-7929
lines changed

.claude/hooks/check-test-names.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# PostToolUse hook: check test naming conventions after Edit/Write on test files.
3+
# Gives Claude feedback (exit 2) so it can fix the names before committing.
4+
5+
INPUT=$(cat)
6+
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
7+
8+
# Only check test files under tests/
9+
if [[ ! "$FILE_PATH" =~ ^.*/tests/.*\.py$ ]] && [[ ! "$FILE_PATH" =~ ^tests/.*\.py$ ]]; then
10+
exit 0
11+
fi
12+
13+
# Find the project root (where checks/ lives)
14+
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel 2>/dev/null)}"
15+
CHECKER="$PROJECT_DIR/checks/check_test_names.py"
16+
17+
if [[ ! -f "$CHECKER" ]]; then
18+
exit 0
19+
fi
20+
21+
# Make file_path relative to project root for the checker
22+
REL_PATH="${FILE_PATH#"$PROJECT_DIR"/}"
23+
24+
output=$(python3 "$CHECKER" --files "$REL_PATH" 2>&1)
25+
exit_code=$?
26+
27+
if [[ $exit_code -ne 0 ]]; then
28+
echo "$output" >&2
29+
exit 2
30+
fi

.claude/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"hooks": {
3+
"PostToolUse": [
4+
{
5+
"matcher": "Edit|Write",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/check-test-names.sh",
10+
"timeout": 10
11+
}
12+
]
13+
}
14+
]
15+
}
16+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Check test names
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
pull-requests: write
8+
9+
jobs:
10+
check-test-names:
11+
runs-on: ubuntu-latest
12+
name: Check test naming convention
13+
steps:
14+
- uses: actions/checkout@v6
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Check new test names
19+
id: check
20+
run: |
21+
base="origin/${{ github.event.pull_request.base.ref }}"
22+
output=$(python3 checks/check_test_names.py --base "$base" --format markdown 2>&1) && has_violations=false || has_violations=true
23+
echo "$output"
24+
{
25+
echo "body<<BODY_EOF"
26+
echo "$output"
27+
echo "BODY_EOF"
28+
} >> "$GITHUB_OUTPUT"
29+
echo "has_violations=$has_violations" >> "$GITHUB_OUTPUT"
30+
31+
- name: Find existing comment
32+
uses: peter-evans/find-comment@v3
33+
id: find-comment
34+
with:
35+
issue-number: ${{ github.event.pull_request.number }}
36+
comment-author: 'github-actions[bot]'
37+
body-includes: '<!-- check-test-names -->'
38+
39+
- name: Post or update comment
40+
if: steps.check.outputs.has_violations == 'true'
41+
uses: peter-evans/create-or-update-comment@v4
42+
with:
43+
comment-id: ${{ steps.find-comment.outputs.comment-id }}
44+
issue-number: ${{ github.event.pull_request.number }}
45+
edit-mode: replace
46+
body: |
47+
<!-- check-test-names -->
48+
${{ steps.check.outputs.body }}
49+
50+
- name: Change comment to mention resolved violations
51+
if: steps.check.outputs.has_violations == 'false' && steps.find-comment.outputs.comment-id != ''
52+
uses: peter-evans/create-or-update-comment@v4
53+
with:
54+
comment-id: ${{ steps.find-comment.outputs.comment-id }}
55+
edit-mode: replace
56+
body: |
57+
<!-- check-test-names -->
58+
### Test naming convention
59+
60+
All new test names follow the convention. :thumbsup:

.github/workflows/python.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ jobs:
7878
python -m pip install --upgrade virtualenv "tox>=4" tox-gh-actions coverage
7979
8080
- name: Set up PostgreSQL
81-
uses: harmon758/postgresql-action@v1
81+
uses: ankane/setup-postgres@v1
8282
with:
83-
postgresql db: $POSTGRES_DB
84-
postgresql user: $POSTGRES_USER
85-
postgresql password: $POSTGRES_PASSWORD
83+
database: ${{ env.POSTGRES_DB }}
84+
user: ${{ env.POSTGRES_USER }}
85+
8686
- name: "Check for Django warnings"
8787
run: python3 -m tox -e django-warnings
8888
- name: Run Tests with PostgreSQL
@@ -99,7 +99,7 @@ jobs:
9999
100100
- name: Upload test reports (${{ matrix.python-version }})
101101
if: always()
102-
uses: actions/upload-artifact@v6
102+
uses: actions/upload-artifact@v7
103103
with:
104104
name: test-reports-${{ matrix.python-version }}
105105
path: |
@@ -122,7 +122,7 @@ jobs:
122122
run: |
123123
echo $BASE_SHA > ./extra/base_sha
124124
- name: Upload PR number file and base SHA file
125-
uses: actions/upload-artifact@v6
125+
uses: actions/upload-artifact@v7
126126
with:
127127
name: extra
128128
path: extra/

.gitignore

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
!.pre-commit-config.yaml
99
!.readthedocs.yaml
1010
!.sonarcloud.properties
11+
!.claude/
12+
.claude/*
13+
!.claude/settings.json
14+
!.claude/hooks/
1115
!.mailmap
1216

1317
# local config files
@@ -43,9 +47,12 @@ spasettings.py
4347
*$py.class
4448

4549
# Tailwind CSS
46-
# src/argus/htmx/static/styles.css
47-
# Autogenerated via management command
48-
# src/argus/htmx/tailwindtheme/tailwind.config.js
50+
src/argus/htmx/static/styles.css
51+
src/argus/htmx/tailwindtheme/styles.css
52+
src/argus/htmx/tailwindtheme/tailwind.css
53+
src/argus/htmx/tailwindtheme/custom-themes/*
54+
!src/argus/htmx/tailwindtheme/custom-themes/README.md
55+
4956
# OS specific
5057
src/argus/htmx/tailwindtheme/tailwindcss
5158

CHANGELOG.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,107 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang
88

99
<!-- towncrier release notes start -->
1010

11+
## [2.8.0] - 2026-03-06
12+
13+
The most important change in this release is that we have finally added the
14+
long awaited task queue, to handle background tasks. The task queue uses the
15+
database for storage by default so running migrations is necessary. As part of
16+
using the queue to send notifications we fixed several bugs that caused a lower
17+
amount of notifications to be sent than expected. Another big change is we have
18+
upgraded tailwind, which affects theme customization and building packages.
19+
20+
You *must* see the NOTES before updating if you or your deployment do any of
21+
the following:
22+
23+
- Send notifications (`SEND_NOTIFICATIONS = True`). Affected both by the new
24+
queue and the bug-fixes.
25+
- Alter any templates or CSS, due to the upgrade of tailwind.
26+
- Replace or rework the incident list filter box.
27+
- Write your own media plugins.
28+
- Build your own package (useful for bundling themes and tweaks). The release
29+
checklist has changed.
30+
31+
### Added
32+
33+
- Added support for a task queue. We're using `django-tasks`, which is in the
34+
process of being merged into Django proper, with the backend
35+
`django-tasks-db`. This stores the tasks in the same database as everything
36+
else. We're currently only using the queue to send notifications, so if you
37+
are not using argus for that (`SEND_NOTIFICATIONS` is off), nothing changes.
38+
([#1608](https://github.com/Uninett/Argus/issues/1608))
39+
- Add "Create copy" action for planned maintenance tasks
40+
([#1613](https://github.com/Uninett/Argus/issues/1613))
41+
- Show name of owner for public filters
42+
([#1748](https://github.com/Uninett/Argus/issues/1748))
43+
- Add preview of incidents covered by selected filters in planned maintenance
44+
task form ([#1765](https://github.com/Uninett/Argus/issues/1765))
45+
- Create admin user from env variables in docker entrypoint
46+
([#1776](https://github.com/Uninett/Argus/issues/1776))
47+
- Validate `DAISYUI_THEMES` entries, skipping invalid ones with warnings
48+
([#1819](https://github.com/Uninett/Argus/issues/1819))
49+
- Add Sikt light and dark DaisyUI themes based on Sikt Design System color
50+
tokens ([#1822](https://github.com/Uninett/Argus/issues/1822))
51+
52+
### Changed
53+
54+
- Upgrade to Tailwind CSS v4 and DaisyUI v5. See NOTES for theme customization.
55+
([#1262](https://github.com/Uninett/Argus/issues/1262))
56+
- We are now using a task queue to send notifications instead of forking off
57+
a process. This is to increase robustness and hopefully to increase
58+
throughput. If argus is being used to send notifications, you MUST change
59+
your deployment as there now is an additional service that needs to run in
60+
order to handle the notifications on the queue. See the NOTES!
61+
([#1608](https://github.com/Uninett/Argus/issues/1608))
62+
- Refactor incident list filter UI with collapsible filterbox and dynamic bulk
63+
actions bar. ([#1693](https://github.com/Uninett/Argus/issues/1693))
64+
- Improve maintenance column by adding a dropdown with tasks that affect the
65+
incident ([#1745](https://github.com/Uninett/Argus/issues/1745))
66+
- Support searching for filters by first and last name of user
67+
([#1764](https://github.com/Uninett/Argus/issues/1764))
68+
- Added under maintenance column to maintenance column preset
69+
([#1775](https://github.com/Uninett/Argus/issues/1775))
70+
- Improve timeslot form with compact table layout for time recurrences
71+
([#1794](https://github.com/Uninett/Argus/issues/1794))
72+
- Consolidate notification routes under /notifications/ with tab navigation
73+
([#1795](https://github.com/Uninett/Argus/issues/1795))
74+
- Improve notification profile form with collapsible cards and inline actions
75+
([#1796](https://github.com/Uninett/Argus/issues/1796))
76+
- Moved some functionality from the email media plugin to the base class of all
77+
media plugins. Basically, any destination can now be marked as being
78+
"managed", which means that it is created and managed by a system outside of
79+
an end-users control. This can be for instance email addresses or phone
80+
numbers fetched from an account-database or address book.
81+
([#1802](https://github.com/Uninett/Argus/issues/1802))
82+
- Redesign destination page as flat table with inline editing
83+
([#1806](https://github.com/Uninett/Argus/issues/1806))
84+
- Tailwind CSS intermediate files (theme CSS, config snippets) are no longer
85+
tracked in git. See NOTES.
86+
([#1826](https://github.com/Uninett/Argus/issues/1826))
87+
- Redesign filter toolbar with compact icon buttons and direct filter actions
88+
([#1831](https://github.com/Uninett/Argus/issues/1831))
89+
90+
### Fixed
91+
92+
- Notifications are now also sent on bulk changes to incidents. Note that for
93+
filters used for sending notifications, it will be necessary to control event
94+
types to maintain the current expected amount of notifications sent. See
95+
NOTES. ([#1763](https://github.com/Uninett/Argus/issues/1763))
96+
- Limit choices of incidents field in PM admin to open incidents
97+
([#1789](https://github.com/Uninett/Argus/issues/1789))
98+
- Make it possible to use public filters in notification profiles
99+
([#1805](https://github.com/Uninett/Argus/issues/1805))
100+
- Fixed a bug where the setting that controls whether notifications will be
101+
sent was ignored when sending notifications in the background. The
102+
notifications were sent regardless.
103+
([#1808](https://github.com/Uninett/Argus/issues/1808))
104+
- Allow for multiple notification profiles with no name
105+
([#1828](https://github.com/Uninett/Argus/issues/1828))
106+
- Fix showing age for stateless incidents
107+
([#1833](https://github.com/Uninett/Argus/issues/1833))
108+
- Fix theme preview showing wrong foreground text color on color swatches
109+
([#1834](https://github.com/Uninett/Argus/issues/1834))
110+
111+
11112
## [2.7.0] - 2026-01-23
12113

13114
This release improves the UX for creating planned maintenance tasks, by having

Makefile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: clean testclean distclean coverageclean cacheclean nuke tailwind docclean upgrade-tailwind tailwind-watch
1+
.PHONY: clean testclean distclean coverageclean cacheclean nuke setup-tailwind tailwind-config tailwind-build-config tailwind docclean upgrade-tailwind tailwind-watch check-test-names
22

33
TAILWINDDIR=src/argus/htmx/tailwindtheme
44
STATICDIR=src/argus/htmx/static
@@ -31,11 +31,22 @@ testclean: coverageclean clean
3131

3232
nuke: clean docclean distclean testclean cacheclean
3333

34+
setup-tailwind: upgrade-tailwind tailwind-config tailwind
35+
36+
tailwind-config:
37+
PYTHONPATH=$(PYTHONPATH) python3 manage.py tailwind_config
38+
39+
tailwind-build-config:
40+
PYTHONPATH=$(PYTHONPATH) python3 src/argus/htmx/tailwindtheme/generate_css_config.py
41+
3442
tailwind:
35-
$(TAILWINDDIR)/tailwindcss -c $(TAILWINDDIR)/tailwind.config.js -i $(TAILWINDDIR)/styles.css -o $(STATICDIR)/styles.css
43+
$(TAILWINDDIR)/tailwindcss -i $(TAILWINDDIR)/styles.css -o $(STATICDIR)/styles.css
3644

3745
tailwind-watch:
38-
$(TAILWINDDIR)/tailwindcss -c $(TAILWINDDIR)/tailwind.config.js -i $(TAILWINDDIR)/styles.css -o $(STATICDIR)/styles.css --watch
46+
$(TAILWINDDIR)/tailwindcss -i $(TAILWINDDIR)/styles.css -o $(STATICDIR)/styles.css --watch
3947

4048
upgrade-tailwind:
4149
PYTHONPATH=$(PYTHONPATH) python3 src/argus/htmx/tailwindtheme/get_tailwind.py
50+
51+
check-test-names:
52+
python3 checks/check_test_names.py --base main

0 commit comments

Comments
 (0)