-
Notifications
You must be signed in to change notification settings - Fork 1k
Failed dep init runs should still write out config files #909
Comments
Would this be a change in cmd/dep/init.go? Something near handleAllTheFailuresOfTheWorld()? |
@JKobyP Yup! That is the right place to be looking in. 👍 |
Ideally dep would recognize a few categories of "init failure" and handle them appropriately (below). There are a lot of scenarios listed here, they don't all fall under this issue but hopefully they help put this issue in context.
|
Would this be appropriate for a first contribution? If so, I'd like to try it. Otherwise, feel free to tell me to buzz off! Right now, I'm confused about finding a concrete case for the first two of the error types you mentioned above. I'm just starting to form a mental model for dep. It seems to me that
would fail in the import step, rather than the solve step (since the initial solve won't have to consider an existing Gopkg.toml) -- am I wrong? Is there a failure case I can look to as an example? |
Sorry it wasn't clear from my brain dump, but for this issue, let's just focus on writing out the files and clearly indicate that they are incomplete. The rest is just context which may (or may) not impact how we go about things, as I expect to build on this over time implementing the other concerns.
I think this part is suitable for a first contribution, though it may require a bit of back and forth on the PR. If you are up for that, please have at it and I'd welcome a WIP PR so that we can answer questions as they come up or spot any gaps in my plan. 😀 |
Sorry I'm running 0mph here! Finding time to volunteer can be hard. I'll keep thinking about this in the meantime, but anybody can (and should) take this issue if they want! |
Looking at this again - it appears that the solve implementation at solver.go:472 currently returns nil during error cases. Then the content of this PR would be to:
|
The proposed changes write a partial manifest and lock in the case of a failed solve. The manifest contains a note describing that the manifest is incomplete. Solves golang#909 Signed-off-by: Koby Picker <[email protected]>
@JKobyP I don't have time for a full review, but I took a peek and I think you are on the right track! |
When a
dep init
run fails, no configuration files are written. This means that even a small problem results in the user having to figure out the problem and start all over, or get a bug fixed in dep, or give up and live in a yurt. It would be helpful if dep wrote out the config files anyway, explained that they are incomplete but provide a jumping off point for tweaking.We could write out the files to a non-standard path, e.g.
Gopkg.incomplete.toml
so that the user must take action in order to use the config. Then explain in the output what the user should do to fix and use the config files.The text was updated successfully, but these errors were encountered: