Conversation
Collaborator
terjekv
force-pushed
the
coverage_updates_post_django6
branch
from
July 4, 2026 13:51
a54d524 to
71cdb61
Compare
terjekv
force-pushed
the
coverage_updates_post_django6
branch
2 times, most recently
from
July 4, 2026 14:09
e6bb54b to
b40cc13
Compare
terjekv
marked this pull request as ready for review
July 4, 2026 14:18
terjekv
force-pushed
the
coverage_updates_post_django6
branch
2 times, most recently
from
July 28, 2026 13:38
6f10b23 to
3f68405
Compare
terjekv
added a commit
that referenced
this pull request
Jul 29, 2026
## Summary - Preserve the pre-#628 field order for `NetworkSerializer` and `NetGroupRegexPermissionSerializer`. - Retain the explicit `network` and `range` fields required for OpenAPI generation. - Restore `mreg.api.views.LIBRARIES_TO_REPORT` as a compatibility alias. - Ensure mreg-cli tests the image built for the current pull request. - Add regression tests for both serializer orders and the compatibility alias. ## Root cause ### Serializer field ordering PR #628 explicitly declared two custom model fields so drf-spectacular could describe them: ```python NetworkSerializer.network = serializers.CharField() NetGroupRegexPermissionSerializer.range = serializers.CharField() ``` Combined with `fields = "__all__"`, DRF moved those fields earlier in the serialized output. `NetworkSerializer` changed from: ```text id, excluded_ranges, policy, communities, created_at, updated_at, network, ... ``` to: ```text id, network, excluded_ranges, policy, communities, created_at, updated_at, ... ``` `NetGroupRegexPermissionSerializer` changed from: ```text id, created_at, updated_at, group, range, regex, labels ``` to: ```text id, range, created_at, updated_at, group, regex, labels ``` Although JSON object order is not semantically significant, mreg-cli’s recorded-output tests compare it, and stable serialization avoids unnecessary changes for existing consumers. Both serializers now use explicit field tuples in their previous order while retaining the explicit custom fields required for OpenAPI generation. ### Renamed constant PR #628 moved the reported-library constant from `mreg.api.views` to `mreg.api.serializers` and renamed it to `REPORTED_LIBRARY_VERSION_FIELDS`. In-flight pull requests created before #628, including #616, still import `LIBRARIES_TO_REPORT` from `mreg.api.views`. The previous name is retained as an alias: ```python LIBRARIES_TO_REPORT = REPORTED_LIBRARY_VERSION_FIELDS ``` This keeps older branches compatible without duplicating the value. ### Incorrect image used by mreg-cli The container workflow tagged the newly built PR image locally as: ```text ghcr.io/unioslo/mreg:latest ``` However, the mreg-cli integration script defaults to: ```text ghcr.io/unioslo/mreg:master ``` The integration job could therefore test the published registry image instead of the image built for the current pull request.
Run uv run tox -r
uv run tox -r
shell: /usr/bin/bash -e {0}
env:
UV_FROZEN: 1
UV_CACHE_DIR: /home/runner/work/_temp/setup-uv-cache
MREG_DB_PASSWORD: postgres
python312-django52: venv> .venv/bin/uv venv -p /home/runner/work/mreg/mreg/.venv/bin/python --allow-existing --python-preference system .tox/python312-django52
python312-django52: uv-sync> uv sync --locked --python-preference system --no-default-groups --group ci --group dev -p /home/runner/work/mreg/mreg/.venv/bin/python
error: the argument '--locked' cannot be used with '--frozen'
Usage: uv sync --locked --no-default-groups --group <GROUP> --python <PYTHON> --cache-dir <CACHE_DIR>
For more information, try '--help'.
python312-django52: exit 2 (0.01 seconds) /home/runner/work/mreg/mreg> uv sync --locked --python-preference system --no-default-groups --group ci --group dev -p /home/runner/work/mreg/mreg/.venv/bin/python pid=3242
python312-django52: FAIL ✖ in 0.09 seconds
python312-django60: venv> .venv/bin/uv venv -p /home/runner/work/mreg/mreg/.venv/bin/python --allow-existing --python-preference system .tox/python312-django60
python312-django60: uv-sync> uv sync --locked --python-preference system --no-default-groups --group ci --group dev -p /home/runner/work/mreg/mreg/.venv/bin/python
error: the argument '--locked' cannot be used with '--frozen'
Usage: uv sync --locked --no-default-groups --group <GROUP> --python <PYTHON> --cache-dir <CACHE_DIR>
For more information, try '--help'.
python312-django60: exit 2 (0.01 seconds) /home/runner/work/mreg/mreg> uv sync --locked --python-preference system --no-default-groups --group ci --group dev -p /home/runner/work/mreg/mreg/.venv/bin/python pid=3250
python312-django52: FAIL code 2 (0.09 seconds)
python312-django60: FAIL code 2 (0.05 seconds)
evaluation failed :( (0.18 seconds)
With the move to a newer Django, we can finally use the built-in support for parallel testing. The effect is rather profound: ``` $ source .venv/bin/activate && source .env && coverage run manage.py test --parallel Found 884 test(s). Creating test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... Cloning test database for alias 'default'... System check identified no issues (0 silenced). .....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................s.............................................................................................................................................................................................................................................................................................................................................s................................................................ ---------------------------------------------------------------------- Ran 884 tests in 54.608s OK (skipped=2) Destroying test database for alias 'default'... Destroying test database for alias 'default'... Destroying test database for alias 'default'... Destroying test database for alias 'default'... Destroying test database for alias 'default'... Destroying test database for alias 'default'... Destroying test database for alias 'default'... Destroying test database for alias 'default'... Destroying test database for alias 'default'... Destroying test database for alias 'default'... Destroying test database for alias 'default'... ```
terjekv
force-pushed
the
coverage_updates_post_django6
branch
from
July 29, 2026 11:27
3f68405 to
6acf831
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coverage work after the last set of major changes.