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

collectConstraints() should collect applicable constraints only #1409

Closed
darkowlzz opened this issue Nov 28, 2017 · 5 comments · Fixed by #1480
Closed

collectConstraints() should collect applicable constraints only #1409

darkowlzz opened this issue Nov 28, 2017 · 5 comments · Fixed by #1480

Comments

@darkowlzz
Copy link
Collaborator

#962 added collectConstraints() for collecting constraints of all the projects that are direct dependencies, but it collects constraints that are not applicable too. It should only collect applicable project constraints.

Refer: https://github.com/golang/dep/pull/962/files#r153268638

@JackyChiu
Copy link
Contributor

I can hop on this @darkowlzz 😄

@darkowlzz
Copy link
Collaborator Author

@JackyChiu Great! Go for it.
But before you raise a PR, be aware of the in-flight PR, which is almost ready, that would change the code related to this fix. Since the actual algorithm is still the same, you can figure out the fix and rebase later if required.

@JackyChiu
Copy link
Contributor

Hey @darkowlzz could you clarify what an "applicable" constraint is?

@darkowlzz
Copy link
Collaborator Author

@JackyChiu yes, so applicable constraints are the working constraints, which are actually imported in the project by their import paths. If you check in getApplicableConstraints(), it first collects all the constraints in manifest (constraints and overrides), and then it goes through all the import paths in the project, and marks the constraints as working constraints if they are imported in the project. The constraints that don't have any imports in the project are not applicable constraints and we don't include them.

Hope it made sense 😁 I can explain again with more examples if required.

@JackyChiu
Copy link
Contributor

@darkowlzz Thanks for explanation, will try tonight since the other PR got merged

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.

2 participants