Skip to content

Normalize paths when deciding if files should be ignored#631

Merged
amisevsk merged 2 commits intokitops-ml:mainfrom
amisevsk:pack-hang
Nov 28, 2024
Merged

Normalize paths when deciding if files should be ignored#631
amisevsk merged 2 commits intokitops-ml:mainfrom
amisevsk:pack-hang

Conversation

@amisevsk
Copy link
Copy Markdown
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 kitops-ml:main Nov 28, 2024
@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