Replies: 3 comments 2 replies
-
@shykes - thank you very much for moving the conversation here from Slack - we will definitely get better visibility on the question and any subsequent answers. I've copied my response from Slack below. Just to make sure I'm talking about the right thing and understanding the context, I see there are three types of breaking change:
All three will impact end-users. Changes in category 1 will be largely be mitigated be automated fixes to CUE files via Just out of interest, how do you plan to handle category 2 breaking changes? If I understand correctly the statement "we’re embedding a ready-to-use cue.mod at runtime" then initially you're not going to support users importing third-party dependencies from outside that embedded cue.mod? That way, you cover off category 2 breaking changes if there are going to be any at least for now - because you ship an updated binary with the appropriate cue.mod distributed as part of it. The embedded cue.mod is never going to be broken with respect to the binary it is encapsulated in. So the breaking changes we're talking about here are, for now, limited to category 3. And specifically how the end user could/should react to, say, a breaking change in a package definition. Assuming I'm holding this right, what exacerbates the situation in this case is that someone using a later version of your binary immediately gets their dependencies bumped by virtue of the embedded cue.mod - their only option is not bumping them is to continue to use the old binary (which might be less than ideal if it contains bug fixes for example). In a world where you are not bundling a cue.mod, then as @verdverm points out the end user declares their dependencies, constraints and some algorithm (e.g. MVS) determines the actual version of a module to use. That way using a later version of your binary does not immediately break a user; they are free to upgrade their dependencies as and when they want. But that is not a panacea, because when they do come to upgrade a dependency (and in some situations they might be forced to upgrade a dependency by virtue of adding another dependency that bumps the required minimal version via MVS) that obviously exposes them to any category 3 breaking changes the dependency author may have made. AFAICS, there are two options: a) package authors should not make breaking changes unless they do so via a new major version; Option a is not available in the embedded cue.mod scenario. Nor is it necessarily that case if that package is still v0, i.e. pre v1. So breaking changes are going to happen (let's assume that post v1 everyone is "good" and plays by the rules... which doesn't really happen 100% of the time in practice, but it's a good aim). That leaves option b. At this stage I think it comes down to what kind of breaking change we are talking about, and how you want to handle it. In the Go world, Russ Cox is working on a tool called Which I think gets to the crux of the problem you're referring to. Right now, that tool does not exist for CUE, but the machinery that would sit behind it definitely does. Given that you are shipping an embedded cue.mod, you know and are in control of the breaking changes within packages contained in the cue.mod: is it conceivable therefore that your binary could support a "heal" command that would perform the fixes required to end-user code? |
Beta Was this translation helpful? Give feedback.
-
I think it's probably worth mentioning the work that @sdboyer has done for scuemata. I don't know that it's a solution for all of these problems, but it seems a useful addition + thing to consider as a part of a solution for some of them. |
Beta Was this translation helpful? Give feedback.
-
This discussion has been migrated to cue-lang/cue#1008. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
-
Hi all, as the launch of our Cue-based tool approaches, I am thinking more and more about API stability, not of Cue itself, but of user packages. What happens when a cue package changes in backwards-incompatible ways? How should downstream consumers of the package handle it? Are there patterns to follow by the published? Will the cue tooling help in some way?
Context is that we will be publishing a sizeable body of cue packages, and encouraging our users to import them. We are worried that when we inevitably break some of those packages, chaos will ensue.
Beta Was this translation helpful? Give feedback.
All reactions