From f2f0d62723919a340111b30b5daac37cba77fa29 Mon Sep 17 00:00:00 2001 From: Pete Davison Date: Wed, 1 Jul 2026 14:24:38 +0000 Subject: [PATCH] feat: remove experiment check for remote taskfiles --- internal/flags/flags.go | 23 ++++++++++------------- task_test.go | 4 ---- taskfile/node.go | 5 ----- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/internal/flags/flags.go b/internal/flags/flags.go index f1bf6c76..75673e30 100644 --- a/internal/flags/flags.go +++ b/internal/flags/flags.go @@ -155,6 +155,16 @@ func init() { pflag.BoolVarP(&Failfast, "failfast", "F", getConfig(config, "FAILFAST", func() *bool { return &config.Failfast }, false), "When running tasks in parallel, stop all tasks if one fails.") pflag.BoolVarP(&Global, "global", "g", false, "Runs global Taskfile, from $HOME/{T,t}askfile.{yml,yaml}.") pflag.BoolVar(&Experiments, "experiments", false, "Lists all the available experiments and whether or not they are enabled.") + pflag.BoolVar(&Download, "download", false, "Downloads a cached version of a remote Taskfile.") + pflag.BoolVar(&Offline, "offline", getConfig(config, "REMOTE_OFFLINE", func() *bool { return config.Remote.Offline }, false), "Forces Task to only use local or cached Taskfiles.") + pflag.StringSliceVar(&TrustedHosts, "trusted-hosts", getConfig(config, "REMOTE_TRUSTED_HOSTS", func() *[]string { return &config.Remote.TrustedHosts }, nil), "List of trusted hosts for remote Taskfiles (comma-separated).") + pflag.DurationVar(&Timeout, "timeout", getConfig(config, "REMOTE_TIMEOUT", func() *time.Duration { return config.Remote.Timeout }, time.Second*10), "Timeout for downloading remote Taskfiles.") + pflag.BoolVar(&ClearCache, "clear-cache", false, "Clear the remote cache.") + pflag.DurationVar(&CacheExpiryDuration, "expiry", getConfig(config, "REMOTE_CACHE_EXPIRY", func() *time.Duration { return config.Remote.CacheExpiry }, 0), "Expiry duration for cached remote Taskfiles.") + pflag.StringVar(&RemoteCacheDir, "remote-cache-dir", getConfig(config, "REMOTE_CACHE_DIR", func() *string { return config.Remote.CacheDir }, env.GetTaskEnv("REMOTE_DIR")), "Directory to cache remote Taskfiles.") + pflag.StringVar(&CACert, "cacert", getConfig(config, "REMOTE_CACERT", func() *string { return config.Remote.CACert }, ""), "Path to a custom CA certificate for HTTPS connections.") + pflag.StringVar(&Cert, "cert", getConfig(config, "REMOTE_CERT", func() *string { return config.Remote.Cert }, ""), "Path to a client certificate for HTTPS connections.") + pflag.StringVar(&CertKey, "cert-key", getConfig(config, "REMOTE_CERT_KEY", func() *string { return config.Remote.CertKey }, ""), "Path to a client certificate key for HTTPS connections.") // Gentle force experiment will override the force flag and add a new force-all flag if experiments.GentleForce.Enabled() { @@ -164,19 +174,6 @@ func init() { pflag.BoolVarP(&ForceAll, "force", "f", false, "Forces execution even when the task is up-to-date.") } - // Remote Taskfiles experiment will adds the "download" and "offline" flags - if experiments.RemoteTaskfiles.Enabled() { - pflag.BoolVar(&Download, "download", false, "Downloads a cached version of a remote Taskfile.") - pflag.BoolVar(&Offline, "offline", getConfig(config, "REMOTE_OFFLINE", func() *bool { return config.Remote.Offline }, false), "Forces Task to only use local or cached Taskfiles.") - pflag.StringSliceVar(&TrustedHosts, "trusted-hosts", getConfig(config, "REMOTE_TRUSTED_HOSTS", func() *[]string { return &config.Remote.TrustedHosts }, nil), "List of trusted hosts for remote Taskfiles (comma-separated).") - pflag.DurationVar(&Timeout, "timeout", getConfig(config, "REMOTE_TIMEOUT", func() *time.Duration { return config.Remote.Timeout }, time.Second*10), "Timeout for downloading remote Taskfiles.") - pflag.BoolVar(&ClearCache, "clear-cache", false, "Clear the remote cache.") - pflag.DurationVar(&CacheExpiryDuration, "expiry", getConfig(config, "REMOTE_CACHE_EXPIRY", func() *time.Duration { return config.Remote.CacheExpiry }, 0), "Expiry duration for cached remote Taskfiles.") - pflag.StringVar(&RemoteCacheDir, "remote-cache-dir", getConfig(config, "REMOTE_CACHE_DIR", func() *string { return config.Remote.CacheDir }, env.GetTaskEnv("REMOTE_DIR")), "Directory to cache remote Taskfiles.") - pflag.StringVar(&CACert, "cacert", getConfig(config, "REMOTE_CACERT", func() *string { return config.Remote.CACert }, ""), "Path to a custom CA certificate for HTTPS connections.") - pflag.StringVar(&Cert, "cert", getConfig(config, "REMOTE_CERT", func() *string { return config.Remote.Cert }, ""), "Path to a client certificate for HTTPS connections.") - pflag.StringVar(&CertKey, "cert-key", getConfig(config, "REMOTE_CERT_KEY", func() *string { return config.Remote.CertKey }, ""), "Path to a client certificate key for HTTPS connections.") - } pflag.Parse() // Auto-detect color based on environment when not explicitly configured diff --git a/task_test.go b/task_test.go index dd92f8ee..ccd5a283 100644 --- a/task_test.go +++ b/task_test.go @@ -1073,8 +1073,6 @@ func TestIncludesMultiLevel(t *testing.T) { } func TestIncludesRemote(t *testing.T) { - enableExperimentForTest(t, &experiments.RemoteTaskfiles, 1) - dir := "testdata/includes_remote" os.RemoveAll(filepath.Join(dir, ".task", "remote")) @@ -1277,8 +1275,6 @@ func TestIncludesEmptyMain(t *testing.T) { } func TestIncludesHttp(t *testing.T) { - enableExperimentForTest(t, &experiments.RemoteTaskfiles, 1) - dir, err := filepath.Abs("testdata/includes_http") require.NoError(t, err) diff --git a/taskfile/node.go b/taskfile/node.go index b02b9a16..c2aab839 100644 --- a/taskfile/node.go +++ b/taskfile/node.go @@ -8,8 +8,6 @@ import ( giturls "github.com/chainguard-dev/git-urls" - "github.com/go-task/task/v3/errors" - "github.com/go-task/task/v3/experiments" "github.com/go-task/task/v3/internal/fsext" ) @@ -67,9 +65,6 @@ func NewNode( default: node, err = NewFileNode(entrypoint, dir, opts...) } - if _, isRemote := node.(RemoteNode); isRemote && !experiments.RemoteTaskfiles.Enabled() { - return nil, errors.New("task: Remote taskfiles are not enabled. You can read more about this experiment and how to enable it at https://taskfile.dev/experiments/remote-taskfiles") - } return node, err }