Skip to content

PB-1403 WIP#642

Draft
adk-swisstopo wants to merge 6 commits into
developfrom
PB-1403-update
Draft

PB-1403 WIP#642
adk-swisstopo wants to merge 6 commits into
developfrom
PB-1403-update

Conversation

@adk-swisstopo
Copy link
Copy Markdown
Member

@adk-swisstopo adk-swisstopo commented May 28, 2026

Experimental branch from which I cherry pick.

@adk-swisstopo adk-swisstopo force-pushed the PB-1403-update branch 11 times, most recently from 8bca52b to 5eadc43 Compare May 29, 2026 09:19
We test that the `Expires` header is set correctly in four different scenarios.
The code extracting and comparing the header is duplicated four times.

This change moves the code into a method which is called in each of the four
cases with slightly different parametres. We also simplify the checks to let
`assertAlmostEqual` and `assertIn` do the work themselves. This gives us better
error messages too.
@adk-swisstopo adk-swisstopo force-pushed the PB-1403-update branch 3 times, most recently from 5f1167c to 4678092 Compare May 29, 2026 11:29
The `auto_variables_triggers` function is used to generate PostgreSQL triggers
to update some fields automatically. Currently it is triggered when any field
changes. For PB-1403 we want at least one of these triggers to be conditional
on specific fields.

This change replaces the raw-SQL-based `Condition('OLD.* IS DISTINCT FROM NEW.*')`
with `AnyChange(fields)`. This is equivalent as long as `fields` is empty. We
also update `auto_variables_triggers` to take a new optional `fields` argument
(defaulting to empty). This allows callers to define the conditions that apply
for the trigger.

A later change will make use of this new parametre.
The `updated` field of `Asset` objects is updated when any field is updated.
This causes unecessary churn and confusion when hidden metadata are updated.

This change ensures the `updated` field is only updated when the `file`,
`checksum_multihash` or `file_size` field is updated.

Only update Asset mtime when specific data fields are updated.
@adk-swisstopo adk-swisstopo changed the title Parameterise auto_variables_triggers. PB-1403 WIP May 29, 2026
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.

1 participant