You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
affected -t build --files=packages/foo/src/index.ts yields no output
Expected Behavior
The above command should yield package foo
GitHub Repo
n/a
Steps to Reproduce
n/a
You can reproduce, but see below conversation. This behavior is traced.
Nx Report
19.7.2
Failure Logs
n/a
Package Manager Version
No response
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
Here's the scoop.
Suppose you have two types of packages:
package type foo, e.g. a generic node lib
package type bar
The {workspaceRoot}/.gitignore has:
# {workspaceRoot}/.gitignore
src/**
...in it, because 99% of your packages are bars. Imagine that bar packages are all codegen'd, so you don't want to track src. It seemed easier to to put this in the root ignore vs every per-package gitignore.
Now, imagine that packages/foo undoes that root gitignore with:
# {workspaceRoot}/packages/foo/.gitignore
!src/**
Now, try doing affected --files=packages/foo/src/some/modue.ts. Bummer, affected says that foo is not affected!
Current Behavior
affected -t build --files=packages/foo/src/index.ts
yields no outputExpected Behavior
The above command should yield package
foo
GitHub Repo
n/a
Steps to Reproduce
n/a
You can reproduce, but see below conversation. This behavior is traced.
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
Here's the scoop.
Suppose you have two types of packages:
foo
, e.g. a generic node libbar
The
{workspaceRoot}/.gitignore
has:...in it, because 99% of your packages are
bar
s. Imagine thatbar
packages are all codegen'd, so you don't want to tracksrc
. It seemed easier to to put this in the root ignore vs every per-package gitignore.Now, imagine that
packages/foo
undoes that root gitignore with:Now, try doing
affected --files=packages/foo/src/some/modue.ts
. Bummer, affected says thatfoo
is not affected!TLDR: https://github.com/nrwl/nx/blob/b6140d459020847818b738ddc17e52c069657893/packages/nx/src/project-graph/file-utils.ts#L67C12-L67C27 does not consider package gitignores, thus incorrectly computes affected.
Discussion:
The text was updated successfully, but these errors were encountered: