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

dep: Add Manifest constructor #1019

Merged
merged 1 commit into from
Aug 22, 2017

Conversation

ibrasho
Copy link
Collaborator

@ibrasho ibrasho commented Aug 16, 2017

What does this do / why do we need it?

The constructor will be used to ensure the prune variable is always set to prune nested vendor/ dirs.

What should your reviewer look out for in this PR?

Did I replace all initializations of dep.Manifest?

Which issue(s) does this PR fix?

Breaking down #952

@googlebot
Copy link
Collaborator

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

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.

:shipit:

UPDATE: Oops tests are failing but in general the changes agree with what I already reviewed in the other PR.

@ibrasho ibrasho force-pushed the add-Manifest-constructor branch 2 times, most recently from ef1909c to 5b18089 Compare August 16, 2017 23:08
@sdboyer
Copy link
Member

sdboyer commented Aug 17, 2017

huh. that failure is weird. i can't see how it would have anything to do with the change here...

Gopkg.toml Outdated
@@ -18,3 +18,8 @@
[[constraint]]
name = "github.com/pkg/errors"
version = "0.8.0"

[prune]
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 not actually add anything to our Gopkg.toml until the implementation is there. lead by example, and all that 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops.This was by mistake. 😓

@ibrasho ibrasho force-pushed the add-Manifest-constructor branch 2 times, most recently from b8dd084 to 532c0f2 Compare August 17, 2017 06:02
This commit adds a constructor for dep.Manifest.

Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
@ibrasho
Copy link
Collaborator Author

ibrasho commented Aug 17, 2017

I've removed extra additions that crept here by mistake. They were mainly related to adding prune options to the toml file.

Ovr: make(gps.ProjectConstraints),
}
g.origM = dep.NewManifest()
g.origM.Constraints = g.pd.constraints
Copy link
Collaborator

@jmank88 jmank88 Aug 17, 2017

Choose a reason for hiding this comment

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

The cases which overwrite the Constraints map in this way now have an extra initialization in the constructor. Multiple constructors or multiple optional paramaters seem like messy options. What about something like an Init() (or SetDefaults etc.) method instead, to be called after struct initialization, which only inits nil maps?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmmm... I thought about solutions to this but couldn't come up with anything I'm comfortable with.

Manifests are initialized once or twice per dep command, so it shouldn't have any impact on performance. Right?

Copy link
Collaborator

@jmank88 jmank88 Aug 17, 2017

Choose a reason for hiding this comment

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

Won't it be O(N+1) manifests for N imported projects (and self)?
It's still not a big deal (at least not for now). My WIP cache branch messes with these a bit (since locks and manifests are serialized/deserialized), so if that worsens the situation then I can revisit it there.

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 always forget about importers and recursively loading dependencies.

👍

@carolynvs
Copy link
Collaborator

Are y'all okay with me merging this as-is? I'd really like to have people using the new constructor in their importer PRs.

Copy link
Collaborator

@darkowlzz darkowlzz left a comment

Choose a reason for hiding this comment

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

LGTM!

@darkowlzz darkowlzz merged commit ae5c000 into golang:master Aug 22, 2017
@ibrasho ibrasho deleted the add-Manifest-constructor 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.

6 participants