-
Notifications
You must be signed in to change notification settings - Fork 621
Enhance cache-dependency-path handling to support files outside the workspace root #1128
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
base: main
Are you sure you want to change the base?
Enhance cache-dependency-path handling to support files outside the workspace root #1128
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Enhance the cacheDependencies
action to support dependency files located outside the workspace by copying them into the workspace root before caching.
- Exported
cacheDependencies
and added logic to resolve, copy, and log external dependency files. - Updated documentation to note support for external paths.
- Added unit tests covering file copying, missing file warnings, and copy errors.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/setup-python.ts | Exported cacheDependencies , added resolution and copy logic for external cache-dependency-path . |
docs/advanced-usage.md | Added note about external-path support for cache-dependency-path . |
tests/setup-python.test.ts | Added tests for copying dependencies, missing files, copy failures, and skipping when no input. |
Comments suppressed due to low confidence (2)
src/setup-python.ts:67
- The code computes
resolvedDependencyPath
but still passes the originalcacheDependencyPath
togetCacheDistributor
, so the distributor won’t use the copied file location. Consider passingresolvedDependencyPath
(or falling back tocacheDependencyPath
) as the dependency-path argument.
const cacheDistributor = getCacheDistributor(
tests/setup-python.test.ts:59
- Add a test case for when
cache-dependency-path
points to a file already inside the workspace (sourcePath === targetPath
) to ensure the logic skips copying but still sets the resolved path correctly.
it('copies the dependency file and resolves the path with directory structure', async () => {
Description:
This PR enhances cacheDependencies in setup-python to properly handle cases where the cache-dependency-path file is located outside the workspace root also.
Related issue:
#476
#361
Check list:
[ X ] Mark if documentation changes are required.
[ X ] Mark if tests were added or updated to cover the changes.