Skip to content

fix: use pathlib.Path.glob to include dotfiles in output manifests#1039

Draft
crowecawcaw wants to merge 1 commit intoaws-deadline:mainlinefrom
crowecawcaw:fix/glob-dotfiles-consistency
Draft

fix: use pathlib.Path.glob to include dotfiles in output manifests#1039
crowecawcaw wants to merge 1 commit intoaws-deadline:mainlinefrom
crowecawcaw:fix/glob-dotfiles-consistency

Conversation

@crowecawcaw
Copy link
Copy Markdown
Contributor

What was the problem/requirement? (What/Why)

_match_files_with_pattern in _glob.py used glob.glob(), which silently excludes dotfiles and dot-directories. The worker output sync in asset_sync.py uses pathlib.Path.glob(), which includes them. This inconsistency meant files like .gtn/ and its contents would exist on disk but be missing from output manifests.

What was the solution? (How)

Replaced glob.glob() with pathlib.Path.glob() in _match_files_with_pattern so both code paths handle dotfiles consistently.

What is the impact of this change?

Output manifests generated via _glob_paths will now include dotfiles and files inside dot-directories. Users who were previously missing dotfiles in their synced outputs will now get them.

How was this change tested?

  • Have you run the unit tests?
  • Have you run the integration tests?
  • Have you made changes to the download or asset_sync modules? If so, then it is highly recommended
    that you ensure that the docker-based unit tests pass.

Added dotfile test fixtures (.dotfile, .hidden_dir/inside_hidden.txt) and two new test cases in test_glob.py: one verifying dotfiles are included by default, one verifying they can be excluded via patterns. Updated existing test counts to reflect the new fixtures.

Was this change documented?

  • No docstring changes needed — the function behavior now matches its documented intent ("all files matching the include and exclude expressions").
  • No README changes needed.

Does this PR introduce new dependencies?

  • This PR does not add any new dependencies.

Is this a breaking change?

No. This is a bugfix. Output manifests will now include files that were previously silently dropped. No public API signatures changed.

Does this change impact security?

No. This change does not create, modify, or alter permissions on any files or directories.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions github-actions Bot added the waiting-on-maintainers Waiting on the maintainers to review. label Mar 11, 2026
@crowecawcaw crowecawcaw force-pushed the fix/glob-dotfiles-consistency branch from a19d720 to 7a625cb Compare March 11, 2026 21:21
Set of normalized file paths that match the patterns
"""
matched_files = set()
root = Path(base_path)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that this will work, but do we want to change this behavior? What if the customer's job checkout a git clone and now they get a whole new hidden git tree getting uploaded?

matched_files.add(normalized_path)
for matched_path in root.glob(pattern):
if matched_path.is_file():
matched_files.add(os.path.normpath(str(matched_path)))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick search, it seems 3.11+ the default would support the hidden folders but < 3.11 the behavior depends. So I dont' think we want variation of behaviour on different versions of python.

Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>
@crowecawcaw crowecawcaw force-pushed the fix/glob-dotfiles-consistency branch from 7a625cb to 9d04d87 Compare March 16, 2026 19:47
@sonarqubecloud
Copy link
Copy Markdown

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

Labels

waiting-on-maintainers Waiting on the maintainers to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants