Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

cmd/dep: always ensure that gps.SolveParameters are validated - #981

Merged
sdboyer merged 1 commit into
golang:masterfrom
ibrasho-forks:ensure-packages-are-deducible-before-solving
Aug 13, 2017
Merged

cmd/dep: always ensure that gps.SolveParameters are validated#981
sdboyer merged 1 commit into
golang:masterfrom
ibrasho-forks:ensure-packages-are-deducible-before-solving

Conversation

@ibrasho

@ibrasho ibrasho commented Aug 9, 2017

Copy link
Copy Markdown
Collaborator

Same as #697

Ensure that we validate gps.SolveParameters in dep init, dep status and the new modes in dep ensure.

@ibrasho
ibrasho force-pushed the ensure-packages-are-deducible-before-solving branch from daaffa7 to 186b556 Compare August 9, 2017 04:35
@sdboyer

sdboyer commented Aug 9, 2017

Copy link
Copy Markdown
Member

would it be easy to add some basic regression tests for this, just via the test harness?

Comment thread cmd/dep/status.go
}
return errors.Wrap(err, "validateParams")
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for repeating and not sharing the code with a common function?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update this PR. 👍

@carolynvs carolynvs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this, but agree with @darkowlzz that I'd prefer the validation to be a shared function.

Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
@ibrasho
ibrasho force-pushed the ensure-packages-are-deducible-before-solving branch from 186b556 to 56d7909 Compare August 11, 2017 21:10
@ibrasho
ibrasho requested a review from sdboyer as a code owner August 11, 2017 21:10
@ibrasho

ibrasho commented Aug 11, 2017

Copy link
Copy Markdown
Collaborator Author

@carolynvs, @darkowlzz : I've added a method in dep.Ctx but I'm honestly not sure if that's the most logical place for it. Any alternative suggestions?

Comment thread context.go
}

return errors.Wrap(err, "validateParams")
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since all the parts involved in this are gps related, maybe adding it to gps/solver.go would be better, like ValidateParamsWithLogs() or some better name? Just a suggestion.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open for suggestions.

The only reason I had to put it in dep.Ctx was that it's about logging the errors since the real logic is in gps.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's stick with this for now, at least. i know we're continuing to add more logging directly in gps elsewhere, but i still want to try to do that as little as possible, until i have time for some proper design think on how to do it generally.

@sdboyer
sdboyer merged commit d13e867 into golang:master Aug 13, 2017
@ibrasho
ibrasho deleted the ensure-packages-are-deducible-before-solving branch November 29, 2017 06:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants