Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize paths when deciding if files should be ignored #631

Merged
merged 2 commits into from
Nov 28, 2024

Conversation

amisevsk
Copy link
Contributor

Description

We need to normalize paths when computing ignores to ensure our current check succeeds in all cases. Currently, specifying a Kitfile such as

manifestVersion: 1.0.0
model:
  path: my-model/  # Trailing slash on path for the my-model directory

results in the ignore check asking "does path my-model have prefix my-model/?", which fails.

To make sure we handle ./my-model, my-model/ and my-model identically, we clean paths in the ignore checker to match how Kitfile paths are handled elsewhere

This PR also adds a functional test that would fail on the current main branch but is fixed by the PR.

Linked issues

Closes #620

Since we deal with cleaned paths when packing kitfile (i.e. normalizing
'./my-path', 'my-path/', etc. to just 'my-path', we need to do the same
to kitfile fields when processing ignore files; otherwise we ignore
files accidentally.
@amisevsk amisevsk merged commit 9d3d410 into jozu-ai:main Nov 28, 2024
3 checks passed
@amisevsk amisevsk deleted the pack-hang branch November 28, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kit pack freezes when Kitfile 'docs' section includes a path to a directory instead of individual file paths
2 participants