Skip to content
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

IFC-592 Merge schemas when loading them from files #5482

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from

Conversation

gmazoyer
Copy link
Contributor

Fixes #4188

When loading multiple schemas files, they used to be imported one by one. With this change, the files are now parsed as schemas and then merged together in order to produce a single schema to load. The merge is performed one by one in the order of the files. This means that the schema coming last will overwrite the previous one if they refer to the same nodes.

@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Jan 16, 2025
Copy link

codspeed-hq bot commented Jan 16, 2025

CodSpeed Performance Report

Merging #5482 will not alter performance

Comparing gma-20240116-4188 (5ee44f8) with stable (9cf5f1f)

Summary

✅ 10 untouched benchmarks

@gmazoyer gmazoyer marked this pull request as ready for review January 16, 2025 09:48
@@ -41,6 +41,7 @@ Jinja2 = "^3"
gitpython = "^3"
pyyaml = "^6"
toml = "^0.10"
dulwich = "^0.21"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this needed? This is a dependency which is supposed to be on the Python SDK.

@gmazoyer gmazoyer changed the title Merge schemas when loaading them from files IFC-592 Merge schemas when loaading them from files Jan 16, 2025
@gmazoyer gmazoyer requested a review from a team January 16, 2025 09:57
Copy link
Contributor

@ogenstad ogenstad left a comment

Choose a reason for hiding this comment

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

LGTM, one comment though with this approach if we later want to provide detailed error reports if part os the payload is invalid it seems like it might get harder to indicate where the actual error is. We could of course show it against the combined schema. But we can perhaps cross that bridge when we get there.

@gmazoyer gmazoyer changed the title IFC-592 Merge schemas when loaading them from files IFC-592 Merge schemas when loading them from files Jan 16, 2025
When loading multiple schemas files, they used to be imported one by
one. With this change, the files are now parsed as schemas and then
merged together in order to produce a single schema to load. The merge
is performed one by one in the order of the files. This means that the
schema coming last will overwrite the previous one if they refer to the
same nodes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Failure when loading multiple YAML schema files with extensions
4 participants