Skip to content

labeler.yml's git ls-file <pattern> instruction give too lenient result #185494

Description

@hellohuanlin

Steps to reproduce

This instruction gives too lenient result.

# Use git ls-files '<pattern>' to see the list of matching files.

For example:

git ls-files 'dev/integration_tests/*macos*/**/*'

is supposed to print empty result, but instead, it print these files:

dev/integration_tests/channels/macos/Flutter/Flutter-Debug.xcconfig
dev/integration_tests/channels/macos/Flutter/Flutter-Release.xcconfig
dev/integration_tests/channels/macos/Runner.xcodeproj/project.pbxproj
dev/integration_tests/channels/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
dev/integration_tests/channels/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
dev/integration_tests/channels/macos/Runner.xcworkspace/contents.xcworkspacedata
dev/integration_tests/channels/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
dev/integration_tests/channels/macos/Runner/AppDelegate.swift

This is wrong - macos is not an immediate subfolder under dev/integration_tests, so it shouldn't match.

Fix:

Change the instruction to either:

git ls-files ':(glob)dev/integration_tests/*macos*/**/*'

Or just:

print -l dev/integration_tests/*macos*/**/*

I will put up a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    team-infraOwned by Infrastructure team

    Type

    No type
    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