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

.nxignore is not respected when ignoring nx.json or tsconfig.*.json #3897

Closed
yharaskrik opened this issue Oct 9, 2020 · 3 comments
Closed
Assignees
Labels

Comments

@yharaskrik
Copy link
Contributor

Current Behavior

When I add the following to the .nxignore file in the root of the project

nx.json
tsconfig.json

If I run testing (or building, any cacheable operator) for a library/app and then change a change in one of those files (say, generating a new library), the cache is busted for the prior operation.

Expected Behavior

I would expect that generating a library (ie. changing nx.json or tsconfig.json) should not bust the cache for unaffected libraries/apps, unless the newly generated library is used in that lib/app in which case the code would have actually been affected.

Steps to Reproduce

I tried it in my repo (on Nx 9.7.0) and it didn't work so I generated a brand new workspace with npx create-nx-workspace@latest (Nx v10.3.0) and tried it, same problem.

Steps:
Choose Ng + Nest workspace with Ng CLI
Do not enable cloud caching (but still use local caching)
add nx.json and tsconfig.json to .nxignore (will need to create the file)
Run tests on api-interfaces
Run tests on api-interfaces (this one pulls from cache)
Generate a new library
Run tests on api-interfaces (does not pull from cache)

Environment

Fresh workspace

nx : Not Found
  @nrwl/angular : 10.3.0
  @nrwl/cli : 10.3.0
  @nrwl/cypress : 10.3.0
  @nrwl/eslint-plugin-nx : 10.3.0
  @nrwl/express : Not Found
  @nrwl/jest : 10.3.0
  @nrwl/linter : 10.3.0
  @nrwl/nest : 10.3.0
  @nrwl/next : Not Found
  @nrwl/node : 10.3.0
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 10.3.0
  @nrwl/web : Not Found
  @nrwl/workspace : 10.3.0
  typescript : 4.0.3

And My Workspace

@nrwl/angular : 9.7.0
  @nrwl/cli : 9.7.0
  @nrwl/cypress : 9.7.0
  @nrwl/eslint-plugin-nx : Not Found
  @nrwl/express : 9.7.0
  @nrwl/jest : 9.7.0
  @nrwl/linter : 9.7.0
  @nrwl/nest : 9.7.0
  @nrwl/next : Not Found
  @nrwl/node : 9.7.0
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 9.7.0
  @nrwl/web : Not Found
  @nrwl/workspace : 9.7.0
  typescript : 3.8.3
@vsavkin vsavkin added the scope: core core nx functionality label Oct 9, 2020
@vsavkin vsavkin self-assigned this Oct 9, 2020
@yharaskrik
Copy link
Contributor Author

To note: it seems as though .nxignore is correctly ignore when using commands like affected:libs but when the cache key is computed for a library I don't think they are being ignored.

@vsavkin
Copy link
Member

vsavkin commented Nov 10, 2020

We chatted here #3942 and concluded that the solution is to provide more intelligent hashing of nx.json, tsconfig.json and workspace.json. So I'm going to close this issue.

@vsavkin vsavkin closed this as completed Nov 10, 2020
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants