feat: add artefact.attributes JSONB column (expand) [1/3] - #848
Open
almeidaraul wants to merge 1 commit into
Open
feat: add artefact.attributes JSONB column (expand) [1/3]#848almeidaraul wants to merge 1 commit into
almeidaraul wants to merge 1 commit into
Conversation
This was referenced Aug 18, 2026
First step of introducing a generic `attributes` field on artefacts. - Add the `attributes` JSONB column via a non-destructive migration (add column only, empty-object default), safe for rolling upgrades. - Map `attributes` on the Artefact ORM model and expose it read-only on ArtefactResponse. All existing solution-specific fields/mappings are left untouched so old code keeps working. - Normalise integer-valued floats when fetching the OpenAPI schema so the committed schema is stable across jq versions in CI. No behaviour change: nothing writes to or reads from `attributes` yet. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
almeidaraul
force-pushed
the
TO-404/1-add-attributes
branch
from
August 18, 2026 13:13
54cdecc to
aabbc7a
Compare
almeidaraul
marked this pull request as ready for review
August 18, 2026 13:26
Contributor
There was a problem hiding this comment.
Pull request overview
Implements the expand step of a rolling-upgrade-safe migration to introduce a generic artefact.attributes JSONB column, exposing it read-only via the API while keeping existing solution-specific fields untouched.
Changes:
- Add
artefact.attributesJSONB column with an empty-object default via Alembic (non-destructive expand migration). - Map
attributeson the SQLAlchemyArtefactmodel and include it inArtefactResponse+ controller expectations/tests. - Stabilize committed OpenAPI schema diffs across CI by normalizing integer-valued floats in the schema fetch + compare steps.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| backend/migrations/versions/2026_08_17_1723-6e262c3c6c8f_add_artefact_attributes.py | Adds the attributes JSONB column with an empty default (expand step). |
| backend/test_observer/data_access/models.py | Maps Artefact.attributes as a mutable JSONB dict with defaults. |
| backend/test_observer/controllers/artefacts/models.py | Exposes attributes on the ArtefactResponse API model. |
| backend/tests/data_access/test_models.py | Adds persistence/default tests for Artefact.attributes. |
| backend/tests/controllers/artefacts/test_artefacts.py | Updates expected artefact controller response to include attributes. |
| backend/tests/controllers/test_executions/test_reruns.py | Updates expected rerun response payload to include attributes. |
| backend/scripts/fetch_openapi_schema.sh | Normalizes schema numbers for stable committed OpenAPI output. |
| backend/schemata/openapi.json | Updates committed OpenAPI schema to include attributes. |
| .github/workflows/test_backend.yml | Keeps CI schema comparison stable by applying the same jq normalization filter. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
71
to
75
| family: str | ||
| status: ArtefactStatus | ||
| comment: str | ||
| attributes: dict[str, Any] | ||
| archived: bool |
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.
Part 1 of 3 (stacked) — splitting
TO-404/remove-solution-specific-fieldsinto rolling-upgrade-safe expand/contract steps.What
Expand step: introduce a generic
attributesJSONB field on artefacts, without changing any behaviour.attributescolumn via a non-destructive migration (add column only, empty-object default).attributeson theArtefactORM model and expose it read-only onArtefactResponse.jqversions in CI.Safety
No-op for clients: nothing writes to or reads from
attributesyet.Stacked PR order
mainTO-404/2-write-both→TO-404/1-add-attributesTO-404/3-migrate-read-new→TO-404/2-write-bothEach must be merged and deployed before the next (expand/contract rolling-upgrade requirement).