Skip to content

Recursive source globs handle hidden files inconsistently #2917

Description

@Napolitain

Description

After my PR introducing the optimized file-globbing path (#2884), Task now
matches hidden entries when a pattern takes that path and does not match them
when the pattern uses the fallback path.

I understand that not matching names beginning with . comes from traditional
Unix shell glob behavior, but it feels surprising that **/* does not mean
every file below that directory when it is used for Task sources.

This matters for caching. In my project, I had inputs beginning with . that I
expected to be matched. A familiar example would be .env: if it affects a
task and changes, I would expect the source fingerprint to change too. Whether
a file participates in the cache key should not depend on which internal
globbing path handles the pattern.

Exclusions can have the same inconsistency. An optimized inclusion can find a
hidden file that a fallback exclusion then fails to remove.

I see two possible directions:

  1. Restore the previous behavior by making the optimized path skip hidden
    entries.
  2. Go forward with recursive source globs including hidden entries consistently
    in both paths.

My preference is the second option. "Hidden" is mostly a naming and display
convention; it does not mean that a file cannot affect a task
. However, this
would intentionally change the older behavior, so I would appreciate input
before implementing it.

I have a tests-only draft that exercises both paths, including hidden files,
hidden directories, exclusions, and their effect on source fingerprint caching.

Version

nightly / main at 75b227e. The inconsistency was introduced by 9200d42
(#2884).

Operating system

Observed on Linux. The two globbing paths themselves are platform-independent.

Experiments Enabled

None.

AI assistance

I used Codex to help develop and validate the tests. I reviewed and understand
the changes and this report.

Activity

  1. trulede commented on Jul 14, 2026

    @trulede
    Contributor

    @Napolitain your PR broke the existing behaviour? There was another recent PR that did something with .gitignore files, perhaps that is a factor.

  2. added theissue type on Jul 14, 2026
  3. trulede commented on Jul 14, 2026

    @trulede
    Contributor

    @andreynering FYI this might cause a regression. But not sure.

  4. Napolitain commented on Jul 14, 2026

    @Napolitain
    ContributorAuthor

    @Napolitain your PR broke the existing behaviour? There was another recent PR that did something with .gitignore files, perhaps that is a factor.

    But note of the behavior, do we want a glob pattern to not ignore dotfiles ? If we don't want to match them, then it is a easy fix. We just need to ensure that is what we want.

  5. removed theissue type on Aug 2, 2026
  6. trulede commented on Aug 31, 2026

    @trulede
    Contributor

    Task is using a standard glob library which replicates a linux shell, and its behaving in the expected way.

    You can try **/.* or use shops dotglob globstar which would likely result in the desired behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions