From c3a6c677f80548bd0f288305101c93909557ada6 Mon Sep 17 00:00:00 2001 From: Sachin Patel <989367+sppatel@users.noreply.github.com> Date: Wed, 21 Sep 2022 21:33:57 -0400 Subject: [PATCH] consistent rename to ItemState --- cli/internal/cache/cache.go | 6 +++--- cli/internal/cache/cache_test.go | 8 ++++---- cli/internal/run/run.go | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/internal/cache/cache.go b/cli/internal/cache/cache.go index c35bdd1267530..57387fb3ef70b 100644 --- a/cli/internal/cache/cache.go +++ b/cli/internal/cache/cache.go @@ -282,12 +282,12 @@ func (mplex *cacheMultiplexer) Fetch(target string, key string, files []string) func (mplex *cacheMultiplexer) Exists(target string) (ItemStatus, error) { syncCacheState := ItemStatus{} for _, cache := range mplex.caches { - cacheState, err := cache.Exists(target) + itemStatus, err := cache.Exists(target) if err != nil { return syncCacheState, err } - syncCacheState.Local = syncCacheState.Local || cacheState.Local - syncCacheState.Remote = syncCacheState.Remote || cacheState.Remote + syncCacheState.Local = syncCacheState.Local || itemStatus.Local + syncCacheState.Remote = syncCacheState.Remote || itemStatus.Remote } return syncCacheState, nil diff --git a/cli/internal/cache/cache_test.go b/cli/internal/cache/cache_test.go index ae409bb654cf5..efaa7a65672ff 100644 --- a/cli/internal/cache/cache_test.go +++ b/cli/internal/cache/cache_test.go @@ -128,11 +128,11 @@ func TestExists(t *testing.T) { caches: caches, } - cacheState, err := mplex.Exists("some-hash") + itemStatus, err := mplex.Exists("some-hash") if err != nil { t.Errorf("got error verifying files: %v", err) } - if cacheState.Local { + if itemStatus.Local { t.Error("did not expect file to exist") } @@ -142,11 +142,11 @@ func TestExists(t *testing.T) { t.Errorf("Put got error %v, want ", err) } - cacheState, err = mplex.Exists("some-hash") + itemStatus, err = mplex.Exists("some-hash") if err != nil { t.Errorf("got error verifying files: %v", err) } - if !cacheState.Local { + if !itemStatus.Local { t.Error("failed to find previously stored files") } } diff --git a/cli/internal/run/run.go b/cli/internal/run/run.go index 90eab6ea05b2c..f2c92285447b9 100644 --- a/cli/internal/run/run.go +++ b/cli/internal/run/run.go @@ -774,7 +774,7 @@ func (r *run) executeDryRun(ctx gocontext.Context, engine *core.Scheduler, g *co } sort.Strings(stringDescendents) - cacheState, err := turboCache.Exists(hash) + itemStatus, err := turboCache.Exists(hash) if err != nil { return err } @@ -784,7 +784,7 @@ func (r *run) executeDryRun(ctx gocontext.Context, engine *core.Scheduler, g *co Task: packageTask.Task, Package: packageTask.PackageName, Hash: hash, - CacheState: cacheState, + CacheState: itemStatus, Command: command, Dir: packageTask.Pkg.Dir.ToString(), Outputs: packageTask.TaskDefinition.Outputs,