Skip to content

Commit

Permalink
Merge pull request #3063 from buildkite/promote-polyglot-hooks
Browse files Browse the repository at this point in the history
Promote polyglot-hooks experiment to default
  • Loading branch information
DrJosh9000 authored Oct 31, 2024
2 parents 56c04ba + 917d75a commit cc4a028
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions internal/experiments/experiments.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const (
NormalisedUploadPaths = "normalised-upload-paths"
OverrideZeroExitOnCancel = "override-zero-exit-on-cancel"
PTYRaw = "pty-raw"
PolyglotHooks = "polyglot-hooks"
ResolveCommitAfterCheckout = "resolve-commit-after-checkout"
UseZZGlob = "use-zzglob"

Expand All @@ -43,6 +42,7 @@ const (
IsolatedPluginCheckout = "isolated-plugin-checkout"
JobAPI = "job-api"
KubernetesExec = "kubernetes-exec"
PolyglotHooks = "polyglot-hooks"
)

var (
Expand All @@ -53,7 +53,6 @@ var (
InterpolationPrefersRuntimeEnv: {},
NormalisedUploadPaths: {},
OverrideZeroExitOnCancel: {},
PolyglotHooks: {},
ResolveCommitAfterCheckout: {},
UseZZGlob: {},
}
Expand All @@ -67,6 +66,7 @@ var (
IsolatedPluginCheckout: standardPromotionMsg(IsolatedPluginCheckout, "v3.67.0"),
JobAPI: standardPromotionMsg(JobAPI, "v3.64.0"),
KubernetesExec: "The kubernetes-exec experiment has been replaced with the --kubernetes-exec flag as of agent v3.74.0",
PolyglotHooks: standardPromotionMsg(PolyglotHooks, "v3.85.0"),
}

// Used to track experiments possibly in use.
Expand Down
5 changes: 0 additions & 5 deletions internal/job/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

"github.com/buildkite/agent/v3/agent/plugin"
"github.com/buildkite/agent/v3/env"
"github.com/buildkite/agent/v3/internal/experiments"
"github.com/buildkite/agent/v3/internal/file"
"github.com/buildkite/agent/v3/internal/job/hook"
"github.com/buildkite/agent/v3/internal/job/shell"
Expand Down Expand Up @@ -347,10 +346,6 @@ func (e *Executor) executeHook(ctx context.Context, hookCfg HookConfig) error {

e.shell.Headerf("Running %s hook", hookName)

if !experiments.IsEnabled(ctx, experiments.PolyglotHooks) {
return e.runWrappedShellScriptHook(ctx, hookName, hookCfg)
}

hookType, err := hook.Type(hookCfg.Path)
if err != nil {
return fmt.Errorf("determining hook type for %q hook: %w", hookName, err)
Expand Down
4 changes: 1 addition & 3 deletions internal/job/integration/hooks_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"testing"
"time"

"github.com/buildkite/agent/v3/internal/experiments"
"github.com/buildkite/agent/v3/internal/job"

"github.com/buildkite/agent/v3/internal/job/shell"
Expand Down Expand Up @@ -579,7 +578,7 @@ func TestPolyglotScriptHooksCanBeRun(t *testing.T) {
t.Fatal("ruby not found in $PATH. This test requires ruby to be installed on the host")
}

ctx, _ := experiments.Enable(mainCtx, experiments.PolyglotHooks)
ctx := mainCtx

tester, err := NewExecutorTester(ctx)
if err != nil {
Expand Down Expand Up @@ -608,7 +607,6 @@ func TestPolyglotBinaryHooksCanBeRun(t *testing.T) {
t.Parallel()

ctx := mainCtx
ctx, _ = experiments.Enable(ctx, experiments.PolyglotHooks)

tester, err := NewExecutorTester(ctx)
if err != nil {
Expand Down

0 comments on commit cc4a028

Please sign in to comment.