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

cached task overwrites modified top level files (that are outside of src/) #766

Open
harunurhan opened this issue Jun 26, 2024 · 4 comments
Labels
bug Something isn't working HIGH PRIORITY

Comments

@harunurhan
Copy link
Member

harunurhan commented Jun 26, 2024

Describe the bug

To Reproduce
Steps to reproduce the behavior:

  1. Define a package with a target and no inputs and outputs specified, and package needs to have some files under src/ folder and top level like jest.config.js
  2. Run the task once (so it's cached)
  3. Make a change to a top-level file
  4. Re-run the same task (it should be skipped)
  5. You will see that changes you made to the top level file are reverted after the cached/skipped task run. Observe that this isn't valid for files that starts with . like .eslintrc.js

Expected behavior

Cached task runs should not revert any changes by default. Although it can be worked around using inputs and outputs, it's a strange default behaviour.

Environment/Troubleshooting

@harunurhan
Copy link
Member Author

Strange thing is that if I specify input: ["*"], everything works correctly but I don't understand how * glob could be the fix here.

  • if <package>/src/foo.js changes, cache is invalidated (but HOW?)
  • if <package>/.foorc.js changes, cache is invalidated
  • if <package>/foo.js changes, cache is invalidated
  • If <packages>/dist/foo.js changes, cache is NOT invalidated (which is what I want but still strange)

@kenotron
Copy link
Member

kenotron commented Jan 20, 2025

I think the default behavior can be tweaked - I think in this case, output should subtract inputs from its tracking by default. I'm going to put a high priority label on this issue.

@kenotron kenotron added bug Something isn't working HIGH PRIORITY labels Jan 20, 2025
@kenotron
Copy link
Member

I really would appreciate a small mini-repro-repo that I can use to target a fix here.

@kenotron
Copy link
Member

kenotron commented Jan 23, 2025

https://github.com/kenotron/lage-bug-766

I cannot repro this issue...

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

No branches or pull requests

2 participants