-
Notifications
You must be signed in to change notification settings - Fork 1k
Alternate init modes #186
Comments
Let's do feedback and discussion on the general question of init modes here, but open up spinoff issues/PRs for each of the discrete parts. |
I can write the converter of gom (my self) if you want. |
@mattn sounds great to me :) Open a new PR whenever you're ready, and just link it to this? I'll also probably create a label at some point. |
Why |
@flibustenet More generally, though, |
@sdboyer Thanks for your explanation, it is obvious. |
Just the network, please 👍 |
When running That's the only part that I feel needs importing in this case, matching the lock file to what exists in vendor based on metadata from an existing tool. I'd actually prefer everything else be based on the dep solver, which may find more/less packages than the vendor/ folder or manifest contain. It's imperfect, but establishes a good base to continue from. An alternative to building this into |
On the flip side, if The problem I saw was that
Though I'd personally prefer that the lock file was imported from the legacy tool so I could upgrade dependencies gradually. |
I would love for |
@dmitris that's doable, though it would be a bit of work with the way things are currently split up. Would your use case not be better served simply by being able to convert a |
@sdboyer - that would mean that when starting a new project, I would need to manually add to the manifest the In any case, being able to convert from glide.yaml without loss of information such as |
Based on #222, would |
@dmitris it sounds like you're trying to automate adherence to an organizational policy around using internal mirrors of external deps. If so, I think that's more the class of problem we're discussing in #174. That discussion doesn't necessarily obviate the case for reading in remote source info for the manifest. But, doing that heads further into "making sense of what's in GOPATH" territory, which is full of landmines. Without a compelling reason to do it, my preference is to try to keep @nathany #222 is about how the solver interacts with metadata from other tools during solving - not the up-front constraint collection that happens in |
@sdboyer After reading #222, I was imaging this is more complex than I originally thought. 😊 But do any existing libraries have manifests that other tools use for resolving dependencies? And would those need to be considered, or could it be a simpler conversion of manifest formats for a single project? (not transitively) |
I think you will also eventually want a Also the mode I see the most used in canticle is |
I think, @rfliam, those ideas start taking us a bit off topic, because the |
@sdboyer I am interested in working on Selfishly I'd like to config the CI builds for my own projects (like dvm), and have dep handle populating my vendor directly from the glide config files. As a stopgap until checking in the manifest/lock is encouraged and I can go whole hog on dep proper. |
@carolynvs seems reasonable :) What I'd done before was a more comprehensive refactoring of the glide manifest and lock format/struct itself to comply with the However, I did write autoconversion logic from glide's current structs to that new structs. It's should be reasonably straightforward to swap in our manifest/lock structs for the new glide ones there. The conversion does have some failure modes, but IIRC it works pretty well overall. |
…test Check that git, bazaar, and mercurial are installed before running tests that require them
Now that the first importer is in, we are ready for brave volunteers to tackle the others!
Here's how to go about adding support for importing config from another dependency manager during
When working on the
As I wrote this, I realized it all belongs as inline doc, so I'll add that hopefully very soon! 😊 |
@carolynvs I suggest adding https://github.com/govend/govend. Writing an importer should be relatively straightforward. |
@bpicode just doing some queue cleaning, and i'm wondering if this issue is actually serving much of a purpose anymore. at minimum, do we have an answer for when would we consider it "done"? |
cc @carolynvs, assuming the question of @sdboyer was directed to you ;) |
This kind of turned into an epic, but really there's no need for it to stay open while people work on the remaining importers. Closing... |
lol sorry @bpicode yes, i must've been tired last night :) |
To accommodate the variety of ways people currently manage their Go code and make the transition to
dep
as easy as possible, we want to givedep init
different operational modes. This is a meta-issue for discussing and tracking all these different modes we might implement.Currently,
dep init
works by:populating the manifest with versions from the solution (only for missing direct deps, though); they are added to the lock, but omitted from the manifest.This is a reasonable model for people who've been using GOPATH in the conventional/vanilla way: it's basically just pulling up information from what's on disk into your manifest, so that dep can then replicate everything under
vendor
. However, this hardly the only way that may make sense for init to work.Converting existing tools
First, there's converting over from an existing community tool. The basic approach here is to write a converter - something that reads the metadata files from the tool and translates them into the
dep
equivalent.There's a bunch of prior art to work from here, fortunately: glide does these sorts of conversions automatically. In the work I was doing to slot gps in as the engine for glide, I updated the converters for gb, godep, gom, and gpm to be gps-style. These write to glide's version of manifests and locks, but those are quite analogous to dep, and should be easy to adapt. There's also an open PR for converting from govendor, though that's to existing glide structs, not the gps-adapted versions of them. (No help for gvt or anything else, unfortunately)
Now, we might ultimately decide we want to keep these tool-specific converters external to dep - maybe in a fully separate converter tool, or just ask the maintainers to add such commands themselves. Either way, though, it doesn't hurt to write them here now.
Just the network, please
Another alternate mode might be to ignore all the existing local information - GOPATH, existing tools, everything - and just have the solver pick out the latest versions it can. This might be surprisingly worthwhile, especially for projects that may have been lagging behind.
Interactive selection
All of these preceding options are more or less separate modes (with "just the network" being a supplemental fallback that can automatically fill in holes left by any others). However, there's another orthogonal option that we may want: prompting the user to select the version they want. I'm imagining two, mutually exclusive options:
-prompt-missing
, where the tool prompts the user to pick a version available upstream only if the main mode provides no useful constraint-prompt-all
, where the user is prompted to choose from among the available upstream versions, and the version determined by the main inferencing mode (if any).The text was updated successfully, but these errors were encountered: