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

Implement new spec for dep ensure #489

Merged
merged 39 commits into from
Aug 4, 2017
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
94fad51
Update some of docs and flags
sdboyer Apr 21, 2017
24a9b3b
Tweak usage text a bit
sdboyer Apr 30, 2017
2089f3e
Basic structure & implementation of default case
sdboyer Apr 30, 2017
817f06a
First bits of -update path
sdboyer Apr 30, 2017
5b03cbb
Fleshing out first pass of -update path
sdboyer Apr 30, 2017
d3a0679
First bits of -add path
sdboyer May 2, 2017
6f783e0
Further flesh out -add path
sdboyer May 9, 2017
a2dda19
Fix static problems
sdboyer May 10, 2017
1a54666
Catch up with package renames on master
sdboyer May 13, 2017
48e3fcf
Fix compile errors
sdboyer Jun 5, 2017
824716b
Catch up with master
sdboyer Jun 5, 2017
ca5a2fa
Reintroduce -dry-run flag
sdboyer Jun 5, 2017
d89de70
Move ensure flag validation into separate method
sdboyer Jun 5, 2017
7eea154
Failure case is when input hashes are NOT eq
sdboyer Jun 5, 2017
d341770
Fix several tests, usage output, * constraint use
sdboyer Jun 5, 2017
0577212
Remove ensure -override test cases
sdboyer Jun 5, 2017
8d42261
Hide output from glide importer tests
sdboyer Jun 5, 2017
9c05d37
Actually perform write in default ensure case
sdboyer Jun 5, 2017
8da156c
Remove tests of defunct ensure behavior
sdboyer Jun 12, 2017
424b7ff
Remove more unused code
sdboyer Jun 15, 2017
f4f7aba
Tests for ensure flag/arg validation
sdboyer Jun 15, 2017
6e855df
SafeWriter should not write out an unchanged lock
sdboyer Jun 17, 2017
8239b96
Add a swath of tests for ensure, ensure -update
sdboyer Jun 17, 2017
05b2e9f
Improve errors for many ensure failure modes
sdboyer Jun 18, 2017
cc04b58
Merge branch 'master' into new-ensure
sdboyer Jun 18, 2017
9b9f762
Add a handful of ensure -add test cases
sdboyer Jun 18, 2017
9707806
Split out getProjectConstraints, tweak errs, etc.
sdboyer Jun 19, 2017
61b8954
Several more ensure -add tests
sdboyer Jun 19, 2017
f38e02b
Add handling of feedback, etc. on ensure -add
sdboyer Jul 31, 2017
b461c3f
Merge branch 'master' into new-ensure
sdboyer Jul 31, 2017
97441d7
All tests passing
sdboyer Jul 31, 2017
9825b72
Create err subdirs for error cases
sdboyer Jul 31, 2017
686e331
Add a handful more harness tests
sdboyer Aug 1, 2017
943dede
Merge branch 'master' into new-ensure
sdboyer Aug 3, 2017
6af7093
Add -dry-run to usage output
sdboyer Aug 1, 2017
1cb2762
Fix up dep ensure -examples to match new interface
sdboyer Aug 2, 2017
42ef91d
Add file for general ensure tests
sdboyer Aug 3, 2017
7d21ee7
Add info msg ensure -v when first step is in sync
sdboyer Aug 3, 2017
b8f7027
Fix staticcheck errors, license
sdboyer Aug 3, 2017
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
543 changes: 455 additions & 88 deletions cmd/dep/ensure.go

Large diffs are not rendered by default.

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

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

18 changes: 18 additions & 0 deletions cmd/dep/testdata/harness_tests/ensure/add/desync/initial/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
)

func main() {
err := nil
if err != nil {
deptest.Map["yo yo!"]
}
deptestdos.diMeLo("whatev")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"commands": [
["ensure", "-add", "foobar.com/baz"]
],
"error-expected": "Gopkg.toml and Gopkg.lock are out of sync. Run a plain dep ensure to resync them before attempting to -add"
}

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
@@ -0,0 +1,4 @@

[[constraint]]
branch = "master"
name = "github.com/sdboyer/deptesttres"
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
package main

import (
_ "github.com/sdboyer/deptest"
"github.com/sdboyer/deptesttres"
)

func main() {
type a deptesttres.Bar
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"commands": [
["ensure", "-add", "github.com/sdboyer/deptesttres@master"]
],
"vendor-final": [
"github.com/sdboyer/deptesttres"
]
}

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
@@ -0,0 +1,7 @@
[[constraint]]
name = "github.com/sdboyer/deptesttres"
branch = "master"

[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"

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
@@ -0,0 +1,7 @@
[[constraint]]
name = "github.com/sdboyer/deptesttres"
branch = "master"

[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
package main

import (
_ "github.com/sdboyer/deptest"
"github.com/sdboyer/deptesttres"
)

func main() {
type a deptesttres.Bar
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"commands": [
["ensure", "-add", "github.com/sdboyer/deptest"]
],
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptesttres"
]
}

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
@@ -0,0 +1,7 @@
[[constraint]]
name = "github.com/sdboyer/deptesttres"
branch = "master"

[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"

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
@@ -0,0 +1,7 @@
[[constraint]]
name = "github.com/sdboyer/deptesttres"
branch = "master"

[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
package main

import (
"fmt"

stuff "github.com/sdboyer/deptest"
"github.com/sdboyer/deptesttres"
)

func main() {
fmt.Println(stuff.Thing)
type a deptesttres.Bar
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"commands": [
["ensure", "-add", "github.com/sdboyer/deptest@1.0.0"]
],
"error-expected": "Gopkg.toml already contains rules for github.com/sdboyer/deptest, cannot specify a version constraint"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"

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
@@ -0,0 +1,3 @@
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "1.0.0"
13 changes: 13 additions & 0 deletions cmd/dep/testdata/harness_tests/ensure/add/exists/initial/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
"github.com/sdboyer/deptest"
)

func main() {
_ := deptest.Map["yo yo!"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"commands": [
["ensure", "-add", "github.com/sdboyer/deptest"]
],
"error-expected": "nothing to -add, github.com/sdboyer/deptest is already in Gopkg.toml and the project's direct imports or required list"
}
21 changes: 21 additions & 0 deletions cmd/dep/testdata/harness_tests/ensure/add/noarg/final/Gopkg.lock

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
@@ -0,0 +1,3 @@
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "~0.8.0"
18 changes: 18 additions & 0 deletions cmd/dep/testdata/harness_tests/ensure/add/noarg/final/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
)

func main() {
err := nil
if err != nil {
deptest.Map["yo yo!"]
}
deptestdos.diMeLo("whatev")
}
21 changes: 21 additions & 0 deletions cmd/dep/testdata/harness_tests/ensure/add/noarg/initial/Gopkg.lock

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
@@ -0,0 +1,3 @@
[[constraint]]
name = "github.com/sdboyer/deptest"
version = "~0.8.0"
18 changes: 18 additions & 0 deletions cmd/dep/testdata/harness_tests/ensure/add/noarg/initial/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
"github.com/sdboyer/deptest"
"github.com/sdboyer/deptestdos"
)

func main() {
err := nil
if err != nil {
deptest.Map["yo yo!"]
}
deptestdos.diMeLo("whatev")
}
6 changes: 6 additions & 0 deletions cmd/dep/testdata/harness_tests/ensure/add/noarg/testcase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"commands": [
["ensure", "-add"]
],
"error-expected": "must specify at least one project or package to -add"
}

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

Loading