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

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

Conversation

ibrasho
Copy link
Collaborator

@ibrasho ibrasho commented Aug 9, 2017

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
Copy link
Member

sdboyer commented Aug 9, 2017

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

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

Copy link
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
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. 👍

Copy link
Collaborator

@carolynvs carolynvs left a comment

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
Copy link
Collaborator Author

ibrasho commented Aug 11, 2017

@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?

}

return errors.Wrap(err, "validateParams")
}
Copy link
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
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
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.

None yet

5 participants