....Support Globs in save_cache

Hey, instead of avoidance, maybe just answer the question I linked.

It’s pretty clear what the question is.

  1. it’s on the title you closed.
  2. it’s in the post comment i linked.

Obviously it needs to be repeated here again, so I’ll link it again and copy paste the question here.

Question: (which is in the title) Support Globs in save_cache

@brmenchl said

Is this something available for save_cache as well? We’re using Yarn Workspaces, and could have large number of node_modules directories to cache.

Everything that takes a list of paths as parameters should also accept globs instead.

so what is the roadmap to supporting this circleci?

@zeno.at.reckon I appreciate that it’s inconvenient to make a new post. We want to have as many details in the topic as possible, so that anyone who wants to help has all the info in one post. Please try to be respectful of decisions made by moderators and admins.

I’ll check with the team to see if anyone has advice for your question here.

Sorry to hear about your frustrations with the lack of glob support in save_cache. I’ve worked on some projects with massive amounts of dependencies and I feel your pain.

To be completely upfront with you, CircleCI does not currently support globs on save_cache. We do have a fairly popular feature request about that here:

https://ideas.circleci.com/cloud-feature-requests/p/support-wildcards-in-savecachepaths

I would strongly encourage you to add a vote there, and even include your use-case about why this is feature is valuable to you. Our product team actively monitors that and I’m going to forward that to them for review as well. I am not aware of any immediate near-term plans to include this feature, but I can say that we are constantly modifying our feature roadmap from customer feedback.

One thing that would probably be great to address in a comment to that feature request would be the alternative of specifying a particular workspace to cache:

- save_cache:
    key: v1-{{ checksum yark.lock }}
    paths:
      - node_modules/workspace-a
      - node_modules/workspace-c

I didn’t want to suggest that as an alternative because it seems like you already know this will not work for your use-case. I only bring it up so that you can include a comment there that will help our product team understand why that alternative will not work for customers such as yourself.

Eh… look. If you want valuable knowledge here, then make it easy for people to provide it.

I could have just added my original concerns to that linked forum post… it was entirely the most relevant place to do it. Instead I’m forced to start a new post, which you closed. o.O

thumbs up

Yeah, thanks for the reply, but anything short of globs just isn’t going to be sustainable.

We have a monorepo with many packages as react-native apps and many custom components as packages.

1 Like