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 created but ignored by default #202

Open
jprosevear opened this issue Dec 11, 2023 · 6 comments
Open

Cache created but ignored by default #202

jprosevear opened this issue Dec 11, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@jprosevear
Copy link

Orb version:

5.1.0

What happened:

Caching is turned on by default but not used by default because npm ci is used for installation

Expected behavior:

npm ci uses the cache that is restored

Additional Information:

@jprosevear jprosevear added the bug Something isn't working label Dec 11, 2023
@jdcoldsmith
Copy link

I second this issue. From what I have found in this stackoverflow question it seems that npm ci doesn't really benefit from cache and that is by its design. npm install is the command that takes advantage of cache but according to npm's documentation npm ci is the command that should be used in CI/CD environments.

Last month we stopped storing cache in CircleCI and we saw huge savings on our monthly bill in both reduced build minutes and storage costs.

I think caching should be disabled by default when using npm ci and that should be made clear in CircleCI's documentation that npm ci does not take advantage of cache. As the documentation for this orb stands, it gives the appearance that it will automatically handle caching for you and that will save you credits when in reality people using npm as their package manager end up paying more money with caching turned on.

@jdcoldsmith
Copy link

Any update on this? This feels at best like a bug that should be fixed soon and at worst CircleCI intentionally deceiving its clients to make more money.

@marboledacci
Copy link
Contributor

Thanks for the heads up, the new version https://circleci.com/developer/orbs/orb/circleci/node?version=6.1.0 is now ignoring cache when npm ci is used.

@tannerstern
Copy link

tannerstern commented Sep 4, 2024

When you say

the new version [...] is now ignoring cache when npm ci is used

does that mean that the orb is no longer trying to create a cache when using npm ci? We know that npm ci ignores any existing cache, but the issue here (beyond the documentation, which I see is now better) was that it was also creating a cache, which used up storage.

I'm just making sure I'm understanding you right.

@marboledacci
Copy link
Contributor

Yes, when npm ci is used it will ignore the caching functionality. No cache will be created, therefore no storage used.

@tannerstern
Copy link

Awesome, thanks @marboledacci!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants