Skip to content

Commit

Permalink
Merge branch 'main' into triarius/oidc-token-command
Browse files Browse the repository at this point in the history
  • Loading branch information
triarius authored Nov 10, 2022
2 parents 3c55028 + 910afe0 commit 9a8b6b8
Show file tree
Hide file tree
Showing 10 changed files with 361 additions and 341 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [v3.40.0](https://github.com/buildkite/agent/tree/v3.40.0) (2022-11-08)
[Full Changelog](https://github.com/buildkite/agent/compare/v3.39.0...v3.40.0)

### Added

- Agent binaries for windows/arm64 [#1767](https://github.com/buildkite/agent/pull/1767) (@yob)
- Alpine k8s image [#1771](https://github.com/buildkite/agent/pull/1771) (@dabarrell)

### Security

- (Fixed in 3.39.1) A security issue in environment handling between buildkite-agent and Bash 5.2 [#1781](https://github.com/buildkite/agent/pull/1781) (@moskyb)
- Secret redaction now handles secrets containing UTF-8 code points greater than 255 [#1809](https://github.com/buildkite/agent/pull/1809) (@DrJosh9000)
- The update to Go 1.19.3 fixes two Go security issues (particularly on Windows):
- The current directory (`.`) in `$PATH` is now ignored for finding executables - see https://go.dev/blog/path-security
- Environment variable values containing null bytes are now sanitised - see https://github.com/golang/go/issues/56284

### Changed

- 5xx responses are now retried when attempting to start a job [#1777](https://github.com/buildkite/agent/pull/1777) (@jonahbull)
- 🧹 A variety of dependency updates and cleanups!

## [v3.39.0](https://github.com/buildkite/agent/tree/v3.39.0) (2022-09-08)
[Full Changelog](https://github.com/buildkite/agent/compare/v3.38.0...v3.39.0)

Expand Down
2 changes: 1 addition & 1 deletion agent/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.39.0
3.40.0
18 changes: 8 additions & 10 deletions bootstrap/integration/command_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestMultilineCommandRunUnderBatch(t *testing.T) {

tester, err := NewBootstrapTester()
if err != nil {
t.Fatal(err)
t.Fatalf("NewBootstrapTester() error = %v", err)
}
defer tester.Close()

Expand All @@ -25,9 +25,8 @@ func TestMultilineCommandRunUnderBatch(t *testing.T) {

setup.Expect().Once()
build.Expect().Once().AndCallFunc(func(c *bintest.Call) {
llamas := c.GetEnv(`LLAMAS`)
if llamas != "COOL" {
t.Errorf("Expected LLAMAS=COOL, got %s", llamas)
if got, want := c.GetEnv("LLAMAS"), "COOL"; got != want {
t.Errorf("c.GetEnv(LLAMAS) = %q, want %q", got, want)
c.Exit(1)
} else {
c.Exit(0)
Expand All @@ -45,7 +44,7 @@ func TestMultilineCommandRunUnderBatch(t *testing.T) {
func TestPreExitHooksRunsAfterCommandFails(t *testing.T) {
tester, err := NewBootstrapTester()
if err != nil {
t.Fatal(err)
t.Fatalf("NewBootstrapTester() error = %v", err)
}
defer tester.Close()

Expand All @@ -56,18 +55,17 @@ func TestPreExitHooksRunsAfterCommandFails(t *testing.T) {
AndExitWith(0)

preExitFunc := func(c *bintest.Call) {
cmdExitStatus := c.GetEnv(`BUILDKITE_COMMAND_EXIT_STATUS`)
if cmdExitStatus != "1" {
t.Errorf("Expected an exit status of 1, got %v", cmdExitStatus)
if got, want := c.GetEnv("BUILDKITE_COMMAND_EXIT_STATUS"), "1"; got != want {
t.Errorf("c.GetEnv(BUILDKITE_COMMAND_EXIT_STATUS) = %q, want %q", got, want)
}
c.Exit(0)
}

tester.ExpectGlobalHook("pre-exit").Once().AndCallFunc(preExitFunc)
tester.ExpectLocalHook("pre-exit").Once().AndCallFunc(preExitFunc)

if err = tester.Run(t, "BUILDKITE_COMMAND=false"); err == nil {
t.Fatal("Expected the bootstrap to fail")
if err := tester.Run(t, "BUILDKITE_COMMAND=false"); err == nil {
t.Fatalf("tester.Run(t, BUILDKITE_COMMAND=false) = %v, want non-nil error", err)
}

tester.CheckMocks(t)
Expand Down
23 changes: 11 additions & 12 deletions bootstrap/integration/docker_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func argumentForCommand(cmd string) interface{} {
func TestRunningCommandWithDocker(t *testing.T) {
tester, err := NewBootstrapTester()
if err != nil {
t.Fatal(err)
t.Fatalf("NewBootstrapTester() error = %v", err)
}
defer tester.Close()

Expand Down Expand Up @@ -52,7 +52,7 @@ func TestRunningCommandWithDocker(t *testing.T) {
func TestRunningCommandWithDockerAndCustomDockerfile(t *testing.T) {
tester, err := NewBootstrapTester()
if err != nil {
t.Fatal(err)
t.Fatalf("NewBootstrapTester() error = %v", err)
}
defer tester.Close()

Expand Down Expand Up @@ -86,7 +86,7 @@ func TestRunningCommandWithDockerAndCustomDockerfile(t *testing.T) {
func TestRunningFailingCommandWithDocker(t *testing.T) {
tester, err := NewBootstrapTester()
if err != nil {
t.Fatal(err)
t.Fatalf("NewBootstrapTester() error = %v", err)
}
defer tester.Close()

Expand Down Expand Up @@ -116,7 +116,7 @@ func TestRunningFailingCommandWithDocker(t *testing.T) {
expectCommandHooks("1", t, tester)

if err = tester.Run(t, env...); err == nil {
t.Fatal("Expected bootstrap to fail")
t.Fatalf("tester.Run(t, %v) = %v, want non-nil error", env, err)
}

tester.CheckMocks(t)
Expand All @@ -125,7 +125,7 @@ func TestRunningFailingCommandWithDocker(t *testing.T) {
func TestRunningCommandWithDockerCompose(t *testing.T) {
tester, err := NewBootstrapTester()
if err != nil {
t.Fatal(err)
t.Fatalf("NewBootstrapTester() error = %v", err)
}
defer tester.Close()

Expand Down Expand Up @@ -158,7 +158,7 @@ func TestRunningCommandWithDockerCompose(t *testing.T) {
func TestRunningFailingCommandWithDockerCompose(t *testing.T) {
tester, err := NewBootstrapTester()
if err != nil {
t.Fatal(err)
t.Fatalf("NewBootstrapTester() error = %v", err)
}
defer tester.Close()

Expand Down Expand Up @@ -189,7 +189,7 @@ func TestRunningFailingCommandWithDockerCompose(t *testing.T) {
expectCommandHooks("1", t, tester)

if err = tester.Run(t, env...); err == nil {
t.Fatal("Expected bootstrap to fail")
t.Fatalf("tester.Run(t, %v) = %v, want non-nil error", env, err)
}

tester.CheckMocks(t)
Expand All @@ -198,7 +198,7 @@ func TestRunningFailingCommandWithDockerCompose(t *testing.T) {
func TestRunningCommandWithDockerComposeAndExtraConfig(t *testing.T) {
tester, err := NewBootstrapTester()
if err != nil {
t.Fatal(err)
t.Fatalf("NewBootstrapTester() error = %v", err)
}
defer tester.Close()

Expand Down Expand Up @@ -232,7 +232,7 @@ func TestRunningCommandWithDockerComposeAndExtraConfig(t *testing.T) {
func TestRunningCommandWithDockerComposeAndBuildAll(t *testing.T) {
tester, err := NewBootstrapTester()
if err != nil {
t.Fatal(err)
t.Fatalf("NewBootstrapTester() error = %v", err)
}
defer tester.Close()

Expand Down Expand Up @@ -261,9 +261,8 @@ func expectCommandHooks(exitStatus string, t *testing.T, tester *BootstrapTester
tester.ExpectLocalHook("post-command").Once()

preExitFunc := func(c *bintest.Call) {
cmdExitStatus := c.GetEnv(`BUILDKITE_COMMAND_EXIT_STATUS`)
if cmdExitStatus != exitStatus {
t.Errorf("Expected an exit status of %s, got %v", exitStatus, cmdExitStatus)
if got, want := c.GetEnv("BUILDKITE_COMMAND_EXIT_STATUS"), exitStatus; got != want {
t.Errorf("c.GetEnv(BUILDKITE_COMMAND_EXIT_STATUS) = %q, want %q", got, want)
}
c.Exit(0)
}
Expand Down
Loading

0 comments on commit 9a8b6b8

Please sign in to comment.