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

feat(core): support nested ignore files #10455

Merged
merged 2 commits into from Jun 10, 2022

Conversation

blaugold
Copy link
Contributor

This change adds support for ignore files (.gitignore and .nxignore)
at any level, not just the workspace root. Previously those files were not
taken into account.

Code to evaluate ignore files was repeated multiple times throughout the
codebase and has been refactor into a utility module.

Closes #10442

@nx-cloud
Copy link

nx-cloud bot commented May 24, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit b36e1a6. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 12 targets

Sent with 💌 from NxCloud.

@vercel
Copy link

vercel bot commented May 24, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
nx-dev ⬜️ Ignored (Inspect) Jun 8, 2022 at 10:06PM (UTC)

Copy link
Member

@AgentEnder AgentEnder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution 🎉. This is something we've been meaning to tackle, as evidenced by the TODO comments you were able to remove.

Overall, this looks great! I left a few comments of things that can be tidied up.

packages/devkit/index.ts Outdated Show resolved Hide resolved
packages/nx/src/utils/ignore.spec.ts Outdated Show resolved Hide resolved
packages/nx/src/utils/ignore.spec.ts Outdated Show resolved Hide resolved
packages/nx/src/utils/ignore.ts Outdated Show resolved Hide resolved
packages/nx/src/utils/ignore.ts Outdated Show resolved Hide resolved
packages/nx/src/utils/ignore.ts Outdated Show resolved Hide resolved
packages/nx/src/utils/ignore.ts Outdated Show resolved Hide resolved
packages/nx/src/utils/ignore.ts Outdated Show resolved Hide resolved
packages/nx/src/utils/ignore.ts Outdated Show resolved Hide resolved
@AgentEnder AgentEnder self-assigned this Jun 7, 2022
This change adds support for ignore files (`.gitignore` and `.nxignore`)
at any level, not just the workspace root. Previously those files were not
taken into account.

Code to evaluate ignore files was repeated multiple times throughout the
codebase and has been refactor into a utility module.

Closes nrwl#10442
@AgentEnder AgentEnder merged commit 36d8ee2 into nrwl:master Jun 10, 2022
@AgentEnder
Copy link
Member

@blaugold We decided to revert the exposure of these methods in @nrwl/devkit for the time being. I understand the use-case for Nx plugins, and will likely use some of the functionality in nx-dotnet myself, but we may touch up this functionality a bit in the near future and don't want to push it as a public api just yet.

Plugins that wish to do so may deep import it, but there are no guarantees that the API will remain stable yet.

Feel free to reach out directly on the community slack if you'd like to talk through this a bit more. Thanks for the contribution 🎉

@blaugold
Copy link
Contributor Author

Thanks for the update. That's fine by me. I'm happy the PR got merged, and my main issue is resolved.

@AgentEnder
Copy link
Member

@blaugold Actually, this introduced a degradation to core performance that we need to correct before it goes live. @FrozenPandaz and I will work on re-applying this PR at some point in the near future, for now @vsavkin is going to roll it back to avoid the perf hit.

vsavkin added a commit to vsavkin/nx that referenced this pull request Jun 13, 2022
FrozenPandaz added a commit to FrozenPandaz/nx that referenced this pull request Jun 13, 2022
FrozenPandaz added a commit that referenced this pull request Jun 13, 2022
wittjosiah added a commit to dxos/dxos that referenced this pull request Nov 22, 2022
This does actually seem to resolve the caching issue.

There's a closed Nx issue about this
nrwl/nx#10442 and a merged PR
nrwl/nx#10455, however the PR was later reverted
nrwl/nx#10455 (comment) and does
not seem to have been fixed again yet as far as I can tell.

I've left a note on the original issue that I think it should be
re-opened.
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

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

Successfully merging this pull request may close these issues.

Hash computation does not take .gitignore in nested directory into account
2 participants