Skip to content

Bring in changes from upstream v0.11.2#127

Open
elichad wants to merge 356 commits into
developfrom
upstream-develop
Open

Bring in changes from upstream v0.11.2#127
elichad wants to merge 356 commits into
developfrom
upstream-develop

Conversation

@elichad

@elichad elichad commented Jul 10, 2026

Copy link
Copy Markdown

This PR has just the upstream changes; expecting to see test failures & merge conflicts

edit: now merged with our develop & conflicts resolved

kikkomep added 30 commits April 16, 2026 23:33
kikkomep added 19 commits June 16, 2026 16:10
…e 1.2 checkers

- Reorder imports consistently (stdlib → third-party → local)
- Extract helper methods (_resolve_cite_as_url, _not_downloadable_message,
  _needs_sddatepublished_check, _check_entity_local_path, _check_distribution)
- Replace try/except/pass with contextlib.suppress
- Flatten nested conditionals with combined guards
- Use e!s over str(e) in f-strings
- Normalize quote style and multi-line formatting
…t-ci-precommit

♻️ refactor: address code quality issues
feat(ro-crate-1.2): introduce validation profile for RO-Crate 1.2
-  certifi (2026.5.20 -> 2026.6.17)
-  mistune (3.2.1 -> 3.3.2)
-  msgpack (1.2.0 -> 1.2.1)
-  coverage (7.14.1 -> 7.14.3)
-  prettytable (3.17.0 -> 3.18.0)
-  pytest (9.1.0 -> 9.1.1)
-  virtualenv (21.5.0 -> 21.5.1)
-  ruff (0.15.17 -> 0.15.19)
Add an abort mechanism to the validation framework so a check can stop the
whole run when the metadata is unreadable (e.g. the file descriptor is not
valid JSON), instead of letting later checks emit false positives.
…lidation

Make the "File Descriptor JSON format" check (RO-Crate 1.1 and 1.2) catch
JSONDecodeError explicitly: report a precise issue with the parse error
message and line/column, then call context.abort_validation() so no metadata
is read and downstream checks don't emit false positives.
…on-abort

feat(validation): ✨ abort validation when the file descriptor is not valid JSON
Set `path_type=Path` on the `--output-file` click option so the value is parsed as a `pathlib.Path` instead of a plain string, ensuring consistent path handling.
fix(cli): 🐛 write validation report to --output-file (crs4#182)
@elichad elichad marked this pull request as draft July 10, 2026 12:57
@elichad elichad force-pushed the upstream-develop branch from a1b7b67 to 1c6b29e Compare July 10, 2026 14:11
Comment thread tests/shared.py
json.dump(rocrate, f)
if rocrate_entity_mod_sparql is not None:
rocrate_graph = load_graph_and_preserve_relative_ids(rocrate)
if _uses_https_schema(rocrate_graph):

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code smell - don't think we expect to have https schema in crates at all

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EttoreM do you think it'd be safe to remove this _uses_https_schema function as part of #126 ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was introduced to mirror the fact that in the upstream RO-Crate 1.2 material there are explicit guards for both http://schema.org/ and https://schema.org/.

For example, in rocrate_validator/profiles/ro-crate/1.2/must/6_contextual_entity_metadata.ttl lines 65-66 we have:

FILTER(!STRSTARTS(STR(?this), "http://schema.org/"))
FILTER(!STRSTARTS(STR(?this), "https://schem

Similarly in rocrate_validator/profiles/ro-crate/1.2/should/0_entity_metadata.ttl lines 40-41.

It may be safe to remove the function but I'd rather keep it in order to maintain consistency on these guards across the codebase.

What do you think @elichad ?

@EttoreM

EttoreM commented Jul 13, 2026

Copy link
Copy Markdown

Hi @elichad.

Not sure what you mean by "edit: now merged with our develop & conflicts resolved" in the description of this PR, as the PR is still open and with the expected test fails.

Is this PR ready to be merged, before we proceed with the fixes needed to integrate our five-safes work with the upstream changes?

@elichad

elichad commented Jul 13, 2026

Copy link
Copy Markdown
Author

Not sure what you mean by "edit: now merged with our develop & conflicts resolved" in the description of this PR, as the PR is still open and with the expected test fails.

I meant that I have merged our develop branch into this PR.

Is this PR ready to be merged, before we proceed with the fixes needed to integrate our five-safes work with the upstream changes?

I need to check that we only see test failures in our five-safes work before merging - in order to check this I'm going to briefly change the CI workflow so the tests don't depend on the linting. I'll change it back before merging.

@elichad

elichad commented Jul 13, 2026

Copy link
Copy Markdown
Author

I am pleasantly surprised to see all the tests passing (except linting) - looks like all the upstream refactoring doesn't have a major impact on us. I'll revert my CI changes and then I think we're good to merge this PR (and live with the CI failing until #126 is done).

@elichad elichad marked this pull request as ready for review July 13, 2026 12:56
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.

3 participants