feat(ingest/lookml): correctly handle include directives from imported projects #7798
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The issue
When processing this situation: Base Project file -> includes External Project file A -> includes External Project file B, the second include directive was not being processed correctly. This was because we were looking for file B's include path in the base project rather than realizing that file A was in the external project and hence internal links should stay within the External Project.
How does this PR solve it?
We properly retain the context of a file so that we can process its includes correctly. We're doing that by deriving
base_folder
(now calledresolved_project_folder
) from the activeproject_name
+ any include directives.What else is happening?
base_folder
from thebase_projects_folder
and the activeproject_name
, we can remove thebase_folder
arg from the include resolver.//
). I'm adding some edge case handling to process that correctly. To do that, we need the name of the base/root projectroot_project_name
(if one exists), so we also do the plumbing to pipe that info into the include resolver.Checklist