这是indexloc提供的服务,不要输入任何密码
Skip to content

Not able to configure inputs to include ignored/ untracked files #1308

@gabrielgrijincu

Description

@gabrielgrijincu

What version of Turborepo are you using?

1.2.9

What package manager are you using / does the bug impact?

Yarn v1

What operating system are you using?

Mac

Describe the Bug

An app I'm working on relies on dynamically generated API client and while this is a blast, we don't really want the generated files to be checked into git for several reasons (CI with type checking based on fresh generated APIs, clearer and more concise PRs without clutter due to generated code etc.).

However, if I add an ignored folder to inputs, it won't trigger the cache miss. After some digging, I found out that turbo actually pipes the inputs directly to git ls-files which isn't listing any of the ignored files.

One of the steps for what constitutes a cache hit vs. miss for a given task states the following:

Hash the contents of all not-gitignored files in the package folder or the files matching the inputs globs, if present

This led me to believe that no gitignored files are taken into consideration when hashing unless those files are specified in inputs. I think this should be documented more clearly if this is not the expected behaviour.

Expected Behavior

Take gitignored files into consideration when hashing, or add some other option for this kind of files.

To Reproduce

Let's say we have this .gitignore file:

packages/api/src/generated

And this turbo.json file:

{
  "pipeline": {
    "build": {
      "cache": true,
      "dependsOn": ["^build"],
      "outputs": ["dist/**"],
      "inputs": ["src/**/*.ts", "src/generated/**/*"]
    }
  }
}

When running turbo run build, hashing is not influenced by these generated files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions