diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 11345c2..1571ff9 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -56,7 +56,7 @@ further defined and clarified by project maintainers. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at -[TTS-OpenSource-Office@target.com](mailto:TTS-OpenSource-Office@target.com). All +[opensource@target.com](mailto:opensource@target.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. diff --git a/.github/README.md b/.github/README.md index b7bdce9..2fee41a 100644 --- a/.github/README.md +++ b/.github/README.md @@ -23,7 +23,7 @@ Please see our [support](SUPPORT.md) documentation for further instructions. ## Copyright and License ``` -Copyright (c) 2021 Target Brands, Inc. +Copyright (c) 2022 Target Brands, Inc. ``` [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) diff --git a/Dockerfile b/Dockerfile index c663ca3..2a9c26b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -# Copyright (c) 2021 Target Brands, Inc. All rights reserved. +# Copyright (c) 2022 Target Brands, Inc. All rights reserved. # # Use of this source code is governed by the LICENSE file in this repository. diff --git a/LICENSE b/LICENSE index baa6718..2954d18 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright (c) 2021 Target Brands, Inc. +Copyright (c) 2022 Target Brands, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index 0e0695c..eb294e5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -# Copyright (c) 2021 Target Brands, Inc. All rights reserved. +# Copyright (c) 2022 Target Brands, Inc. All rights reserved. # # Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-email/defaults.go b/cmd/vela-email/defaults.go index b169924..1778810 100644 --- a/cmd/vela-email/defaults.go +++ b/cmd/vela-email/defaults.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-email/loginauth.go b/cmd/vela-email/loginauth.go index 690a747..b2b1629 100644 --- a/cmd/vela-email/loginauth.go +++ b/cmd/vela-email/loginauth.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. diff --git a/cmd/vela-email/main.go b/cmd/vela-email/main.go index f006256..0986517 100644 --- a/cmd/vela-email/main.go +++ b/cmd/vela-email/main.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -36,7 +36,7 @@ func main() { Name: "vela-email", HelpName: "vela-email", Usage: "Vela Email plugin for sending Vela build information to a user's email.", - Copyright: "Copyright (c) 2021 Target Brands, Inc. All rights reserved.", + Copyright: "Copyright (c) 2022 Target Brands, Inc. All rights reserved.", Authors: []*cli.Author{ { Name: "Vela Admins", diff --git a/cmd/vela-email/plugin.go b/cmd/vela-email/plugin.go index 55d8ee3..4be3bdc 100644 --- a/cmd/vela-email/plugin.go +++ b/cmd/vela-email/plugin.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. @@ -169,7 +169,7 @@ func (p *Plugin) Exec() error { logrus.Trace("entered plugin.Execute") defer logrus.Trace("exited plugin.Execute") - logrus.Info("Parsing Subject...") + logrus.Debug("Parsing Subject...") subject, err := p.injectEnv(p.Email.Subject) if err != nil { return err @@ -177,19 +177,19 @@ func (p *Plugin) Exec() error { p.Email.Subject = subject if len(p.Email.HTML) > 0 { - logrus.Info("Parsing HTML...") + logrus.Debug("Parsing HTML...") body, err := p.injectEnv(string(p.Email.HTML)) if err != nil { return err } - logrus.Info("Parsing CSS...") + logrus.Debug("Parsing CSS...") body, err = inliner.Inline(body) if err != nil { return err } p.Email.HTML = []byte(body) } else { - logrus.Info("Parsing Text...") + logrus.Debug("Parsing Text...") body, err := p.injectEnv(string(p.Email.Text)) if err != nil { return err @@ -215,19 +215,19 @@ func (p *Plugin) Exec() error { case "starttls": logrus.Info("Sending email with StartTLS...") if err := p.Email.SendWithStartTLS(host, auth, p.TLSConfig); err != nil { - return fmt.Errorf("error sending with StartTLS: %v", err) + return fmt.Errorf("error sending with StartTLS: %w", err) } case "tls": logrus.Info("Sending email with TLS...") if err := p.Email.SendWithTLS(host, auth, p.TLSConfig); err != nil { - return fmt.Errorf("error sending with TLS: %v", err) + return fmt.Errorf("error sending with TLS: %w", err) } case "plain": fallthrough default: logrus.Info("Sending email with Plain...") if err := p.Email.Send(host, auth); err != nil { - return fmt.Errorf("error sending with Plain: %v", err) + return fmt.Errorf("error sending with Plain: %w", err) } } diff --git a/cmd/vela-email/plugin_test.go b/cmd/vela-email/plugin_test.go index 73bf4ab..f5b780c 100644 --- a/cmd/vela-email/plugin_test.go +++ b/cmd/vela-email/plugin_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. package main @@ -15,8 +15,8 @@ import ( var ( mockEmail = &email.Email{ - To: []string{"one@mail.com"}, - From: "two@mail.com", + To: []string{"fakemail1@example.com"}, + From: "fakemail2@example.com", } mockSMTPHost = &SMTPHost{ @@ -76,8 +76,8 @@ func TestValidateSuccess(t *testing.T) { name: "return no errors: multiple To emails", parameters: Plugin{ Email: &email.Email{ - To: []string{"one@gmail.com", "two@comcast.net"}, - From: "three@email.com", + To: []string{"fakemail1@example.com", "fakemail2@example.com"}, + From: "fakemail3@example.com", }, SMTPHost: mockSMTPHost, Attachment: noAttachment, @@ -87,8 +87,8 @@ func TestValidateSuccess(t *testing.T) { name: "return no errors: no username or password", parameters: Plugin{ Email: &email.Email{ - To: []string{"one@gmail.com", "two@comcast.net"}, - From: "three@email.com", + To: []string{"fakemail1@example.com", "fakemail2@example.com"}, + From: "fakemail3@example.com", }, SMTPHost: &SMTPHost{ Host: "smtphost.com", @@ -101,11 +101,11 @@ func TestValidateSuccess(t *testing.T) { name: "return no errors: extra email parameters", parameters: Plugin{ Email: &email.Email{ - To: []string{"one@gmail.com", "two@comcast.net"}, - From: "three@email.com", - ReplyTo: []string{"first.last@email.com"}, - Bcc: []string{"first.last@email.com"}, - Cc: []string{"first.last@email.com"}, + To: []string{"fakemail1@example.com", "fakemail2@example.com"}, + From: "fakemail3@example.com", + ReplyTo: []string{"fakemail@example.com"}, + Bcc: []string{"fakemail@example.com"}, + Cc: []string{"fakemail@example.com"}, Subject: "subject", Text: []byte(""), HTML: []byte(""), @@ -150,7 +150,7 @@ func TestValidateErrors(t *testing.T) { name: "To missing", parameters: Plugin{ Email: &email.Email{ - From: "two@email.com", + From: "fakemail@example.com", }, Attachment: noAttachment, }, @@ -160,7 +160,7 @@ func TestValidateErrors(t *testing.T) { name: "From missing", parameters: Plugin{ Email: &email.Email{ - To: []string{"one@email.com"}, + To: []string{"fakemail@example.com"}, }, Attachment: noAttachment, }, @@ -246,8 +246,8 @@ func TestInjectEnvSuccess(t *testing.T) { name: "email using default subject and user text", parameters: Plugin{ Email: &email.Email{ - To: []string{"one@gmail.com", "two@comcast.net"}, - From: "three@email.com", + To: []string{"fakemail1@example.com", "fakemail2@example.com"}, + From: "fakemail3@example.com", Subject: DefaultSubject, Text: []byte("This is some text for repo: {{ .VELA_REPO_FULL_NAME }}"), }, @@ -260,8 +260,8 @@ func TestInjectEnvSuccess(t *testing.T) { name: "email using user subject and html", parameters: Plugin{ Email: &email.Email{ - To: []string{"one@gmail.com", "two@comcast.net"}, - From: "three@email.com", + To: []string{"fakemail1@example.com", "fakemail2@example.com"}, + From: "fakemail3@example.com", Subject: "Commit failure on vela build: {{ .VELA_BUILD_NUMBER }}", Text: []byte("This is some text for repo: {{ .VELA_REPO_FULL_NAME }}"), }, @@ -315,8 +315,8 @@ func TestInjectEnvBadVar(t *testing.T) { name: "error: using environment variable that doesnt exist", parameters: Plugin{ Email: &email.Email{ - To: []string{"one@gmail.com", "two@comcast.net"}, - From: "three@email.com", + To: []string{"fakemail1@example.com", "fakemail2@example.com"}, + From: "fakemail3@example.com", Subject: "This is a bad subject {{ .SOME_OTHER_VARIABLE }}", }, SMTPHost: mockSMTPHost, diff --git a/cmd/vela-email/testdata/example1.txt b/cmd/vela-email/testdata/example1.txt index efec131..917b47a 100644 --- a/cmd/vela-email/testdata/example1.txt +++ b/cmd/vela-email/testdata/example1.txt @@ -1,5 +1,5 @@ From: vela-noreply@fakemail.com -To: emailone@email.com, emailtwo@email.com +To: fakemail1@example.com, fakemail2@example.com Subject: Vela Pipeline for {{ .VELA_REPO_FULL_NAME }} {{ .VELA_BUILD_BRANCH }} Content-Type: text/plain diff --git a/version/version.go b/version/version.go index 5482183..52d281e 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Target Brands, Inc. All rights reserved. +// Copyright (c) 2022 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository.