Repository navigation
feat: add module versioning compat checks - #7692
Conversation
3ae0452 to
d94eacd
Compare
|
Hm, had an idea - so currently, in this PR, we have the ability to enforce a minimum version compatibility for modules that require engine versions that are too old. Should we also enforce a minimum compatibility for engine versions that too new? e.g. if I try and run a module that has Obviously, this has the potential to introduce some more friction in upgrading, but on the plus side, we get a more useful error message about what's wrong (instead of getting weird type errors all over the place from each SDK as they encounter things that don't exist). Additionally, this constraint could hopefully motivate users to upgrade to more recent dagger versions - if a daggerverse module uses dagger v0.12.1, then a user has to upgrade to use that. |
d94eacd to
a6f77c2
Compare
Signed-off-by: Justin Chadwell <[email protected]>
|
Right, decided to implement my above comment - if a user tries to run a v0.13.0 module on v0.12.0, this should definitely fail - it will probably not compile. This is similar in behavior to how |
| if err := engine.CheckVersionCompatibility(engine.Version, engineVersion); err != nil { | ||
| return nil, fmt.Errorf("module requires newer engine version: %w", err) | ||
| } |
There was a problem hiding this comment.
How strict is this? Feels like it could be frustrating if someone isn't enabled to directly upgrade their Dagger version.
While we're pre-1.0 this is probably closer to the reality of our releases (patch releases introduce new features all the time that the module might depend on), but I'd expect post-1.0 when our versions are more meaningful that this would be way too strict.
I guess we could codify that ahead of time? If version is < 1.0, require strict >=, but if >= 1.0, allow wiggle room at the patch level?
There was a problem hiding this comment.
Ooh that's a good point. Hm, I think I agree - but we can encode that constraint when we get to v1.0 right? Since the released engine will be the one doing the checks.
There was a problem hiding this comment.
Yeah - as long as we remember. 😄
Maybe we should make a v1.0 milestone for things like that.
There was a problem hiding this comment.
Yeah I'm happy with that - aside from that, any outstanding issues?
There was a problem hiding this comment.
Opened #7865 (+ milestone) for the v1.0 change.
I think the main question is whether this is still too strict even for today, but I don't have a great read on that.
vito
left a comment
There was a problem hiding this comment.
Approving in principle, have some concern over being too strict even for today, but it seems worth trying and we can always relax it later
| if err := engine.CheckVersionCompatibility(engine.Version, engineVersion); err != nil { | ||
| return nil, fmt.Errorf("module requires newer engine version: %w", err) | ||
| } |
There was a problem hiding this comment.
Opened #7865 (+ milestone) for the v1.0 change.
I think the main question is whether this is still too strict even for today, but I don't have a great read on that.
Signed-off-by: Justin Chadwell <[email protected]>
As discussed in #7640.
This is a follow-up to #5315, which will allow us to add a backwards compatibility check if/when we make breaking changes to the module API, etc.
This uses the
engineVersionfield introduced in1377f13(#6469).