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.
Bug Fix: Path Resolution for Local File System Imports
TL;DR
The key change was making sure we use the import location as our "starting point" when figuring out where to put files, regardless of whether we're importing from local files or git.
Issue
The export command was failing for local filesystem imports while working correctly for git imports. When using local filesystem imports, relative output paths were incorrectly resolved, causing errors when trying to export to paths outside the context directory.
For example, this local filesystem import failed:
With error:
While the equivalent git import worked as expected:
Root Cause
The path resolution logic for local filesystem imports was not implementing the same correct behavior as git imports. Local filesystem imports were incorrectly using the current directory as the base for resolving relative paths.
Fix
Updated the local filesystem path resolution logic to match the correct behavior already implemented in git imports. The path is now properly resolved as
../apivendor/package/project/common
for both import types.