-
Notifications
You must be signed in to change notification settings - Fork 1k
Command/flags for updating only named deps #202
Comments
@sdboyer Just to understand ... is it ok to assume that given a manifest with fixed dependencies constraints (tied to a specific tag or commit), dep ensure -update will produce an exact copy of the vendor folder (thinking about CI environments and reproducible builds) ? |
@jbrodriguez that's a wholly separate thing. Reproducibility about making sure that I need to make some other issues for e.g. If, after becoming accustomed to |
@sdboyer Fair enough ! I'll keep looking how it evolves 👍 |
@sdboyer What do you mean by "If, after becoming accustomed to Am I missing something key about |
@carolynvs i think the word "pin" is a bit ambiguous. Maybe I'm missing a clear, commonly accepted meaning, but...in the bit from me you quoted, I'm using it to mean, "specify exactly one allowable version." Needless to say, the tool's However, if the sense is "pin to a major version," as you've used it, then that's basically equivalent to a |
Yeah I'm probably using the word "pin" wrong and as you said, most people think of pinning as selecting with a single version without a range. Thanks for the clarification! I would like to contribute to this issue, if that's okay? Sounds like there is a bit more planning to be done though. Not sure if my opinion counts but here are my thoughts. 😊
My vote (based on the above assumptions) would be: |
Absolutely. I think some of the confusion here is also because "pin" gets used a lot in an npm context (where shrinkwrapping isn't necessarily the norm), folks will sometimes attach to a single, specific version. Because the lock is a non-optional part of our system but provides that same class of guarantee, I think of us as "pinning by default."
✨ ❤️ 👍 👍! 🕺 🥇!! 😄 😄!!!!!
Yep, that's what I was trying to describe with the third option.
Hah, yeah. Homebrew always gets me with this.
I tend to agree. The big thing we lose by doing this that it's effectively changing the "type" of the One thing to clarify, though:
I think it's not the manifest we're checking against here, but the lock. If it's not in the lock, then there's no "current" version of it selected, and thus nothing to update "from." Also, because we may want to update a transitive dep, and that definitely won't be in the manifest. And lastly, because the way our manifests work are a bit different from other langs - the import graph is still queen. That's its whole own rabbit hole - #213 has a lot of info, if you want to explore. Any chance I could cajole you into working on this? 😄 😄 🦇 👁 |
💯 👍
Excellent, I love rabbit holes. Also a big fan of yaks.
You had me at ✨ ❤️! Yes, I'd love to take a crack at it. |
Right now,
dep ensure -update
is the way to update existing dependencies - it will disregard the lock, and update dependencies to the latest version allowed by constraints in the manifest. Problem is,-update
is global - there's no way to say, "only update this specific dependency; keep the others the same as what's in my lock." (I feel this pain every time I go to update gps in dep)We need a mechanism for allowing the user to specify only only a subset of dependencies that should be updated.
In the general spec, we described
ensure
as a combined "fetch/update" command, and indicated that a bare ensure on a dep already present in the project would cause an update. That is:would update
github.com/foo/bar
to the latest possible version the solver determines to be possible from looking at constraints in all manifests. However, we never actually got around to implementing that behavior. I think we were put off it because the behavior of a "bare" ensure like this can vary along a number of independent factors:require
)Note: I'm not necessarily saying every combination of these factors results in a significantly different outcome - just that they all bear on it somehow, which made it daunting enough that we kicked the can down the road. But now, it's time to stop kicking.
As far as I've thought it through, we have four basic approaches to solving this:
ensure
argument will result in an update if an import/require is present.-update
to allow it to take arguments; all named deps will be updated, and anything not already in the lock is ignored.-update
behave more like-override
- it's paired with the following argument as an indication that the tool should allow an update for just that dependency. It would be an error to specify something that isn't imported/required.update
.Note: all of the above choices aren't challenging in terms of the solving mechanics - the
ToChange
property ofgps.SolveParameters
lets us specify a list of projects to allow updates to, whileChangeAll
lets everything change (currentdep ensure -update
behavior). So I don't think the implementation work for these options is terrible; it's mostly in parsing and validating the input, and in reporting to the user if the solver returned a solution with changes that weren't explicitly expected.I figure I'd open this issue so that we can zero in on which one of these we should at least try first, then hop to getting it done!
We're now experimenting with option two:
The text was updated successfully, but these errors were encountered: