Add versioning freeze & compatibility workflows#123
Conversation
Add a versioning-freeze pipeline and compatibility checks for chem-dcat-ap. Introduces a README (.github/README_for_versioning.md), new workflows (.github/workflows/handle-upstream-release.yaml, .github/workflows/check-schema-compatibility.yaml), and helper scripts (scripts/freeze_imports.py, scripts/should_update_latest.py, scripts/check_compatibility.py). Update deploy-docs.yaml to run a release-time freeze, conditionally promote the 'latest' alias using should_update_latest.py, and adjust action/setup versions. The changes automate freezing upstream dcat-ap-plus imports at release, open freeze PRs on upstream releases, and publish a weekly compatibility badge and matrix to gh-pages to detect and notify about broken upstream dependencies.
|
Could you add a description what the scripts/CI jobs should exactly do or specify the outcomes you exactly expect. That would help me to give more concrete feedback. |
There was a problem hiding this comment.
@dalito, sorry for the AI slope in this file, but I think this is the document you would want to read.
If you'd like a more concise document, I'll write it this evening.
|
The main Idea is to get versions of chem-dcat-ap, which do not reference dcat-ap+ latest, when they are released, but rather versions that have fixed dependencies based on the last compatible version:
To achieve this, the deploy-docs.yaml was extended, and a Python script "freeze_imports.py" was implemented in order to overwrite the "latest" to the specific version, here v0.1.0. Since this tooling would not be as valuable, if we don't get updates, when there are changes in the parent repo, such that we need to freeze the child repo (here chem-dcat-ap), I also implemented a GitHub action "check-schema-compatibility.yaml" Which checks for compatibility issues and automatically makes a PR which reminds us to freeze/publish the latest compatible version with the old DCAT-AP+ version. I also implemented a small badge |
|
While writing the docs, I realized that it is actually only What do you think? |
|
Sounds good. Right now, there are still minor issues with my code, because I still missed some use cases (the current tooling always assumes that you want to be compatible with the "latest" schema, at the time of publishing, and therefore only replaces "latest" with the schema version, which is, of course, not always intended) and might have some bugs in it. I would like David's general opinion on whether this is going in the right direction for what I want to do, or if I should implement it with other tools in mind. |
|
@HendrikBorgelt, I will check if we can use the semver tools (or similar) to automatically set the new versions (I do this for many of my files (toml, yaml) and it works quite smoothly. I stead of watching every day, consider an event based mechanism - to update the chem-dcat-ap repo on a change of the the dcat-ap-plus repo. This must exist. |
|
@HendrikBorgelt, |
this fixes some minor issues regarding the correct w3id import statements, implements a compatability md generation. The the new issue post for more details.
Hi Mark. |
|
Updated Issue description for this PR: Implement versioned sub-module imports and downstream freeze pipelineProblem statement
imports:
- chemical_entities_ap
- chemical_reaction_apBare imports carry no version information, so downstream schemas cannot determine which version of a sub-module was in use when a class was defined. The same problem applies to the upstream The inheritance chainEach arrow is a schema import. Unversioned imports anywhere in this chain make it impossible to reproduce validation results deterministically, or for downstream schemas to declare a stable dependency. What the freeze pipeline deliversAt release time, CI transforms the development-form schemas into fully version-pinned release artifacts. Source (on prefixes:
dcatapplus: https://w3id.org/nfdi-de/dcat-ap-plus/v0.3.0/
chemdcatap: https://w3id.org/nfdi-de/dcat-ap-plus/chemistry/
chemical_entities_ap: https://w3id.org/nfdi-de/dcat-ap-plus/chemistry/entity/
chemical_reaction_ap: https://w3id.org/nfdi-de/dcat-ap-plus/chemistry/reaction/
imports:
- dcatapplus:schema/dcat_ap_plus
- chemical_entities_ap
- chemical_reaction_apReleased artifact (on GitHub Pages / w3id.org, at prefixes:
dcatapplus: https://w3id.org/nfdi-de/dcat-ap-plus/v0.3.0/
chemdcatap: https://w3id.org/nfdi-de/dcat-ap-plus/chemistry/v0.3.0/
chemical_entities_ap: https://w3id.org/nfdi-de/dcat-ap-plus/chemistry/entity/v0.3.0/
chemical_reaction_ap: https://w3id.org/nfdi-de/dcat-ap-plus/chemistry/reaction/v0.3.0/
imports:
- dcatapplus:schema/dcat_ap_plus
- chemical_entities_ap:schema/chemical_entities_ap
- chemical_reaction_ap:schema/chemical_reaction_apEach sub-schema import resolves via its own prefix to the correct versioned w3id path. Note: The How the test repo differsThe test repo ( Example of a frozen test-repo artifact: Two-phase pipelinePhase 1 — since we want to make sure the schema is technically valid, we should do regular testing before the schema is transfered to the github pages. However since the test would run into a chicken and the egg problem, where it can't validate a schema published on the github pages, since it hasn't validated that it is correct, and thereby has not transfered those schemas to github, we need to do local testing. We can assume that the freezing of the import statements should not cause any issues, therefore testing the correctness of the schema can be tested with local imports.
Phase 2 — Since we don't want to introduce an errors with the freezing of the import statements, a post publishing validation is executed here. This is done in a "test" branch, where the schemas can be loaded into and are tested with the respective w3ids artefacts in place on the github pages.
New workflowsThree new or significantly changed workflow files are introduced.
|


This PR should implement version freezing for Chem-dcat-ap's LinkML Schema, as well as implement warning messages and compatability checks for existing versions.
The scripts were developed and tested in two seperate test repos:
The scripts should be "plug and play" and should use the corecct w3id import uri's.
@dalito, I still need to make a "double check" and review the code again. However, since you might be more familiar with some of the just and uv commands, It would be nice if you can have a look over the scripts.