From aacd7d683f6010ad7bfc68126e2b9b9c5e90b091 Mon Sep 17 00:00:00 2001 From: Nathan Hammond Date: Thu, 27 Apr 2023 15:21:19 +0800 Subject: [PATCH] Remove THASH. --- cli/internal/run/global_hash.go | 2 +- docs/pages/blog/turbo-1-1-0.mdx | 1 - docs/pages/repo/docs/core-concepts/caching.mdx | 2 -- turborepo-tests/integration/tests/global_env.t | 11 ----------- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/cli/internal/run/global_hash.go b/cli/internal/run/global_hash.go index 3dfcc5e401898..8f64cbb16a0f9 100644 --- a/cli/internal/run/global_hash.go +++ b/cli/internal/run/global_hash.go @@ -97,7 +97,7 @@ func calculateGlobalHash( envVars := []string{} envVars = append(envVars, envVarDependencies...) envVars = append(envVars, _defaultEnvVars...) - globalHashableEnvVars, err := env.GetHashableEnvVars(envVars, []string{".*THASH.*"}, "") + globalHashableEnvVars, err := env.GetHashableEnvVars(envVars, nil, "") if err != nil { return GlobalHashable{}, err } diff --git a/docs/pages/blog/turbo-1-1-0.mdx b/docs/pages/blog/turbo-1-1-0.mdx index d111a095bdb6c..31c05aabb848b 100644 --- a/docs/pages/blog/turbo-1-1-0.mdx +++ b/docs/pages/blog/turbo-1-1-0.mdx @@ -82,7 +82,6 @@ You can now control `turbo`'s [cache fingerprinting (a.k.a. hashing)](/repo/docs - Including environment variables in a `dependsOn` in your `pipeline` definition prefixed by a `$` will impact the cache fingerprint on a per-task or per-package-task basis. - Including environment variables in `globalDependencies` list prefixed by a `$` will impact the cache fingerprint of _all_ tasks. - Including files or globs of files in `globalDependencies` will impact the cache fingerprint of _all_ tasks. -- The value of any environment variable that includes `THASH` in its name will impact the cache fingerprint of _all_ tasks. ```jsonc { diff --git a/docs/pages/repo/docs/core-concepts/caching.mdx b/docs/pages/repo/docs/core-concepts/caching.mdx index b81597797be9e..d961bea4aa1b1 100644 --- a/docs/pages/repo/docs/core-concepts/caching.mdx +++ b/docs/pages/repo/docs/core-concepts/caching.mdx @@ -194,7 +194,6 @@ You can control `turbo`'s caching behavior based on the values of environment variables: - Including environment variables in the `env` key in your `pipeline` definition will impact the cache fingerprint on a per-task or per-workspace-task basis. -- The value of any environment variable that includes `THASH` in its name will impact the cache fingerprint of _all_ tasks. ```jsonc { @@ -432,7 +431,6 @@ By now, you're probably wondering how `turbo` decides what constitutes a cache h First, `turbo` constructs a hash of the current global state of the codebase: - The contents of any files that satisfy the glob patterns and any the values of environment variables listed in [`globalDependencies`](/repo/docs/reference/configuration#globalDependencies) -- The sorted list environment variable key-value pairs that include `THASH` _anywhere_ in their names (e.g. `STRIPE_PUBLIC_THASH_SECRET_KEY`, but not `STRIPE_PUBLIC_KEY`) Then it adds more factors relevant to a given workspace's task: diff --git a/turborepo-tests/integration/tests/global_env.t b/turborepo-tests/integration/tests/global_env.t index e77c2d6891d24..595114991146d 100644 --- a/turborepo-tests/integration/tests/global_env.t +++ b/turborepo-tests/integration/tests/global_env.t @@ -37,17 +37,6 @@ Setup Cached: 0 cached, 1 total Time:\s*[\.0-9]+m?s (re) -# set env var with "THASH" and ensure cache miss - $ SOMETHING_THASH_YES=hi ${TURBO} run build --filter=util --output-logs=hash-only - \xe2\x80\xa2 Packages in scope: util (esc) - \xe2\x80\xa2 Running build in 1 packages (esc) - \xe2\x80\xa2 Remote caching disabled (esc) - util:build: cache miss, executing c3c2acfea2980d29 - - Tasks: 1 successful, 1 total - Cached: 0 cached, 1 total - Time:\s*[\.0-9]+m?s (re) - # set vercel analytics env var and ensure cache miss $ VERCEL_ANALYTICS_ID=hi ${TURBO} run build --filter=util --output-logs=hash-only \xe2\x80\xa2 Packages in scope: util (esc)