Skip to content

[Bug]: lage ignore globs don't work on info command if untracked files are present #26147

@Hotell

Description

@Hotell

Library

all

Are you reporting Accessibility issue?

no

Reproduction

we have defined ignore globs within lage.config.js

  1. change anything in file matching one of those globs, lets say add comment to .github/CODEOWNERS
  2. create untracked file in repo root -> touch foo.txt
  3. stage codeowners change: git add .github/CODEOWNERS. (dont stage untracked foo.txt ! )
  4. run yarn lage info --since master
  5. this will output all monorepo packages 🚨🚨🚨

Bug Description

Actual Behavior

ignore doesn't work properly if there are untracked files present in repo root

Expected Behavior

ignore works as expected if untracked files are present. if there are no candidates IMO returning all workspace packages as affected is wrong/confusing.

Why is this happening

lage uses workspace-tools under the hood which has hardcoded true flag to return all packages if no candidate package is being returned. This bug was introduced in this PR https://github.com/microsoft/workspace-tools/pull/105/files#diff-45e9ef10fc7a91e55ef79733fe0ebb8939b7b913f7624e43ff250f913596964fR74

Requested priority

Normal

Products/sites affected

whole monorepo

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions