From 1afad2b9707ffe1b5f0586e97875bdeb9fec3ee0 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sun, 22 Mar 2020 13:54:21 -0300 Subject: [PATCH 1/2] feat: remove deprecated blob and sign you should now use blobs and signs instead. Signed-off-by: Carlos Alexandro Becker --- internal/pipe/blob/blob.go | 5 ----- internal/pipe/blob/blob_test.go | 6 ------ internal/pipe/sign/sign.go | 8 -------- internal/pipe/sign/sign_test.go | 20 +++++++++++++------- pkg/config/config.go | 4 +--- www/content/deprecations.md | 11 +++++------ 6 files changed, 19 insertions(+), 35 deletions(-) diff --git a/internal/pipe/blob/blob.go b/internal/pipe/blob/blob.go index 3f6260ab4f8..69035faa372 100644 --- a/internal/pipe/blob/blob.go +++ b/internal/pipe/blob/blob.go @@ -4,7 +4,6 @@ import ( "fmt" "strings" - "github.com/goreleaser/goreleaser/internal/deprecate" "github.com/goreleaser/goreleaser/internal/pipe" "github.com/goreleaser/goreleaser/internal/semerrgroup" "github.com/goreleaser/goreleaser/pkg/context" @@ -20,10 +19,6 @@ func (Pipe) String() string { // Default sets the pipe defaults func (Pipe) Default(ctx *context.Context) error { - if len(ctx.Config.Blob) > 0 { - deprecate.Notice("blob") - ctx.Config.Blobs = append(ctx.Config.Blobs, ctx.Config.Blob...) - } for i := range ctx.Config.Blobs { blob := &ctx.Config.Blobs[i] diff --git a/internal/pipe/blob/blob_test.go b/internal/pipe/blob/blob_test.go index 0bd22fe158f..b6b511c0697 100644 --- a/internal/pipe/blob/blob_test.go +++ b/internal/pipe/blob/blob_test.go @@ -62,12 +62,6 @@ func TestDefaultsNoProvider(t *testing.T) { func TestDefaults(t *testing.T) { var ctx = context.New(config.Project{ - Blob: []config.Blob{ - { - Bucket: "foobar", - Provider: "gcs", - }, - }, Blobs: []config.Blob{ { Bucket: "foo", diff --git a/internal/pipe/sign/sign.go b/internal/pipe/sign/sign.go index d7706abd778..4ac4bbc4141 100644 --- a/internal/pipe/sign/sign.go +++ b/internal/pipe/sign/sign.go @@ -5,11 +5,9 @@ import ( "os" "os/exec" "path/filepath" - "reflect" "github.com/apex/log" "github.com/goreleaser/goreleaser/internal/artifact" - "github.com/goreleaser/goreleaser/internal/deprecate" "github.com/goreleaser/goreleaser/internal/ids" "github.com/goreleaser/goreleaser/internal/logext" "github.com/goreleaser/goreleaser/internal/pipe" @@ -27,12 +25,6 @@ func (Pipe) String() string { // Default sets the Pipes defaults. func (Pipe) Default(ctx *context.Context) error { - if len(ctx.Config.Signs) == 0 { - ctx.Config.Signs = append(ctx.Config.Signs, ctx.Config.Sign) - if !reflect.DeepEqual(ctx.Config.Sign, config.Sign{}) { - deprecate.Notice("sign") - } - } var ids = ids.New("signs") for i := range ctx.Config.Signs { cfg := &ctx.Config.Signs[i] diff --git a/internal/pipe/sign/sign_test.go b/internal/pipe/sign/sign_test.go index 7dd11a735aa..e69498d4651 100644 --- a/internal/pipe/sign/sign_test.go +++ b/internal/pipe/sign/sign_test.go @@ -40,7 +40,11 @@ func TestDescription(t *testing.T) { } func TestSignDefault(t *testing.T) { - ctx := &context.Context{} + ctx := &context.Context{ + Config: config.Project{ + Signs: []config.Sign{{}}, + }, + } err := Pipe{}.Default(ctx) assert.NoError(t, err) assert.Equal(t, ctx.Config.Signs[0].Cmd, "gpg") @@ -87,10 +91,12 @@ func TestSignArtifacts(t *testing.T) { expectedErrMsg: "sign: exit failed", ctx: context.New( config.Project{ - Sign: config.Sign{ - Artifacts: "all", - Cmd: "exit", - Args: []string{"1"}, + Signs: []config.Sign{ + { + Artifacts: "all", + Cmd: "exit", + Args: []string{"1"}, + }, }, }, ), @@ -99,8 +105,8 @@ func TestSignArtifacts(t *testing.T) { desc: "sign single", ctx: context.New( config.Project{ - Sign: config.Sign{ - Artifacts: "all", + Signs: []config.Sign{ + {Artifacts: "all"}, }, }, ), diff --git a/pkg/config/config.go b/pkg/config/config.go index 1559eb22056..677d1677fb7 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -366,12 +366,10 @@ type Project struct { Dockers []Docker `yaml:",omitempty"` Artifactories []Upload `yaml:",omitempty"` Uploads []Upload `yaml:",omitempty"` - Puts []Upload `yaml:",omitempty"` // TODO: remove this - Blob []Blob `yaml:"blob,omitempty"` // TODO: remove this + Puts []Upload `yaml:",omitempty"` // TODO: remove this Blobs []Blob `yaml:"blobs,omitempty"` Changelog Changelog `yaml:",omitempty"` Dist string `yaml:",omitempty"` - Sign Sign `yaml:",omitempty"` // TODO: remove this Signs []Sign `yaml:",omitempty"` EnvFiles EnvFiles `yaml:"env_files,omitempty"` Before Before `yaml:",omitempty"` diff --git a/www/content/deprecations.md b/www/content/deprecations.md index 9f17f4a2ef0..5af5c88eaaa 100644 --- a/www/content/deprecations.md +++ b/www/content/deprecations.md @@ -85,10 +85,13 @@ nfpms: - file_name_template: foo ``` +## Expired deprecation notices + +The following options were deprecated for ~6 months and are now fully removed. ### blob -> since 2019-08-02 +> since 2019-08-02, removed 2020-03-22 Blob was deprecated in favor of its plural form. It was already accepting multiple inputs, but its pluralized now so its more @@ -110,7 +113,7 @@ blobs: ### sign -> since 2019-07-20 +> since 2019-07-20, removed 2020-03-22 Sign was deprecated in favor of its plural form. @@ -129,10 +132,6 @@ signs: # etc ``` -## Expired deprecation notices - -The following options were deprecated for ~6 months and are now fully removed. - ### brew > since 2019-06-09, removed 2020-01-26 From 769601c92fd4eb775ade882b987be65c0fb8e250 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sun, 22 Mar 2020 14:07:49 -0300 Subject: [PATCH 2/2] fix: tests Signed-off-by: Carlos Alexandro Becker --- internal/pipe/blob/blob_test.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/internal/pipe/blob/blob_test.go b/internal/pipe/blob/blob_test.go index b6b511c0697..feb278dae66 100644 --- a/internal/pipe/blob/blob_test.go +++ b/internal/pipe/blob/blob_test.go @@ -78,11 +78,6 @@ func TestDefaults(t *testing.T) { Folder: "{{ .ProjectName }}/{{ .Tag }}", IDs: []string{"foo", "bar"}, }, - { - Bucket: "foobar", - Provider: "gcs", - Folder: "{{ .ProjectName }}/{{ .Tag }}", - }, }, ctx.Config.Blobs) }