Skip to content

fix: warn about unmatched model file patterns - #2472

Open
aditya-rai-5 wants to merge 1 commit into
defilantech:mainfrom
aditya-rai-5:fix/unmatched-file-patterns
Open

aditya-rai-5 wants to merge 1 commit into
defilantech:mainfrom
aditya-rai-5:fix/unmatched-file-patterns

Conversation

@aditya-rai-5

Copy link
Copy Markdown
Contributor

What

Report secondary spec.files globs that match no repository files through an UnmatchedFilePatterns=True condition and a Warning event naming the patterns.

Models can still become Ready; unmatched secondary globs remain nonfatal.

Why

A typo such as *.safetensor could silently omit model weights while the Model reported Ready, leaving users without a clear cause for runtime loading failures.

Fixes #2458

How

  • Check declared globs against the resolved staging entries for runtime downloads, PVC prefetch, and OCI publishing.
  • Emit the warning when the condition changes, avoiding duplicate events on unchanged reconciles.
  • Clear the condition when the unmatched patterns are corrected or removed.
  • Reuse resolved entries without additional repository requests or new configuration.
  • Document the behavior in the model cache guide.

Regression tests reproduced the missing condition before the fix and now cover persisted warnings, event deduplication, cleanup after spec correction, and OCI publishing.

Validation: focused regression and adjacent tests passed. make test-affected and make gate also passed locally.

Assisted-by: Codex (generated the regression tests, and documentation).

Checklist

  • Tests added/updated
  • make test passes locally
  • make lint passes locally
  • Commit messages follow conventional commits
  • All commits are signed off (git commit -s) per DCO
  • AI assistance (if any) is disclosed above, per CONTRIBUTING.md
  • Documentation updated (if user-facing change)

Signed-off-by: aditya-rai-5 <aditya5748rai@gmail.com>
@aditya-rai-5
aditya-rai-5 requested a review from Defilan as a code owner November 7, 2026 07:44

@Defilan Defilan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks. This gives the signal #2458 asked for without changing what becomes Ready, and it needs no extra repository calls. The event fires only when the condition changes, so repeated reconciles stay quiet.

One small gap, not blocking: TestReconcile_UnmatchedFilePatternsOCI checks that the condition is set, but not that it clears once spec.files is corrected, which the other test covers for the runtime and prefetch paths. Add it here if you like, or leave it for a follow-up.

I've started CI. This can merge once it's green.

@codecov

codecov Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
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.

[BUG] A spec.files glob that matches nothing is dropped with no signal, so a typo can leave a Model Ready without its weights

2 participants