-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Describe the Bug
The documented format for specifying a subdirectory pinned to git-ref in a git data source:
github.com/<org>/<repo>.git?ref=<reference>//<path> - See documentation
does not work correctly.
Instead of loading only <path>, Conforma loads the entire repository root.
This causes silent data loading failures when the root contains YAML files incompatible with OPA's data model.
Expected Behavior
- When using this format:
github.com/release-engineering/rhtap-ec-policy.git?ref=dd1a3dd1bf2299e1da9936b89e7279b6ab443bec//datawe should get only thedatafolder - No merge errors
Actual Behavior
When we used github.com/release-engineering/rhtap-ec-policy.git?ref=dd1a3dd1bf2299e1da9936b89e7279b6ab443bec//data
We encountered 3 merge errors during loading:
Error: load documents: 3 errors occurred during loading:
- .github/workflows/update_rpm_repositories.yaml: merge error ...
- policy.yaml: merge error
The files in the error (.github/workflows/ and policy.yaml) are at the repository root, not inside data/. Only data/ was requested.
Workaround
Placing //path before ?ref= resolves the issue:
github.com/<org>/<repo>.git//data?ref=dd1a3dd1bf2299e1da9936b89e7279b6ab443bec
See example
Possible Solution
Either:
- Update the documentation or
- Fix the bug if its actually a bug