Cannot include yaml fragments in junction elements
- Dominant language
- Python
- Stars
- 140
- Forks
- 45
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
[See original issue on GitLab](https://gitlab.com/BuildStream/buildstream/-/issues/1370)
In GitLab by [[Gitlab user @tristanvb]](https://gitlab.com/tristanvb) on Jul 21, 2020, 11:25
Currently we have an undocumented limitation, which is that we fail to expand `(@)` files when these are declared inside a junction element.
This is not mentioned in the [include documentation](https://docs.buildstream.build/master/format_intro.html#include) or in the [junction documentation](https://docs.buildstream.build/master/elements/junction.html).
While it is possible to end up in unresolvable situations by allowing includes in junctions, it is perfectly possible to allow, we just need to have the correct early stage `LoadError`s in place if ever an include leads to a circular reference into the same project that the given junction is loading. This error is already probably accounted for by `LoadErrorReason.CIRCULAR_REFERENCE` which is checked for and raised in the `Loader.get_loader()` API.
In the worst case, we need to document this as unsupported, but I think we should support this.
Contributor guide
Research direction
Start with the loader path for expanding (@) files inside junction elements and read Loader.get_loader(), including its LoadErrorReason.CIRCULAR_REFERENCE handling. Determine whether junction-local includes can be supported without circular references; otherwise update the include and junction documentation to state the limitation. Done means the behavior is supported with early LoadErrors or clearly documented as unsupported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100