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

Split input components out in Gopkg.lock #584

Merged
merged 5 commits into from
May 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/dep/ensure.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (cmd *ensureCommand) Run(ctx *dep.Ctx, args []string) error {
writeV = dep.VendorAlways
}

newLock := dep.LockFromInterface(solution)
newLock := dep.LockFromSolution(solution)
Copy link
Collaborator

Choose a reason for hiding this comment

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

🎉 I know this is a small change, but the name is so much more clear that this gave me a happy.

sw, err := dep.NewSafeWriter(nil, p.Lock, newLock, writeV)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions cmd/dep/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error {
handleAllTheFailuresOfTheWorld(err)
return err
}
l = dep.LockFromInterface(soln)
l = dep.LockFromSolution(soln)

// Iterate through the new projects in solved lock and add them to manifest
// if direct deps and log feedback for all the new projects.
Expand Down Expand Up @@ -211,7 +211,7 @@ func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error {
return errors.Wrap(err, "prepare solver")
}

l.Memo = s.HashInputs()
l.SolveMeta.Memo = s.HashInputs()

// Pass timestamp (yyyyMMddHHmmss format) as suffix to backup name.
vendorbak, err := dep.BackupVendor(vpath, time.Now().Format("20060102150405"))
Expand Down
2 changes: 1 addition & 1 deletion cmd/dep/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (cmd *pruneCommand) Run(ctx *dep.Ctx, args []string) error {
return errors.Wrap(err, "could not set up solver for input hashing")
}

if !bytes.Equal(s.HashInputs(), p.Lock.Memo) {
if !bytes.Equal(s.HashInputs(), p.Lock.SolveMeta.Memo) {
return fmt.Errorf("lock hash doesn't match")
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/dep/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (cmd *removeCommand) Run(ctx *dep.Ctx, args []string) error {
return err
}

newLock := dep.LockFromInterface(soln)
newLock := dep.LockFromSolution(soln)

sw, err := dep.NewSafeWriter(nil, p.Lock, newLock, dep.VendorOnChanged)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/dep/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func runStatusAll(loggers *dep.Loggers, out outputter, p *dep.Project, sm gps.So
slp := p.Lock.Projects()
sort.Sort(dep.SortedLockedProjects(slp))

if bytes.Equal(s.HashInputs(), p.Lock.Memo) {
if bytes.Equal(s.HashInputs(), p.Lock.SolveMeta.Memo) {
// If these are equal, we're guaranteed that the lock is a transitively
// complete picture of all deps. That eliminates the need for at least
// some checks.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
["init"],
["ensure", "-update"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest"
]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"commands": [
["ensure"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest"
]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"commands": [
["ensure"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest"
]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
["init"],
["ensure", "-override", "github.com/sdboyer/[email protected]"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest"
]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"commands": [
["init", "-no-examples"],
["ensure", "-update"]
],
"error-expected" : "all dirs lacked any go code"
}
"commands": [
["init", "-no-examples"],
["ensure", "-update"]
],
"error-expected": "all dirs lacked any go code",
"vendor-final": []
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"commands": [
["ensure", "-update", "github.com/sdboyer/deptest"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"commands": [
["ensure", "-n", "-update", "github.com/sdboyer/deptest"]
],
"error-expected": "",
"vendor-final": []
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cmd/dep/testdata/harness_tests/init/case1/testcase.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"commands": [
["init", "-no-examples"]
],
"error-expected": "",
"gopath-initial": {
"github.com/sdboyer/deptest": "v0.8.0",
"github.com/sdboyer/deptestdos": "a0196baa11ea047dd65037287451d36b861b00ea"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cmd/dep/testdata/harness_tests/init/case2/testcase.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"commands": [
["init", "-no-examples"]
],
"error-expected": "",
"gopath-initial": {
"github.com/sdboyer/deptest": "v0.8.0"
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cmd/dep/testdata/harness_tests/init/case3/testcase.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"commands": [
["init", "-no-examples"]
],
"error-expected": "",
"gopath-initial": {
"github.com/sdboyer/deptestdos": "a0196baa11ea047dd65037287451d36b861b00ea"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"commands": [
["init"]
],
"error-expected" : "manifest already exists:"
}
"commands": [
["init"]
],
"error-expected": "manifest already exists:",
"vendor-final": []
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"commands": [
["init", "-no-examples"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest"
]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"commands": [
["remove", "-force", "github.com/sdboyer/deptestdos", "github.com/not/used"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"commands": [
["remove", "github.com/not/used"]
],
"error-expected": "",
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"commands": [
["remove", "github.com/not/used"]
],
"error-expected": "",
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 I've been seeing this pop up when I run tests locally. Any idea why the build didn't break and force us to update the testdata when it was first introduced?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've noticed it elsewhere, as well. I assume the build doesn't break because we're not actually validating that file - it's just the testcase procedure. What actually strikes me as odd is that passing the -update flag writes these files out at all. That seems like the actual mistake bug.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh right, we only compare golden files, not the testcases. I don't think it's a bug to update testcase files when -update is specified, e.g. updating the final vendor contents or expected-error message. It just looks odd in this instance because it's not fixing the test, and is just futzing with the schema/formatting.

"vendor-initial": {
"github.com/sdboyer/deptest": "v0.8.0",
"github.com/sdboyer/deptestdos": "a0196baa11ea047dd65037287451d36b861b00ea"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading