Skip to content
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

Cache restore not working for glob paths #243

Open
sqsp-rwatkins opened this issue Mar 15, 2023 · 0 comments
Open

Cache restore not working for glob paths #243

sqsp-rwatkins opened this issue Mar 15, 2023 · 0 comments

Comments

@sqsp-rwatkins
Copy link

Describe the bug
When using glob paths on the mount value for directories, those directories aren't restored on subsequent pipeline runs

To Reproduce
Steps to reproduce the behavior:

  1. Using the following config
image: meltwater/drone-cache
settings:
  backend: gcs
  cache_key: [REDACTED]/{{ checksum "yarn.lock" }}
  json_key: [REDACTED]
  bucket: [REDACTED]
  region: [REDACTED]
  mount:
    - 'packages/app/node_modules'
    - 'packages/backend/node_modules'
    - 'node_modules'
    - 'plugins/**/node_modules'
  1. Use restore: true for the restore step and rebuild: true for the rebuild step

Expected behavior
All paths in plugins/**/node_modules will be restored on a subsequent pipeline run after the cache has been created/rebuilt

Update cache
The logs for the step that updates the cache indicate that the folders in the glob paths were successfully updated:

level=info name=drone-cache ts=2023-03-15T16:54:51.236145545Z caller=rebuilder.go:73 component=plugin component=rebuilder msg="rebuilding cache for directory" local=plugins/sqsp-annotations/node_modules remote=backstage/backstage/npm-modules/6278771a12b52f4d36aa67eff9bd2067/plugins/sqsp-annotations/node_modules
level=info name=drone-cache ts=2023-03-15T16:54:51.236157985Z caller=rebuilder.go:73 component=plugin component=rebuilder msg="rebuilding cache for directory" local=plugins/sqsp-drone/node_modules remote=backstage/backstage/npm-modules/6278771a12b52f4d36aa67eff9bd2067/plugins/sqsp-drone/node_modules
level=info name=drone-cache ts=2023-03-15T16:54:51.236176605Z caller=rebuilder.go:73 component=plugin component=rebuilder msg="rebuilding cache for directory" local=plugins/sqsp-github/node_modules remote=backstage/backstage/npm-modules/6278771a12b52f4d36aa67eff9bd2067/plugins/sqsp-github/node_modules

Restore cache
The logs for the step that restores the cache on a subsequent pipeline run do not contain any references to paths in plugins/**/node_modules. They only contain references to non glob paths included in the mount list.

Description
I have written a script that runs in a step following on from the restore cache step. It produces the following output:

'./plugins/sqsp-annotations/node_modules' not found, cannot restore from cache
'./plugins/sqsp-drone/node_modules' not found, cannot restore from cache
'./plugins/sqsp-github/node_modules' not found, cannot restore from cache

I have checked that indeed all paths in plugins/**/node_modules were not restored. This isn't an issue if I manually specify all paths in plugins/**/node_modules

Desktop (please complete the following information):
NA using drone with meltwater/drone-cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant