Skip to content

fix: workflow chain broken — qc silent, release hardcoded, docs over-…#20

Merged
ThHanke merged 1 commit into
mainfrom
fix/workflow-chain-artifacts-docs
Apr 17, 2026
Merged

fix: workflow chain broken — qc silent, release hardcoded, docs over-…#20
ThHanke merged 1 commit into
mainfrom
fix/workflow-chain-artifacts-docs

Conversation

@ThHanke
Copy link
Copy Markdown
Collaborator

@ThHanke ThHanke commented Apr 17, 2026

Summary

Three bugs discovered and verified in production on a downstream fork
(materialdigital/logistics-application-ontology). All three cause silent
failures — no error, just wrong behavior.


Bug 1 — qc.yml: build artifacts never committed (silent failure)

Root cause (two compounding issues):

  1. .gitignore contains src/ontology/log-base.*, src/ontology/log-full.*
    etc. — ODK default that assumes built artifacts are not tracked. But the
    workflow design requires them committed so release.yml and docs.yml
    can find them on the next run.

  2. The EndBug commit step uses a single git add call with all globs in one
    string. When src/ontology/*.json matches nothing (ODK does not produce
    JSON for all ontologies), git exits with fatal: pathspec did not match any files — aborting the entire staging command. Nothing is staged, so
    EndBug reports "Working tree clean. Nothing to commit." and succeeds — with
    zero files committed.

Effect: Every build silently discards its output. src/ontology/log-full.owl
stays permanently stale. release.yml stamps an outdated artifact.
docs.yml documents the wrong ontology state.

Fix:

  • Remove src/ontology/log-base.* / log-full.* / log-simple.* / log.owl
    / log.obo / log.json / log.db from .gitignore — built artifacts must
    be tracked.
  • Replace single EndBug git add call with per-glob git add || true so one
    missing pattern cannot abort the rest.

Bug 2 — release.yml: hardcoded ontology ID and base IRI

The stamp step hardcodes:

ONTBASE="https://w3id.org/pmd/log"
for f in src/ontology/log-full.owl src/ontology/log-base.owl ...

Any repo seeded with a different ontology ID will silently find no files to
stamp and produce a release with wrong or missing `owl:versionIRI`.

**Fix:** Read `id` and `uribase` from the ODK yaml at runtime using Python
(available in the ODK container). Discover artifact files with `find` instead
of hardcoded names — same pattern already used in `docs.yml`.

---

### Bug 3 — docs.yml: full Widoco build triggered on every push to main

`qc.yml` dispatches `trigger-docs` with no version payload after every build.
`docs.yml` runs a full Widoco build each time, publishing to gh-pages on every
commit. This wastes CI minutes and pollutes gh-pages with a `/latest/` directory
that duplicates `/dev/` and unnecessarily rebuilds the release index.

**Fix:** Branch on whether a version payload is present:
- **No version (qc trigger):** build Widoco → update `/dev/` only, skip versioned directory, skip index rebuild
- **Version present (release trigger):** build Widoco → create `/1.0.0/`, update `/dev/`, rebuild index

Release history on gh-pages is never touched by dev builds.

---

## Files changed

| File | Change |
|------|--------|
| `.gitignore` | Remove `src/ontology/log-*.owl/ttl/obo/json/db` ignore entries |
| `.github/workflows/qc.yml` | Fix commit step: per-glob `git add \|\| true` |
| `.github/workflows/release.yml` | Dynamic `ONTBASE` + `find` for artifacts via Python |
| `.github/workflows/docs.yml` | Skip versioned dir + index rebuild on dev builds |

## Verified

All fixes tested end-to-end on materialdigital/logistics-application-ontology main branch.
The qc build now correctly commits all built artifacts after each successful build.

@ThHanke ThHanke merged commit 8d15c39 into main Apr 17, 2026
1 of 2 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Ontology Quality Check

ROBOT Report

No issues found — all ROBOT report checks passed.

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