From 47d66c3607153bd9f8c021f97df18160fa45dfec Mon Sep 17 00:00:00 2001 From: Sam Salisbury Date: Wed, 7 Dec 2022 10:43:25 +0000 Subject: [PATCH 01/13] print the result json for each build --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index a1354ce3..dab05d1b 100644 --- a/action.yml +++ b/action.yml @@ -112,7 +112,7 @@ runs: - name: Run Primary Build shell: bash working-directory: ${{ inputs.work_dir }} - run: $RUN_CLI build + run: $RUN_CLI build -json # Upload Primary Build - name: Upload Primary Zip @@ -127,7 +127,7 @@ runs: if: inputs.reproducible == 'assert' || inputs.reproducible == 'report' shell: bash working-directory: ${{ inputs.work_dir }} - run: $RUN_CLI build -verification + run: $RUN_CLI build -verification -json # Upload Local Verification Build - name: Upload Local Verification Zip From 15783bb12eecb320bacb4ee0d62f5c4808239ce3 Mon Sep 17 00:00:00 2001 From: Sam Salisbury Date: Wed, 7 Dec 2022 11:41:48 +0000 Subject: [PATCH 02/13] make cache dir path more meaningful --- pkg/build/tempdirs.go | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/pkg/build/tempdirs.go b/pkg/build/tempdirs.go index 27aabbfb..fe5af81e 100644 --- a/pkg/build/tempdirs.go +++ b/pkg/build/tempdirs.go @@ -1,9 +1,11 @@ package build import ( + "fmt" "log" "os" "path/filepath" + "regexp" "github.com/hashicorp/actions-go-build/pkg/crt" "github.com/hashicorp/actions-go-build/pkg/digest" @@ -83,7 +85,26 @@ func (d TempDirs) VerificationResultCachePath(configID, zipName string) string { } func (d TempDirs) cacheDir(kind string, extension ...string) string { - return d.tempDirPath(prefix(extension, "cache", kind, d.product.Repository, d.product.Name, d.product.SourceHash)...) + sh := d.product.SourceHash + // If the sourcehash is a long hex string, we shorten it and prefix with + // dirty_ or clean_. This doesn't matter for cache invalidation as the + // hash of the build inputs already includes this. + matched, err := regexp.Match("[a-f0-9]{40}.*", []byte(sh)) + if err != nil { + // This panic will only happen if the code above is wrong (i.e. the + // regexp doesn't compile). So this won't happen in releases since + // they will have passed tests that assert this panic can't happen. + panic(err) + } + if matched { + sh = sh[:8] + if d.product.IsDirty() { + sh = fmt.Sprintf("dirty_%s", sh) + } else { + sh = fmt.Sprintf("clean_%s", sh) + } + } + return d.tempDirPath(prefix(extension, "cache", kind, d.product.Repository, d.product.Name, sh)...) } func (d TempDirs) tempDirPath(elem ...string) string { From 86b74b6c866434d9a19b77d801968110c634c9e4 Mon Sep 17 00:00:00 2001 From: Sam Salisbury Date: Wed, 7 Dec 2022 14:15:29 +0000 Subject: [PATCH 03/13] better error message when worktree dirty --- go.mod | 2 +- go.sum | 2 ++ internal/config/config_test.go | 7 ++++++- pkg/build/build.go | 13 ++++++++++++- pkg/build/tempdirs.go | 5 +---- pkg/crt/product.go | 2 ++ pkg/crt/repocontext.go | 20 +++++++++++--------- 7 files changed, 35 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index e8662aec..6eeb3428 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/google/go-cmp v0.5.8 - github.com/hashicorp/composite-action-framework-go v0.0.3-0.20220825124702-4def58aae7a3 + github.com/hashicorp/composite-action-framework-go v0.0.3-0.20221207115606-093364d928f3 github.com/hashicorp/go-version v1.6.0 github.com/mitchellh/cli v1.1.4 github.com/otiai10/copy v1.7.0 diff --git a/go.sum b/go.sum index b169a94c..e70ada50 100644 --- a/go.sum +++ b/go.sum @@ -47,6 +47,8 @@ github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/composite-action-framework-go v0.0.3-0.20220825124702-4def58aae7a3 h1:z3aD3DKGG2/0yVTf3OfztjYF6MdwofdMP3ZCA/l/K30= github.com/hashicorp/composite-action-framework-go v0.0.3-0.20220825124702-4def58aae7a3/go.mod h1:qlINAhK7ADd/saEWQza7DTvGTqToVd4Hwv/7Yu2PkAo= +github.com/hashicorp/composite-action-framework-go v0.0.3-0.20221207115606-093364d928f3 h1:/u4HSSDRWMw2Dxvj/Cg7V5dhaHopydr7653sH0XzNKg= +github.com/hashicorp/composite-action-framework-go v0.0.3-0.20221207115606-093364d928f3/go.mod h1:qlINAhK7ADd/saEWQza7DTvGTqToVd4Hwv/7Yu2PkAo= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= diff --git a/internal/config/config_test.go b/internal/config/config_test.go index dad8c91e..fa65464a 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/actions-go-build/pkg/build" "github.com/hashicorp/actions-go-build/pkg/crt" + "github.com/hashicorp/composite-action-framework-go/pkg/git" "github.com/hashicorp/composite-action-framework-go/pkg/testhelpers/assert" "github.com/hashicorp/go-version" ) @@ -17,7 +18,11 @@ func TestConfig_init_ok(t *testing.T) { build.TempDirFunc = func() string { return "/test/temp/dir" } build.ConfigIDFunc = func(build.Config) string { return "" } build.CacheKeyFunc = func(...any) string { return "" } - crt.SourceHashFunc = func(string, []string) (string, error) { return "", nil } + crt.WorktreeStateFunc = func(string, []string) (*git.WorktreeState, error) { + return &git.WorktreeState{ + SourceHash: "", + }, nil + } ConfigIDFunc = func(Config) string { return "" } diff --git a/pkg/build/build.go b/pkg/build/build.go index 2036e79e..b9abd9de 100644 --- a/pkg/build/build.go +++ b/pkg/build/build.go @@ -35,13 +35,24 @@ type core struct { config Config } +func errDirtyWorktree(dirtyFiles []string) error { + maxDirty := 10 + if len(dirtyFiles) > maxDirty { + dirtyFiles = dirtyFiles[:maxDirty] + dotDotDot := fmt.Sprintf("\n%d more dirty files not shown...", len(dirtyFiles)-maxDirty) + dirtyFiles = append(dirtyFiles, dotDotDot) + } + list := "\n" + strings.Join(dirtyFiles, "\n") + return fmt.Errorf("worktree dirty but build is set to clean only; dirty paths: %s", list) +} + func newCore(name string, cfg Config, options ...Option) (*core, error) { s, err := newSettings(options) if err != nil { return nil, err } if s.cleanOnly && cfg.Product.IsDirty() { - return nil, fmt.Errorf("build config indicates a dirty worktree but clean-only is set to true") + return nil, errDirtyWorktree(cfg.Product.DirtyFiles) } return &core{ Settings: s, diff --git a/pkg/build/tempdirs.go b/pkg/build/tempdirs.go index fe5af81e..7e302e51 100644 --- a/pkg/build/tempdirs.go +++ b/pkg/build/tempdirs.go @@ -62,10 +62,7 @@ func assertSourceHash(p crt.Product) { } // It's the maintainers' jobs to make sure we don't hit this panic. // It's here to avoid writing undiscoverable files to the cache. - if (p == crt.Product{}) { - log.Panicf("SourceHash is empty; Product is empty.") - } - log.Panicf("SourceHash is empty; Product is nonempty: % #v", p) + log.Panicf("SourceHash is empty in product: % #v", p) } func (d TempDirs) RemoteBuildRoot(extension ...string) string { diff --git a/pkg/crt/product.go b/pkg/crt/product.go index a2b5d5d4..fac150d4 100644 --- a/pkg/crt/product.go +++ b/pkg/crt/product.go @@ -45,6 +45,7 @@ type Product struct { // dirty, or else it's a SHA1 hash of the HEAD commit plus all the contents // of all dirty files. SourceHash string + DirtyFiles []string `json:"omitempty"` } func (p Product) IsDirty() bool { @@ -119,6 +120,7 @@ func (p Product) setDefaults(rc RepoContext) (Product, error) { p.Revision = rc.CommitSHA p.RevisionTime = rc.CommitTime.UTC().Format(time.RFC3339) p.SourceHash = rc.SourceHash + p.DirtyFiles = rc.DirtyFiles return p, nil } diff --git a/pkg/crt/repocontext.go b/pkg/crt/repocontext.go index 9d65c532..ee3cc50c 100644 --- a/pkg/crt/repocontext.go +++ b/pkg/crt/repocontext.go @@ -25,6 +25,7 @@ type RepoContext struct { CommitTime time.Time CoreVersion version.Version SourceHash string + DirtyFiles []string `json:"omitempty"` } // IsDirty returns true if the worktree is dirty, ignoring @@ -58,7 +59,7 @@ func GetRepoContext(dir string, ignoreDirs []string) (RepoContext, error) { return RepoContext{}, err } - sourceHash, err := SourceHashFunc(dir, ignoreDirs) + worktreeState, err := WorktreeStateFunc(dir, ignoreDirs) if err != nil { return RepoContext{}, err // blah } @@ -89,7 +90,8 @@ func GetRepoContext(dir string, ignoreDirs []string) (RepoContext, error) { CommitSHA: sha, CommitTime: ts, CoreVersion: *v, - SourceHash: sourceHash, + SourceHash: worktreeState.SourceHash, + DirtyFiles: worktreeState.DirtyFiles, }, nil } @@ -97,22 +99,22 @@ var ( ErrNoVersionFile = errors.New("no VERSION file found") ErrMultipleVersionFiles = errors.New("multiple VERSION files found") - // SourceHashFunc can be overridden in tests to generate stable - // source hashes. - SourceHashFunc = getSourceHash + // WorktreeStateFunc can be overridden in tests to generate stable + // source hashes and dirty file lists. + WorktreeStateFunc = getWorktreeState ) -func getSourceHash(dir string, ignoreDirs []string) (string, error) { +func getWorktreeState(dir string, ignoreDirs []string) (*git.WorktreeState, error) { repo, err := git.Open(dir) if err != nil { - return "", err + return nil, err } ignore := makeIgnorePatterns(ignoreDirs) s, err := repo.WorktreeState(git.WorktreeStateIgnorePatterns(ignore...)) if err != nil { - return "", err + return nil, err } - return s.SourceHash, nil + return &s, nil } func makeIgnorePatterns(dirNames []string) []string { From fc8ac8629f804c683446ea23ff590a537e9678c1 Mon Sep 17 00:00:00 2001 From: Sam Salisbury Date: Wed, 7 Dec 2022 14:17:39 +0000 Subject: [PATCH 04/13] add simple e2e test about verification paths --- e2e/test.bats | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 e2e/test.bats diff --git a/e2e/test.bats b/e2e/test.bats new file mode 100755 index 00000000..fc168841 --- /dev/null +++ b/e2e/test.bats @@ -0,0 +1,25 @@ +#!/usr/bin/env bats + +set -Eeuo pipefail + +# This tests that we get the same verification zip path when we run the commands: +# +# - config +# - inspect -build-config -verification +# - build -verification +@test "verification output paths match" { + rm -rf dist/ out/ + CONFIG="$(actions-go-build config | grep ZIP_PATH_VERIFICATION | grep -Eo '/.*$')" + BUILDENV="$(actions-go-build inspect --build-config --verification | jq -r .Paths.ZipPath)" + actions-go-build build -q + BUILD="$(actions-go-build build -q -verification -json | jq -r .Config.Paths.ZipPath)" + + echo "$CONFIG" + echo "$BUILDENV" + echo "$BUILD" + + diff <(echo "$CONFIG") <(echo "$BUILDENV") + diff <(echo "$CONFIG") <(echo "$BUILD") + + [[ "$CONFIG" == "$BUILDENV" ]] +} From d52d54fa28e3b8348902ef44f0053fc6a9b9af21 Mon Sep 17 00:00:00 2001 From: Sam Salisbury Date: Wed, 7 Dec 2022 14:21:18 +0000 Subject: [PATCH 05/13] require clean worktrees in CI --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index dab05d1b..8d53fbbf 100644 --- a/action.yml +++ b/action.yml @@ -112,7 +112,7 @@ runs: - name: Run Primary Build shell: bash working-directory: ${{ inputs.work_dir }} - run: $RUN_CLI build -json + run: $RUN_CLI build -clean -json # Upload Primary Build - name: Upload Primary Zip @@ -127,7 +127,7 @@ runs: if: inputs.reproducible == 'assert' || inputs.reproducible == 'report' shell: bash working-directory: ${{ inputs.work_dir }} - run: $RUN_CLI build -verification -json + run: $RUN_CLI build -clean -json -verification # Upload Local Verification Build - name: Upload Local Verification Zip From eb655e2a9a119dece4fd1cef9aa13015f3d29a47 Mon Sep 17 00:00:00 2001 From: Sam Salisbury Date: Thu, 8 Dec 2022 11:01:19 +0000 Subject: [PATCH 06/13] add 'inspect --worktree' command --- pkg/commands/inspect.go | 57 +++++++++++++++++++---------------------- pkg/commands/printer.go | 42 ++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 30 deletions(-) create mode 100644 pkg/commands/printer.go diff --git a/pkg/commands/inspect.go b/pkg/commands/inspect.go index 457fac73..23696066 100644 --- a/pkg/commands/inspect.go +++ b/pkg/commands/inspect.go @@ -3,7 +3,6 @@ package commands import ( "flag" "fmt" - "io" "os" "github.com/hashicorp/actions-go-build/pkg/build" @@ -20,6 +19,7 @@ type inspectOpts struct { buildEnv bool buildEnvDesc bool zipInfo bool + worktree bool } func (opts *inspectOpts) Flags(fs *flag.FlagSet) { @@ -31,6 +31,7 @@ func (opts *inspectOpts) Flags(fs *flag.FlagSet) { fs.BoolVar(&opts.buildEnv, "build-env", false, "just print the build environment") fs.BoolVar(&opts.buildEnvDesc, "describe-build-env", false, "describe the build environment") fs.BoolVar(&opts.zipInfo, "zip-info", false, "just print the zip details") + fs.BoolVar(&opts.worktree, "worktree", false, "print worktree status (clean/dirty)") } func (opts *inspectOpts) HideFlags() []string { @@ -69,20 +70,18 @@ var Inspect = cli.LeafCommand("inspect", "inspect things", func(opts *inspectOpt return p.zipDetails() } + if opts.worktree { + return p.worktreeStatus() + } + return p.printAll() }) -type printer struct { - w io.Writer - build build.Build - printTitles bool - prefix string -} - func (p *printer) printAll() error { p.printTitles = true p.prefix = " " return firstErr( + p.worktreeStatus, p.buildEnv, p.zipDetails, ) @@ -113,32 +112,30 @@ func (p *printer) zipDetails() error { if err := p.title("Zip"); err != nil { return err } - p.line("ZIP_NAME=%s", p.build.Config().Parameters.ZipName) - return p.line("ZIP_PATH=%s", p.build.Config().Paths.ZipPath) + if err := p.line("ZIP_NAME=%s", p.build.Config().Parameters.ZipName); err != nil { + return err + } + if err := p.line("ZIP_PATH=%s", p.build.Config().Paths.ZipPath); err != nil { + return err + } + return nil } -func firstErr(f ...func() error) error { - for _, ef := range f { - if err := ef(); err != nil { +func (p *printer) worktreeStatus() error { + if err := p.title("Worktree Status"); err != nil { + return err + } + product := p.build.Config().Product + if !product.IsDirty() { + return p.line("clean") + } + if err := p.line("dirty files:"); err != nil { + return err + } + for _, f := range product.DirtyFiles { + if err := p.line(f); err != nil { return err } } return nil } - -func (p *printer) title(s string) error { - if !p.printTitles { - return nil - } - _, err := fmt.Fprintln(p.w, s+":") - return err -} - -func (p *printer) line(s string, a ...any) error { - _, err := fmt.Fprintf(p.w, p.prefix+s+"\n", a...) - return err -} - -func tabWrite[T any](p *printer, list []T, line func(T) string) error { - return cli.TabWrite(p.w, list, line) -} diff --git a/pkg/commands/printer.go b/pkg/commands/printer.go new file mode 100644 index 00000000..2bdd3261 --- /dev/null +++ b/pkg/commands/printer.go @@ -0,0 +1,42 @@ +package commands + +import ( + "fmt" + "io" + + "github.com/hashicorp/actions-go-build/pkg/build" + "github.com/hashicorp/composite-action-framework-go/pkg/cli" +) + +type printer struct { + w io.Writer + build build.Build + printTitles bool + prefix string +} + +func firstErr(f ...func() error) error { + for _, ef := range f { + if err := ef(); err != nil { + return err + } + } + return nil +} + +func (p *printer) title(s string) error { + if !p.printTitles { + return nil + } + _, err := fmt.Fprintln(p.w, s+":") + return err +} + +func (p *printer) line(s string, a ...any) error { + _, err := fmt.Fprintf(p.w, p.prefix+s+"\n", a...) + return err +} + +func tabWrite[T any](p *printer, list []T, line func(T) string) error { + return cli.TabWrite(p.w, list, line) +} From fa05f738b782a69372f694f5883b3711868c18e9 Mon Sep 17 00:00:00 2001 From: Sam Salisbury Date: Thu, 8 Dec 2022 11:05:54 +0000 Subject: [PATCH 07/13] add 'version/' to the version file search path --- pkg/crt/versionfile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/crt/versionfile.go b/pkg/crt/versionfile.go index 9489af3f..8897e3ef 100644 --- a/pkg/crt/versionfile.go +++ b/pkg/crt/versionfile.go @@ -22,7 +22,7 @@ func getCoreVersion(dir string) (*version.Version, error) { return getCoreVersionFromVersionFile(dir) } -var versionSearchPath = []string{".", ".release", "dev"} +var versionSearchPath = []string{".release", "version", ".", "dev"} func versionSearchPaths(basedir string) []string { out := make([]string, len(versionSearchPath)) From 71a6c7fddea1631f8ddd9567f5a1e19d27e8f08d Mon Sep 17 00:00:00 2001 From: Sam Salisbury Date: Thu, 8 Dec 2022 11:08:07 +0000 Subject: [PATCH 08/13] fix versionfile search path order --- pkg/crt/versionfile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/crt/versionfile.go b/pkg/crt/versionfile.go index 8897e3ef..27a3e25f 100644 --- a/pkg/crt/versionfile.go +++ b/pkg/crt/versionfile.go @@ -22,7 +22,7 @@ func getCoreVersion(dir string) (*version.Version, error) { return getCoreVersionFromVersionFile(dir) } -var versionSearchPath = []string{".release", "version", ".", "dev"} +var versionSearchPath = []string{".", ".release", "version", "dev"} func versionSearchPaths(basedir string) []string { out := make([]string, len(versionSearchPath)) From 6ca873783cf8e3bb6ace0c58d7733b9c489b4bc8 Mon Sep 17 00:00:00 2001 From: Sam Salisbury Date: Fri, 9 Dec 2022 12:02:58 +0000 Subject: [PATCH 09/13] upgrade composite action framework --- go.mod | 34 ++++++++++++++----------- go.sum | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 6eeb3428..68f027b1 100644 --- a/go.mod +++ b/go.mod @@ -3,51 +3,55 @@ module github.com/hashicorp/actions-go-build go 1.18 require ( - github.com/google/go-cmp v0.5.8 - github.com/hashicorp/composite-action-framework-go v0.0.3-0.20221207115606-093364d928f3 + github.com/google/go-cmp v0.5.9 + github.com/hashicorp/composite-action-framework-go v0.0.3-0.20221209120222-4cb4b247ec6b github.com/hashicorp/go-version v1.6.0 github.com/mitchellh/cli v1.1.4 github.com/otiai10/copy v1.7.0 github.com/sethvargo/go-envconfig v0.8.2 github.com/sethvargo/go-githubactions v0.5.3 - golang.org/x/mod v0.5.1 - golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 + golang.org/x/mod v0.7.0 + golang.org/x/term v0.3.0 ) require ( github.com/Masterminds/goutils v1.1.0 // indirect github.com/Masterminds/semver/v3 v3.1.1 // indirect github.com/Masterminds/sprig/v3 v3.2.0 // indirect - github.com/Microsoft/go-winio v0.4.16 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect + github.com/Microsoft/go-winio v0.6.0 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 // indirect github.com/acomagu/bufpipe v1.0.3 // indirect github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect - github.com/emirpasic/gods v1.12.0 // indirect + github.com/cloudflare/circl v1.3.0 // indirect + github.com/emirpasic/gods v1.18.1 // indirect github.com/fatih/color v1.7.0 // indirect github.com/go-git/gcfg v1.5.0 // indirect github.com/go-git/go-billy/v5 v5.3.1 // indirect - github.com/go-git/go-git/v5 v5.4.2 // indirect + github.com/go-git/go-git/v5 v5.5.0 // indirect github.com/google/uuid v1.1.2 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-multierror v1.0.0 // indirect github.com/huandu/xstrings v1.3.2 // indirect - github.com/imdario/mergo v0.3.12 // indirect + github.com/imdario/mergo v0.3.13 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect + github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/mattn/go-colorable v0.0.9 // indirect github.com/mattn/go-isatty v0.0.3 // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/reflectwalk v1.0.0 // indirect + github.com/pjbgf/sha1cd v0.2.3 // indirect github.com/posener/complete v1.1.1 // indirect - github.com/sergi/go-diff v1.1.0 // indirect + github.com/sergi/go-diff v1.2.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect + github.com/skeema/knownhosts v1.1.0 // indirect github.com/spf13/cast v1.3.1 // indirect - github.com/xanzy/ssh-agent v0.3.0 // indirect - golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b // indirect - golang.org/x/net v0.0.0-20210326060303-6b1517762897 // indirect - golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect + github.com/xanzy/ssh-agent v0.3.3 // indirect + golang.org/x/crypto v0.4.0 // indirect + golang.org/x/net v0.4.0 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/tools v0.4.0 // indirect golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect ) diff --git a/go.sum b/go.sum index e70ada50..45a93bc3 100644 --- a/go.sum +++ b/go.sum @@ -7,29 +7,42 @@ github.com/Masterminds/sprig/v3 v3.2.0/go.mod h1:tWhwTbUTndesPNeF0C900vKoq283u6z github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= +github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= +github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 h1:ra2OtmuW0AE5csawV4YXMNGNQQXvLRps3z2Z59OPO+I= +github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8= github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.0 h1:Anq00jxDtoyX3+aCaYUZ0vXC5r4k4epberfWGDXV1zE= +github.com/cloudflare/circl v1.3.0/go.mod h1:+CauBF6R70Jqcyl8N2hC8pAXYbWkGIezuSbuGLtRhnw= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= @@ -37,11 +50,16 @@ github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Ai github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8= github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= +github.com/go-git/go-git-fixtures/v4 v4.3.1/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo= github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= +github.com/go-git/go-git/v5 v5.5.0 h1:StO/ASRvk1Pp74tr7XQ0pQwKlCFignzzTF/NLKdQzUE= +github.com/go-git/go-git/v5 v5.5.0/go.mod h1:g456XI30HAdt7GQtIf8JR6GDAdULGaR4KtfFtQa0uTg= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -49,6 +67,8 @@ github.com/hashicorp/composite-action-framework-go v0.0.3-0.20220825124702-4def5 github.com/hashicorp/composite-action-framework-go v0.0.3-0.20220825124702-4def58aae7a3/go.mod h1:qlINAhK7ADd/saEWQza7DTvGTqToVd4Hwv/7Yu2PkAo= github.com/hashicorp/composite-action-framework-go v0.0.3-0.20221207115606-093364d928f3 h1:/u4HSSDRWMw2Dxvj/Cg7V5dhaHopydr7653sH0XzNKg= github.com/hashicorp/composite-action-framework-go v0.0.3-0.20221207115606-093364d928f3/go.mod h1:qlINAhK7ADd/saEWQza7DTvGTqToVd4Hwv/7Yu2PkAo= +github.com/hashicorp/composite-action-framework-go v0.0.3-0.20221209120222-4cb4b247ec6b h1:wP1f8Y1I68K0s+c1Cn/hO15DbznI81cLJqsMwi2EqQk= +github.com/hashicorp/composite-action-framework-go v0.0.3-0.20221209120222-4cb4b247ec6b/go.mod h1:eaGIxqoHvGZeZVHBSV6CkEGQCe0l8sVTYVsEY3YTb8Q= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= @@ -61,11 +81,15 @@ github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= @@ -96,6 +120,9 @@ github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6 github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= github.com/otiai10/mint v1.3.3 h1:7JgpsBaN0uMkyju4tbYHu0mnM55hNKVYLsXmwr15NQI= github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +github.com/pjbgf/sha1cd v0.2.0/go.mod h1:HOK9QrgzdHpbc2Kzip0Q1yi3M2MFGPADtR6HjG65m5M= +github.com/pjbgf/sha1cd v0.2.3 h1:uKQP/7QOzNtKYH7UTohZLcjF5/55EnTw0jO/Ru4jZwI= +github.com/pjbgf/sha1cd v0.2.3/go.mod h1:HOK9QrgzdHpbc2Kzip0Q1yi3M2MFGPADtR6HjG65m5M= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -105,6 +132,8 @@ github.com/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5 github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sethvargo/go-envconfig v0.8.2 h1:DDUVuG21RMgeB/bn4leclUI/837y6cQCD4w8hb5797k= github.com/sethvargo/go-envconfig v0.8.2/go.mod h1:Iz1Gy1Sf3T64TQlJSvee81qDhf7YIlt8GMUX6yyNFs0= github.com/sethvargo/go-githubactions v0.5.3 h1:moF/bzlaUUFAz8lu4/xnDQ5NPYoov5RvsINNLsprnr8= @@ -112,6 +141,9 @@ github.com/sethvargo/go-githubactions v0.5.3/go.mod h1:ugCoIFQjs7HxIwwYiY7ty6H9T github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/skeema/knownhosts v1.1.0 h1:Wvr9V0MxhjRbl3f9nMnKnFfiWTJmtECJ9Njkea3ysW0= +github.com/skeema/knownhosts v1.1.0/go.mod h1:sKFq3RD6/TKZkSWn8boUbDC7Qkgcv+8XXijpFO6roag= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -124,6 +156,10 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= +github.com/xanzy/ssh-agent v0.3.2/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= +github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -131,31 +167,74 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= +golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210326060303-6b1517762897 h1:KrsHThm5nFk34YtATK1LsThyGhGbGe1olrte/HInHvs= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc= golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.4.0 h1:7mTAgkunk3fr4GAloyyCasadO6h9zSsQZbwvcaIciV4= +golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -171,3 +250,4 @@ gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 0b78b799b37c8821773471e49a1ad41f737a681b Mon Sep 17 00:00:00 2001 From: Sam Salisbury Date: Mon, 12 Dec 2022 14:34:56 +0000 Subject: [PATCH 10/13] fix omitempty --- pkg/crt/repocontext.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/crt/repocontext.go b/pkg/crt/repocontext.go index ee3cc50c..99b0806e 100644 --- a/pkg/crt/repocontext.go +++ b/pkg/crt/repocontext.go @@ -25,7 +25,7 @@ type RepoContext struct { CommitTime time.Time CoreVersion version.Version SourceHash string - DirtyFiles []string `json:"omitempty"` + DirtyFiles []string `json:",omitempty"` } // IsDirty returns true if the worktree is dirty, ignoring From 8835cff0539211f3db483f9eb77433faa473ec9b Mon Sep 17 00:00:00 2001 From: Sam Salisbury Date: Mon, 12 Dec 2022 14:36:06 +0000 Subject: [PATCH 11/13] fix omitempty --- pkg/crt/product.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/crt/product.go b/pkg/crt/product.go index fac150d4..ca7c4874 100644 --- a/pkg/crt/product.go +++ b/pkg/crt/product.go @@ -45,7 +45,7 @@ type Product struct { // dirty, or else it's a SHA1 hash of the HEAD commit plus all the contents // of all dirty files. SourceHash string - DirtyFiles []string `json:"omitempty"` + DirtyFiles []string `json:",omitempty"` } func (p Product) IsDirty() bool { From 7aad92d8e62f85ab9ea22c2f38907d25288f309b Mon Sep 17 00:00:00 2001 From: Sam Salisbury Date: Wed, 11 Jan 2023 12:05:58 +0000 Subject: [PATCH 12/13] clearer test output Co-authored-by: brian shore --- e2e/test.bats | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/e2e/test.bats b/e2e/test.bats index fc168841..73481623 100755 --- a/e2e/test.bats +++ b/e2e/test.bats @@ -18,8 +18,14 @@ set -Eeuo pipefail echo "$BUILDENV" echo "$BUILD" - diff <(echo "$CONFIG") <(echo "$BUILDENV") - diff <(echo "$CONFIG") <(echo "$BUILD") + if [ "$CONFIG" != "$BUILDENV" ]; then + echo "config vs. buildenv:" + diff <(echo "$CONFIG") <(echo "$BUILDENV") + fi + if [ "$CONFIG" != "$BUILD" ]; then + echo "config vs. build:" + diff <(echo "$CONFIG") <(echo "$BUILD") + fi [[ "$CONFIG" == "$BUILDENV" ]] } From 0cd80b968c8e36969edaa48268809cbf13fd2fb2 Mon Sep 17 00:00:00 2001 From: Sam Salisbury Date: Wed, 11 Jan 2023 12:12:34 +0000 Subject: [PATCH 13/13] use firstErr to consolidate err handling --- pkg/commands/inspect.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pkg/commands/inspect.go b/pkg/commands/inspect.go index 23696066..96a40d57 100644 --- a/pkg/commands/inspect.go +++ b/pkg/commands/inspect.go @@ -109,16 +109,11 @@ func (p *printer) buildEnvDesc() error { } func (p *printer) zipDetails() error { - if err := p.title("Zip"); err != nil { - return err - } - if err := p.line("ZIP_NAME=%s", p.build.Config().Parameters.ZipName); err != nil { - return err - } - if err := p.line("ZIP_PATH=%s", p.build.Config().Paths.ZipPath); err != nil { - return err - } - return nil + return firstErr( + func() error { return p.title("Zip") }, + func() error { return p.line("ZIP_NAME=%s", p.build.Config().Parameters.ZipName) }, + func() error { return p.line("ZIP_PATH=%s", p.build.Config().Paths.ZipPath) }, + ) } func (p *printer) worktreeStatus() error {