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

Skip invalid template files when loading workspace #1195

Merged
merged 1 commit into from
Mar 21, 2025
Merged

Conversation

jrray
Copy link
Collaborator

@jrray jrray commented Mar 21, 2025

For the use case of spk info --variants <valid spec file>, this command would fail with an error about a different file if another file exists with a name matching *.spk.yaml but loading this other file fails for any reason.

Like #1190 and #1191, this command is expected to succeed and is not intended to interact with any other files other than the one named on the command line.

For the use case of `spk info --variants <valid spec file>`, this
command would fail with an error about a different file if another file
exists with a name matching `*.spk.yaml` but loading this other file
fails for any reason.

Like #1190 and #1191, this command is expected to succeed and is not
intended to interact with any other files other than the one named on
the command line.

Signed-off-by: J Robert Ray <[email protected]>
@jrray jrray added bug Something isn't working SPI AOI Area of interest for SPI labels Mar 21, 2025
@jrray jrray self-assigned this Mar 21, 2025
@jrray
Copy link
Collaborator Author

jrray commented Mar 21, 2025

This represents another failure mode we encountered at SPI. Someone was using a file with the .spk.yaml extension for a spawn target spec and now it was impossible to use spk info --variants <filename> for any valid spk recipe file in that directory.

Skipping invalid files seems like a good course of action, however if there is a use case for making this kind of thing a hard error then it would be best to add a test that demonstrates that use case. We can make warning vs erroring a runtime decision based on context.

An unintended consequence of this change is that now if when doing spk info --variants demo.spk.yaml and demo.spk.yaml has some problem that makes it fail to load, we'll first say we didn't find that recipe template:

image

This is a little better than literally saying "file not found" but perhaps it could say something like "did not find a valid recipe template" since the rest of the error goes on to say more specific things about a file.

@jrray jrray requested a review from rydrman March 21, 2025 21:03
@jrray jrray merged commit 8d46899 into main Mar 21, 2025
5 checks passed
@jrray jrray deleted the workspace-load-err branch March 21, 2025 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SPI AOI Area of interest for SPI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants