Mostly flagless app source#1179
Conversation
c989fab to
fc0b828
Compare
|
I would really really appreciate it if someone with access to some more realistic registry references could test this - I have been testing with one of Brian's that I don't have access to and confirmed that it gives a suitable OCI error, but it would be good to get more variation especially since the reference parsing involves heuristics. (Hark at me, first inference engine and now heuristics! It's a couple of |
|
Found a regression where |
|
At least, a regression in the sense of "both are bad but it is a different bad." Displaying help text is arguably less surprising than firing up the app in the current directory when you thought you'd asked for a different one! But now we're back to the positional trigger args problem: there's no definite way to distinguish |
|
To clarify, this only happens if and this PR does not change that WHEEEE |
|
I piled on another heuristic to handle the With this sort of hack we could go back to the fully flagless design, though at least in this one the hack is controlling only the failure mode rather than the interpretation of the application source. |
|
I'm passing the |
|
Yikes, thanks to both of you for the catch! It would be super duper useful if we had a publicly accessible demo that could be used for testing OCI bits. Or is there one in the e2e tests somewhere? |
8789b97 to
0e1d43d
Compare
|
I think this is now fixed: (I clicked through all of them too to make sure they worked, but will save you the log spew.) Thanks to @vdice for help getting a working registry and @fibonacci1729 for volunteering his app as tribute. |
|
Marking this as ready for review since people are testing it enough to imply this is the direction we want to go...? |
|
Alternatively, you could push an app to GHCR as well. |
Signed-off-by: itowlson <[email protected]>
0e1d43d to
1a49cbc
Compare
fibonacci1729
left a comment
There was a problem hiding this comment.
I gave this another round of testing this morning and the code looks reasonable to me! LGTM.
dicej
left a comment
There was a problem hiding this comment.
Thanks for doing this (and saving the rest of us from having to)!
src/commands/up.rs
Outdated
| (None, Some(file), None, None) => Self::infer_file_source(file.to_owned()), | ||
| (None, None, Some(id), None) => AppSource::Bindle(id.to_owned()), | ||
| (None, None, None, Some(reference)) => AppSource::OciRegistry(reference.to_owned()), | ||
| (_, _, _, _) => AppSource::unresolvable("More than one application was specified"), |
There was a problem hiding this comment.
Entirely optional slight simplification:
| (_, _, _, _) => AppSource::unresolvable("More than one application was specified"), | |
| _ => AppSource::unresolvable("More than one application was specified"), |
There was a problem hiding this comment.
Obvious in retrospect but TIL - thank you.
Signed-off-by: itowlson <[email protected]>
1a49cbc to
4153d74
Compare
|
Haven't looked over the implementation yet but the ux was great. Worked with oci images, local files and folders, and with bindle ( |
Fixes #1155.
This is similar to #1159 but compromises on total flaglessness to make it play nicely with trigger options. With this, you still have to write
-ffor anything other than the default source (current directory + spin.toml), but you don't need to write--from-fileor--from-registryunless the "inference engine" gets it wrong. E.g.Error cases:
The following tweaks are also made to the
spin upUI:from-bindlealias is added despite this, because consistency even on the edge of the pit--fileis moved to an alias but continues to be supportedThere should be no breaking change for the
-fflag, except that if it is pointed at a non-existent file, it may now fail with a registry error instead of a file not found error.NOTE: this currently has the full, tragic commit history of the flagless work; if we decide to adopt it, then this should be squashed before merging.