diff --git a/cli/internal/runcache/runcache.go b/cli/internal/runcache/runcache.go index 0e48f7130ab8c..2958375d04669 100644 --- a/cli/internal/runcache/runcache.go +++ b/cli/internal/runcache/runcache.go @@ -158,7 +158,13 @@ func (tc *TaskCache) RestoreOutputs(ctx context.Context, prefixedUI *cli.Prefixe Source: cache.CacheSourceFS, TimeSaved: timeSavedFromDaemon, } - prefixedUI.Warn(fmt.Sprintf("Skipping cache check for %v, outputs have not changed since previous run.", tc.pt.TaskID)) + } + + // Some more context to add into the cache hit messages. + // This isn't the cleanest way to update the log message, so we should revisit during Rust port. + moreContext := "" + if !hasChangedOutputs { + moreContext = " (outputs already on disk)" } switch tc.taskOutputMode { @@ -166,10 +172,10 @@ func (tc *TaskCache) RestoreOutputs(ctx context.Context, prefixedUI *cli.Prefixe case util.NewTaskOutput: fallthrough case util.HashTaskOutput: - prefixedUI.Info(fmt.Sprintf("cache hit, suppressing output %s", ui.Dim(tc.hash))) + prefixedUI.Info(fmt.Sprintf("cache hit%s, suppressing logs %s", moreContext, ui.Dim(tc.hash))) case util.FullTaskOutput: progressLogger.Debug("log file", "path", tc.LogFileName) - prefixedUI.Info(fmt.Sprintf("cache hit, replaying output %s", ui.Dim(tc.hash))) + prefixedUI.Info(fmt.Sprintf("cache hit%s, replaying logs %s", moreContext, ui.Dim(tc.hash))) tc.ReplayLogFile(prefixedUI, progressLogger) case util.ErrorTaskOutput: // The task succeeded, so we don't output anything in this case diff --git a/docs/pages/repo/docs/getting-started/create-new.mdx b/docs/pages/repo/docs/getting-started/create-new.mdx index 9bb4b23754773..24fc2cc9fae94 100644 --- a/docs/pages/repo/docs/getting-started/create-new.mdx +++ b/docs/pages/repo/docs/getting-started/create-new.mdx @@ -403,7 +403,7 @@ When we run `turbo lint`, Turborepo looks at each `lint` script in each workspac Let's run our `lint` script one more time. You'll notice a few new things appear in the terminal: -1. `cache hit, replaying output` appears for `docs:lint`, `web:lint` and `ui:lint`. +1. `cache hit, replaying logs` appears for `docs:lint`, `web:lint` and `ui:lint`. 2. You'll see `3 cached, 3 total`. 3. The total runtime should be under `100ms`, and `>>> FULL TURBO` appears. diff --git a/turborepo-tests/e2e/index.ts b/turborepo-tests/e2e/index.ts index 23f6c90e3db4c..0dba894bca48e 100644 --- a/turborepo-tests/e2e/index.ts +++ b/turborepo-tests/e2e/index.ts @@ -380,7 +380,7 @@ function runSmokeTests( assert.ok( sinceCommandSecondRunOutput.includes( - `b:build: cache hit, suppressing output ${getHashFromOutput( + `b:build: cache hit, suppressing logs ${getHashFromOutput( sinceCommandSecondRunOutput, "b#build" )}` @@ -390,7 +390,7 @@ function runSmokeTests( assert.ok( sinceCommandSecondRunOutput.includes( - `a:test: cache hit, suppressing output ${getHashFromOutput( + `a:test: cache hit, suppressing logs ${getHashFromOutput( sinceCommandSecondRunOutput, "a#test" )}` @@ -418,7 +418,7 @@ function runSmokeTests( ); assert.ok( lintOutput.includes( - `a:lint: cache hit, suppressing output ${getHashFromOutput( + `a:lint: cache hit, suppressing logs ${getHashFromOutput( lintOutput, "a#lint" )}` @@ -446,7 +446,7 @@ function runSmokeTests( ); assert.ok( secondLintRun.includes( - `a:lint: cache hit, suppressing output ${getHashFromOutput( + `a:lint: cache hit, suppressing logs ${getHashFromOutput( secondLintRun, "a#lint" )}` @@ -509,9 +509,9 @@ function runSmokeTests( ); assert.ok( commandOnceBHasChangedOutput.findIndex((l) => - l.startsWith("c:test: cache hit, replaying output") + l.startsWith("c:test: cache hit, replaying logs") ) >= 0, - "After running, changing source of b, and running `turbo run test` again, should print `c:test: cache hit, replaying output` since c should not be impacted by changes to b" + "After running, changing source of b, and running `turbo run test` again, should print `c:test: cache hit, replaying logs` since c should not be impacted by changes to b" ); const scopeCommandOutput = getCommandOutputAsArray( @@ -547,7 +547,7 @@ function runSmokeTests( ); assert.ok( secondPass.includes( - `//:special: cache hit, suppressing output ${getHashFromOutput( + `//:special: cache hit, suppressing logs ${getHashFromOutput( secondPass, "//#special" )}` diff --git a/turborepo-tests/integration/tests/global_env.t b/turborepo-tests/integration/tests/global_env.t index 48102b48577c0..b049da0916c02 100644 --- a/turborepo-tests/integration/tests/global_env.t +++ b/turborepo-tests/integration/tests/global_env.t @@ -20,7 +20,7 @@ Setup \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 hit, suppressing output 76ab904c7ecb2d51 + util:build: cache hit, suppressing logs 76ab904c7ecb2d51 Tasks: 1 successful, 1 total Cached: 1 cached, 1 total @@ -42,7 +42,7 @@ Setup \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 hit, suppressing output 76ab904c7ecb2d51 + util:build: cache hit, suppressing logs 76ab904c7ecb2d51 Tasks: 1 successful, 1 total Cached: 1 cached, 1 total diff --git a/turborepo-tests/integration/tests/lockfile_aware_caching/berry.t b/turborepo-tests/integration/tests/lockfile_aware_caching/berry.t index 0019aef5582a6..f8abbee558046 100644 --- a/turborepo-tests/integration/tests/lockfile_aware_caching/berry.t +++ b/turborepo-tests/integration/tests/lockfile_aware_caching/berry.t @@ -34,7 +34,7 @@ Only b should have a cache miss \xe2\x80\xa2 Packages in scope: a (esc) \xe2\x80\xa2 Running build in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - a:build: cache hit, replaying output [0-9a-f]+ (re) + a:build: cache hit, replaying logs [0-9a-f]+ (re) a:build: building Tasks: 1 successful, 1 total diff --git a/turborepo-tests/integration/tests/lockfile_aware_caching/npm.t b/turborepo-tests/integration/tests/lockfile_aware_caching/npm.t index 0ec4943b9431c..172bfc5168f19 100644 --- a/turborepo-tests/integration/tests/lockfile_aware_caching/npm.t +++ b/turborepo-tests/integration/tests/lockfile_aware_caching/npm.t @@ -42,7 +42,7 @@ Only b should have a cache miss \xe2\x80\xa2 Packages in scope: a (esc) \xe2\x80\xa2 Running build in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - a:build: cache hit, replaying output [0-9a-f]+ (re) + a:build: cache hit, replaying logs [0-9a-f]+ (re) a:build: a:build: > build a:build: > echo 'building' diff --git a/turborepo-tests/integration/tests/lockfile_aware_caching/pnpm.t b/turborepo-tests/integration/tests/lockfile_aware_caching/pnpm.t index 7dee557250c3a..9559c6508f5de 100644 --- a/turborepo-tests/integration/tests/lockfile_aware_caching/pnpm.t +++ b/turborepo-tests/integration/tests/lockfile_aware_caching/pnpm.t @@ -42,7 +42,7 @@ Only b should have a cache miss \xe2\x80\xa2 Packages in scope: a (esc) \xe2\x80\xa2 Running build in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - a:build: cache hit, replaying output [0-9a-f]+ (re) + a:build: cache hit, replaying logs [0-9a-f]+ (re) a:build: a:build: > a@ build .*/apps/a (re) a:build: > echo 'building' diff --git a/turborepo-tests/integration/tests/lockfile_aware_caching/yarn.t b/turborepo-tests/integration/tests/lockfile_aware_caching/yarn.t index 4ea6798838631..e77740e2d49f6 100644 --- a/turborepo-tests/integration/tests/lockfile_aware_caching/yarn.t +++ b/turborepo-tests/integration/tests/lockfile_aware_caching/yarn.t @@ -42,7 +42,7 @@ Only b should have a cache miss \xe2\x80\xa2 Packages in scope: a (esc) \xe2\x80\xa2 Running build in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - a:build: cache hit, replaying output [0-9a-f]+ (re) + a:build: cache hit, replaying logs [0-9a-f]+ (re) a:build: yarn run v1.22.19 a:build: warning package.json: No license field a:build: $ echo 'building' diff --git a/turborepo-tests/integration/tests/run-caching/excluded-inputs.t b/turborepo-tests/integration/tests/run-caching/excluded-inputs.t index fb2f15848e4c3..882e9dd8982c8 100644 --- a/turborepo-tests/integration/tests/run-caching/excluded-inputs.t +++ b/turborepo-tests/integration/tests/run-caching/excluded-inputs.t @@ -24,7 +24,7 @@ Update exluded file and try again \xe2\x80\xa2 Packages in scope: my-app (esc) \xe2\x80\xa2 Running build in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - my-app:build: cache hit, replaying output ba39dbae281ef72a + my-app:build: cache hit, replaying logs ba39dbae281ef72a my-app:build: my-app:build: > build my-app:build: > echo 'building' diff --git a/turborepo-tests/integration/tests/run-logging/log_prefix.t b/turborepo-tests/integration/tests/run-logging/log_prefix.t index 9258e3b9202c6..c8b1096a1e778 100644 --- a/turborepo-tests/integration/tests/run-logging/log_prefix.t +++ b/turborepo-tests/integration/tests/run-logging/log_prefix.t @@ -31,7 +31,7 @@ Setup \xe2\x80\xa2 Packages in scope: app-a (esc) \xe2\x80\xa2 Running build in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - cache hit, replaying output 906851cd5c1e12d4 + cache hit, replaying logs 906851cd5c1e12d4 \> build (re) \> echo 'build app-a' (re) @@ -47,7 +47,7 @@ Setup \xe2\x80\xa2 Packages in scope: app-a (esc) \xe2\x80\xa2 Running build in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - app-a:build: cache hit, replaying output 906851cd5c1e12d4 + app-a:build: cache hit, replaying logs 906851cd5c1e12d4 app-a:build: app-a:build: > build app-a:build: > echo 'build app-a' diff --git a/turborepo-tests/integration/tests/run/force.t b/turborepo-tests/integration/tests/run/force.t index b178fa7bc0586..d6fad68590e7a 100644 --- a/turborepo-tests/integration/tests/run/force.t +++ b/turborepo-tests/integration/tests/run/force.t @@ -59,7 +59,7 @@ baseline to generate cache \xe2\x80\xa2 Packages in scope: my-app (esc) \xe2\x80\xa2 Running build in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - my-app:build: cache hit, suppressing output 0d1e6ee2c143211c + my-app:build: cache hit, suppressing logs 0d1e6ee2c143211c Tasks: 1 successful, 1 total Cached: 1 cached, 1 total @@ -82,7 +82,7 @@ baseline to generate cache \xe2\x80\xa2 Packages in scope: my-app (esc) \xe2\x80\xa2 Running build in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - my-app:build: cache hit, suppressing output 0d1e6ee2c143211c + my-app:build: cache hit, suppressing logs 0d1e6ee2c143211c Tasks: 1 successful, 1 total Cached: 1 cached, 1 total @@ -104,7 +104,7 @@ baseline to generate cache \xe2\x80\xa2 Packages in scope: my-app (esc) \xe2\x80\xa2 Running build in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - my-app:build: cache hit, suppressing output 0d1e6ee2c143211c + my-app:build: cache hit, suppressing logs 0d1e6ee2c143211c Tasks: 1 successful, 1 total Cached: 1 cached, 1 total @@ -127,7 +127,7 @@ baseline to generate cache \xe2\x80\xa2 Packages in scope: my-app (esc) \xe2\x80\xa2 Running build in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - my-app:build: cache hit, suppressing output 0d1e6ee2c143211c + my-app:build: cache hit, suppressing logs 0d1e6ee2c143211c Tasks: 1 successful, 1 total Cached: 1 cached, 1 total @@ -149,7 +149,7 @@ baseline to generate cache \xe2\x80\xa2 Packages in scope: my-app (esc) \xe2\x80\xa2 Running build in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - my-app:build: cache hit, suppressing output 0d1e6ee2c143211c + my-app:build: cache hit, suppressing logs 0d1e6ee2c143211c Tasks: 1 successful, 1 total Cached: 1 cached, 1 total diff --git a/turborepo-tests/integration/tests/run/one-script-error.t b/turborepo-tests/integration/tests/run/one-script-error.t index d824e9d933929..41be7a86757cb 100644 --- a/turborepo-tests/integration/tests/run/one-script-error.t +++ b/turborepo-tests/integration/tests/run/one-script-error.t @@ -39,7 +39,7 @@ Make sure error isn't cached \xe2\x80\xa2 Packages in scope: my-app (esc) \xe2\x80\xa2 Running error in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - my-app:okay: cache hit, replaying output 9365dd2ae80cb6fb + my-app:okay: cache hit, replaying logs 9365dd2ae80cb6fb my-app:okay: my-app:okay: > okay my-app:okay: > echo 'working' @@ -70,7 +70,7 @@ Make sure error code isn't swallowed with continue \xe2\x80\xa2 Packages in scope: my-app (esc) \xe2\x80\xa2 Running okay2 in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - my-app:okay: cache hit, replaying output 9365dd2ae80cb6fb + my-app:okay: cache hit, replaying logs 9365dd2ae80cb6fb my-app:okay: my-app:okay: > okay my-app:okay: > echo 'working' diff --git a/turborepo-tests/integration/tests/single_package/run-yarn.t b/turborepo-tests/integration/tests/single_package/run-yarn.t index ef9bfe8f1f565..63f9d794c2cfb 100644 --- a/turborepo-tests/integration/tests/single_package/run-yarn.t +++ b/turborepo-tests/integration/tests/single_package/run-yarn.t @@ -23,7 +23,7 @@ Check $ ${TURBO} run build \xe2\x80\xa2 Running build (esc) \xe2\x80\xa2 Remote caching disabled (esc) - build: cache hit, replaying output 95dd1b2d0d9ded60 + build: cache hit, replaying logs 95dd1b2d0d9ded60 build: yarn run v1.22.17 build: warning package.json: No license field build: $ echo 'building' > foo diff --git a/turborepo-tests/integration/tests/single_package/run.t b/turborepo-tests/integration/tests/single_package/run.t index b5135cfe4c4e0..41e31a535e737 100644 --- a/turborepo-tests/integration/tests/single_package/run.t +++ b/turborepo-tests/integration/tests/single_package/run.t @@ -23,7 +23,7 @@ Run a second time, verify caching works because there is a config $ ${TURBO} run build --single-package \xe2\x80\xa2 Running build (esc) \xe2\x80\xa2 Remote caching disabled (esc) - build: cache hit, replaying output 9d6c858db9fd1eea + build: cache hit, replaying logs 9d6c858db9fd1eea build: build: > build build: > echo 'building' > foo diff --git a/turborepo-tests/integration/tests/single_package/with-deps-run.t b/turborepo-tests/integration/tests/single_package/with-deps-run.t index 810c4475616a2..19ab874817c11 100644 --- a/turborepo-tests/integration/tests/single_package/with-deps-run.t +++ b/turborepo-tests/integration/tests/single_package/with-deps-run.t @@ -25,12 +25,12 @@ Run a second time, verify caching works because there is a config $ ${TURBO} run test \xe2\x80\xa2 Running test (esc) \xe2\x80\xa2 Remote caching disabled (esc) - build: cache hit, replaying output fdb18de339449827 + build: cache hit, replaying logs fdb18de339449827 build: build: > build build: > echo 'building' > foo build: - test: cache hit, replaying output a39dd654f9f3f6a7 + test: cache hit, replaying logs a39dd654f9f3f6a7 test: test: > test test: > [[ ( -f foo ) && $(cat foo) == 'building' ]] @@ -44,8 +44,8 @@ Run with --output-logs=hash-only $ ${TURBO} run test --output-logs=hash-only \xe2\x80\xa2 Running test (esc) \xe2\x80\xa2 Remote caching disabled (esc) - build: cache hit, suppressing output fdb18de339449827 - test: cache hit, suppressing output a39dd654f9f3f6a7 + build: cache hit, suppressing logs fdb18de339449827 + test: cache hit, suppressing logs a39dd654f9f3f6a7 Tasks: 2 successful, 2 total Cached: 2 cached, 2 total diff --git a/turborepo-tests/integration/tests/workspace-configs/add-keys.t b/turborepo-tests/integration/tests/workspace-configs/add-keys.t index 9cfe40be26461..5a869b06f116b 100644 --- a/turborepo-tests/integration/tests/workspace-configs/add-keys.t +++ b/turborepo-tests/integration/tests/workspace-configs/add-keys.t @@ -43,13 +43,13 @@ Setup \xe2\x80\xa2 Packages in scope: add-keys (esc) \xe2\x80\xa2 Running add-keys-task in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - add-keys:add-keys-underlying-task: cache hit, replaying output 247f839d50093833 + add-keys:add-keys-underlying-task: cache hit, replaying logs 247f839d50093833 add-keys:add-keys-underlying-task: add-keys:add-keys-underlying-task: > add-keys-underlying-task add-keys:add-keys-underlying-task: > echo "running add-keys-underlying-task" add-keys:add-keys-underlying-task: add-keys:add-keys-underlying-task: running add-keys-underlying-task - add-keys:add-keys-task: cache hit, suppressing output be69dcce790fb9c2 + add-keys:add-keys-task: cache hit, suppressing logs be69dcce790fb9c2 Tasks: 2 successful, 2 total Cached: 2 cached, 2 total @@ -82,7 +82,7 @@ Setup \xe2\x80\xa2 Packages in scope: add-keys (esc) \xe2\x80\xa2 Running add-keys-task in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - add-keys:add-keys-underlying-task: cache hit, replaying output ba66b7cb11224e10 + add-keys:add-keys-underlying-task: cache hit, replaying logs ba66b7cb11224e10 add-keys:add-keys-underlying-task: add-keys:add-keys-underlying-task: > add-keys-underlying-task add-keys:add-keys-underlying-task: > echo "running add-keys-underlying-task" diff --git a/turborepo-tests/integration/tests/workspace-configs/missing-workspace-config.t b/turborepo-tests/integration/tests/workspace-configs/missing-workspace-config.t index 874a958d531f1..035788bae2db8 100644 --- a/turborepo-tests/integration/tests/workspace-configs/missing-workspace-config.t +++ b/turborepo-tests/integration/tests/workspace-configs/missing-workspace-config.t @@ -34,7 +34,7 @@ Setup \xe2\x80\xa2 Packages in scope: missing-workspace-config (esc) \xe2\x80\xa2 Running missing-workspace-config-task in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - missing-workspace-config:missing-workspace-config-task: cache hit, suppressing output 3b9c040c7ac66cfd + missing-workspace-config:missing-workspace-config-task: cache hit, suppressing logs 3b9c040c7ac66cfd Tasks: 1 successful, 1 total Cached: 1 cached, 1 total @@ -63,7 +63,7 @@ Setup \xe2\x80\xa2 Packages in scope: missing-workspace-config (esc) \xe2\x80\xa2 Running missing-workspace-config-task in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - missing-workspace-config:missing-workspace-config-task: cache hit, suppressing output 395c409c711b5ddd + missing-workspace-config:missing-workspace-config-task: cache hit, suppressing logs 395c409c711b5ddd Tasks: 1 successful, 1 total Cached: 1 cached, 1 total diff --git a/turborepo-tests/integration/tests/workspace-configs/omit-keys.t b/turborepo-tests/integration/tests/workspace-configs/omit-keys.t index 45e63ec65bc5c..3d30949073f75 100644 --- a/turborepo-tests/integration/tests/workspace-configs/omit-keys.t +++ b/turborepo-tests/integration/tests/workspace-configs/omit-keys.t @@ -37,7 +37,7 @@ Setup \xe2\x80\xa2 Packages in scope: omit-keys (esc) \xe2\x80\xa2 Running omit-keys-task in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - omit-keys:omit-keys-task: cache hit, suppressing output b5601a9434941180 + omit-keys:omit-keys-task: cache hit, suppressing logs b5601a9434941180 Tasks: 1 successful, 1 total Cached: 1 cached, 1 total @@ -66,7 +66,7 @@ Setup \xe2\x80\xa2 Packages in scope: omit-keys (esc) \xe2\x80\xa2 Running omit-keys-task in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - omit-keys:omit-keys-task: cache hit, suppressing output d6273078707d2688 + omit-keys:omit-keys-task: cache hit, suppressing logs d6273078707d2688 Tasks: 1 successful, 1 total Cached: 1 cached, 1 total diff --git a/turborepo-tests/integration/tests/workspace-configs/override-values.t b/turborepo-tests/integration/tests/workspace-configs/override-values.t index 2f898c15d6be9..a58ab5a3b2ef6 100644 --- a/turborepo-tests/integration/tests/workspace-configs/override-values.t +++ b/turborepo-tests/integration/tests/workspace-configs/override-values.t @@ -34,7 +34,7 @@ Setup \xe2\x80\xa2 Packages in scope: override-values (esc) \xe2\x80\xa2 Running override-values-task in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - override-values:override-values-task: cache hit, replaying output 676bf15624566937 + override-values:override-values-task: cache hit, replaying logs 676bf15624566937 override-values:override-values-task: override-values:override-values-task: > override-values-task override-values:override-values-task: > echo "running override-values-task" > lib/bar.min.txt @@ -66,7 +66,7 @@ Setup \xe2\x80\xa2 Packages in scope: override-values (esc) \xe2\x80\xa2 Running override-values-task in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - override-values:override-values-task: cache hit, replaying output 04f174d88e33b365 + override-values:override-values-task: cache hit, replaying logs 04f174d88e33b365 override-values:override-values-task: override-values:override-values-task: > override-values-task override-values:override-values-task: > echo "running override-values-task" > lib/bar.min.txt @@ -96,7 +96,7 @@ Setup \xe2\x80\xa2 Packages in scope: override-values (esc) \xe2\x80\xa2 Running override-values-task in 1 packages (esc) \xe2\x80\xa2 Remote caching disabled (esc) - override-values:override-values-task: cache hit, replaying output bb2616d0a2d6716c + override-values:override-values-task: cache hit, replaying logs bb2616d0a2d6716c override-values:override-values-task: override-values:override-values-task: > override-values-task override-values:override-values-task: > echo "running override-values-task" > lib/bar.min.txt