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

Warn when project constraint is missing in Gopkg.toml #1336

Closed
darkowlzz opened this issue Nov 1, 2017 · 6 comments · Fixed by #1370
Closed

Warn when project constraint is missing in Gopkg.toml #1336

darkowlzz opened this issue Nov 1, 2017 · 6 comments · Fixed by #1370

Comments

@darkowlzz
Copy link
Collaborator

darkowlzz commented Nov 1, 2017

For every project in Gopkg.toml, there should be a constraint (branch, version or revision). A project without any constraint doesn't tell anything useful to dep.

For example, Gopkg.toml with a project:

[[constraint]]
  name = "github.com/x/y"

should result in warning during manifest validation and tell the user to add a branch/version/revision constraint.

@sdboyer
Copy link
Member

sdboyer commented Nov 2, 2017

mmmm, almost - a [[constraint]] is useful if either a version rule OR a source rule is present. but other than that, yeah, this would be good to add 😁

@JackyChiu
Copy link
Contributor

Hey @sdboyer @darkowlzz can I pick this one up?

@darkowlzz
Copy link
Collaborator Author

@JackyChiu go for it! 👍

@carolynvs
Copy link
Collaborator

carolynvs commented Nov 13, 2017

@sdboyer @darkowlzz The importers make entries like this when a constraint version/branch cannot be determined. Here's the original PR where that behavior was introduced #901. If we are going to start warning about config that dep itself is generating, then we'll need to change the importers to do something different.

I can't find the original issue/discussion on why we use gps.any for the constraint, instead of ommitting it, but I thought it had to do with confusion around getting an empty manifest (but populated lock) after importing.

UPDATE: Found them: #149 and I think somewhere in this monster issue #213.

@darkowlzz
Copy link
Collaborator Author

@carolynvs a quick update. I had a discussion with Sam about this and we decided to omit those projects from manifest for which we don't have proper/useful constraints.

@carolynvs
Copy link
Collaborator

Thanks for the quick clarification! I've created #1373 to get the importers tweaked to match and flagged it with help wanted.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants