-
Notifications
You must be signed in to change notification settings - Fork 29
Add weekly LinkML toolkit compatibility check #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,120 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Weekly compatibility test against the linkml toolkit | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This workflow checks out the linkml toolkit and runs gen-project against | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # the metamodel to ensure compatibility. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: LinkML Toolkit Compatibility | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| UV_VERSION: "0.7.13" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| schedule: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Run every Monday at 10:00 UTC (1 hour after linkml's metamodel check) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - cron: "0 10 * * 1" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| linkml-compat: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| defaults: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Check out linkml-model repository | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4.2.2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Check out linkml toolkit | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4.2.2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repository: linkml/linkml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: linkml-toolkit | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install uv | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: astral-sh/setup-uv@v7.2.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| version: ${{ env.UV_VERSION }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enable-cache: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v5.6.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+23
to
+38
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4.2.2 | |
| - name: Check out linkml toolkit | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| repository: linkml/linkml | |
| path: linkml-toolkit | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7.2.0 | |
| with: | |
| version: ${{ env.UV_VERSION }} | |
| enable-cache: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5.6.0 | |
| uses: actions/checkout@v6.0.2 | |
| - name: Check out linkml toolkit | |
| uses: actions/checkout@v6.0.2 | |
| with: | |
| repository: linkml/linkml | |
| path: linkml-toolkit | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7.3.0 | |
| with: | |
| version: ${{ env.UV_VERSION }} | |
| enable-cache: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v6.2.0 |
Copilot
AI
Apr 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gen-project is invoked without the repo’s gen_project_config.yaml, but this repository’s Makefile consistently runs gen-project with that config (which also excludes some generators like python and markdown). Running without the config may introduce failures unrelated to compatibility (extra generators, different output layout) and makes the output verification brittle. Consider using the same config file as the repo’s normal generation path, and if you want to validate Python output too, run the repo’s gen-python --genmeta step separately rather than assuming gen-project will emit meta.py.
| uv run gen-project ../linkml_model/model/schema/meta.yaml -d ../output 2>&1 | tee ../genproject_output.txt | |
| - name: Verify key outputs were generated | |
| id: verify_outputs | |
| run: | | |
| MISSING="" | |
| # Python files go in root, others in subdirectories (per GEN_MAP in projectgen.py) | |
| uv run gen-project --config-file ../gen_project_config.yaml ../linkml_model/model/schema/meta.yaml -d ../output 2>&1 | tee ../genproject_output.txt | |
| - name: Run gen-python --genmeta against metamodel | |
| id: run_genpython | |
| working-directory: linkml-toolkit | |
| run: | | |
| uv run gen-python --genmeta ../linkml_model/model/schema/meta.yaml > ../output/meta.py | |
| - name: Verify key outputs were generated | |
| id: verify_outputs | |
| run: | | |
| MISSING="" | |
| # meta.py is generated separately via gen-python --genmeta; the remaining files come from gen-project. |
Copilot
AI
Apr 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output checks hard-code output/meta.py, but in this repo the documented generation flow produces Python files via separate gen-python calls (see Makefile), and gen_project_config.yaml explicitly excludes the python generator. As written, this check can either (a) fail even when gen-project succeeded (if using the repo config), or (b) pass while diverging from the repo’s actual build artifacts. Adjust the verification list to match the outputs that are actually expected from the chosen generation command(s).
Copilot
AI
Apr 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The failure handler always does tail -n 100 genproject_output.txt, but that file is only created by the gen-project step. If the workflow fails earlier (e.g., checkout/uv sync/Graphviz), this tail will fail and prevent the issue from being created/updated. Consider guarding for a missing log file (fallback message), or narrowing the if: condition so this step runs only when the gen-project step actually executed.
| LOG_OUTPUT=$(tail -n 100 genproject_output.txt) | |
| if [ -f genproject_output.txt ]; then | |
| LOG_OUTPUT=$(tail -n 100 genproject_output.txt) | |
| else | |
| LOG_OUTPUT="genproject_output.txt was not created. The workflow likely failed before the gen-project step ran." | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This job uses
gh issue .../gh label ...to create and update issues/labels, but the workflow doesn't declare anypermissions:. In repositories with restricted default GITHUB_TOKEN permissions, these steps will fail (especially label creation and issue commenting). Consider explicitly setting job permissions (e.g.,contents: readandissues: write) so scheduled/manual runs can reliably file/update the tracking issue.