Skip to content

feat: add artefact.attributes JSONB column (expand) [1/3] - #848

Open
almeidaraul wants to merge 1 commit into
mainfrom
TO-404/1-add-attributes
Open

feat: add artefact.attributes JSONB column (expand) [1/3]#848
almeidaraul wants to merge 1 commit into
mainfrom
TO-404/1-add-attributes

Conversation

@almeidaraul

Copy link
Copy Markdown
Contributor

Part 1 of 3 (stacked) — splitting TO-404/remove-solution-specific-fields into rolling-upgrade-safe expand/contract steps.

What

Expand step: introduce a generic attributes JSONB field on artefacts, without changing any behaviour.

  • Add the attributes column via a non-destructive migration (add column only, empty-object default).
  • 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 during a rolling upgrade.
  • Normalise integer-valued floats when fetching the OpenAPI schema so the committed schema is stable across jq versions in CI.

Safety

No-op for clients: nothing writes to or reads from attributes yet.

Stacked PR order

  1. This PRmain
  2. TO-404/2-write-bothTO-404/1-add-attributes
  3. TO-404/3-migrate-read-newTO-404/2-write-both

Each must be merged and deployed before the next (expand/contract rolling-upgrade requirement).

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
almeidaraul force-pushed the TO-404/1-add-attributes branch from 54cdecc to aabbc7a Compare August 18, 2026 13:13
@almeidaraul
almeidaraul marked this pull request as ready for review August 18, 2026 13:26
Copilot AI lite review requested due to automatic review settings August 18, 2026 13:26

Copilot AI left a comment

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.

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.attributes JSONB column with an empty-object default via Alembic (non-destructive expand migration).
  • Map attributes on the SQLAlchemy Artefact model and include it in ArtefactResponse + 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants