Skip to content

Validate each crate after writing it - #28

Open
faizollah wants to merge 2 commits into
mainfrom
14-validate-after-build
Open

faizollah wants to merge 2 commits into
mainfrom
14-validate-after-build

Conversation

@faizollah

Copy link
Copy Markdown
Collaborator

Closes #14

After writing the crate, FLCrateTracker now checks it with rocrate-validator against RO-Crate 1.2 and Process Run Crate 0.6, and logs what it finds, with a hint when the user's settings can fix a problem:

WARNING flwrcrate: rocrate-validator found 1 problem(s) with the RO-Crate in .../flwrcrate-ro-crate (required level):
  - The Root Data Entity MUST have a `license` property (as specified by schema.org). [ro-crate-1.2_13.3, on ./]
    To fix: Pass license=... to FLCrateTracker, e.g. license="http://spdx.org/licenses/MIT".
  • Optional extra: validation runs only when flwrcrate[validate] is installed (roc-validator >= 0.14, the first with a Process Run Crate 0.6 profile). Without it, nothing changes.
  • Never breaks a run: the crate is already written, so problems and validator errors are only logged.
  • Levels: validation="required" (default), "recommended" to also list suggestions while developing, or None to turn it off.
  • Profiles: RO-Crate 1.2, plus Process Run Crate 0.6, the version our crates declare. 0.6 also inherits RO-Crate 1.3 checks that a 1.2 crate can't meet, so only its own checks are reported, as we did with 0.5. The tests and the e2e script move to 0.6 too.
  • Online first, then offline: a 5-second check first sees whether the RO-Crate context can be fetched. If so, the validator runs online and fills its cache; if not, it validates from the cache. The validator sets no timeouts, so without this check it hung for over 4 minutes on a network that drops packets. With no network and an empty cache, it says it couldn't validate, and how to fill the cache, rather than calling the crate invalid.
  • CI: the e2e installs .[validate] alongside Flower, fills the cache before the run, and checks the ServerApp's log to confirm the crate was validated after a real Flower run.
  • Lock file: the second commit moves the dev lock to Flower 1.45 (rich 14), which roc-validator 0.14 now allows.

With the new validate extra installed, FLCrateTracker checks each crate with rocrate-validator (RO-Crate 1.2 and Process Run Crate 0.6) right after writing it and logs problems with hints on how to fix them, without ever raising. It validates online when a 5-second check can reach the RO-Crate context, since the validator has no timeouts, and otherwise from the validator's cache. validation= sets the level or turns it off. CI drops the separate validator environment and retries the cache warm-up, and the e2e checks the crate was validated after the run.
roc-validator 0.14 allows rich 14, so the lock no longer has to keep Flower at 1.31.
@faizollah
faizollah requested a review from elichad December 3, 2026 15:59
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.

Use rocrate-validator to validate the crate after generating it

1 participant