-
Notifications
You must be signed in to change notification settings - Fork 1k
cmd/dep: always ensure that gps.SolveParameters are validated #981
cmd/dep: always ensure that gps.SolveParameters are validated #981
Conversation
daaffa7
to
186b556
Compare
would it be easy to add some basic regression tests for this, just via the test harness? |
cmd/dep/status.go
Outdated
} | ||
return errors.Wrap(err, "validateParams") | ||
} | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. 👍
There was a problem hiding this 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 <[email protected]>
186b556
to
56d7909
Compare
@carolynvs, @darkowlzz : I've added a method in |
} | ||
|
||
return errors.Wrap(err, "validateParams") | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
Same as #697
Ensure that we validate
gps.SolveParameters
indep init
,dep status
and the new modes indep ensure
.