diff --git a/internal/devwatch/watch.go b/internal/devwatch/watch.go index 8020c96e7..c181f07e9 100644 --- a/internal/devwatch/watch.go +++ b/internal/devwatch/watch.go @@ -390,7 +390,7 @@ func (s *Service) watchEvents(ctx context.Context, project *types.Project, optio batchEvents := watch.BatchDebounceEvents(ctx, watcher.Events()) scheduler := newRebuildScheduler(ctx, func(ctx context.Context, services []string) error { - return s.rebuild(ctx, project, services, options) + return s.Rebuild(ctx, project, services, options) }) // Rebuilds run asynchronously in their own goroutine(s); cancel first so // an in-flight one can unwind, then wait for it to settle so none @@ -667,10 +667,6 @@ func (s *Service) exec(ctx context.Context, project *types.Project, serviceName // Rebuild rebuilds the given services and converges what depends on them, as // the watch loop does when a rebuild trigger fires. func (s *Service) Rebuild(ctx context.Context, project *types.Project, services []string, options api.WatchOptions) error { - return s.rebuild(ctx, project, services, options) -} - -func (s *Service) rebuild(ctx context.Context, project *types.Project, services []string, options api.WatchOptions) error { options.LogTo.Log(api.WatchLogger, fmt.Sprintf("Rebuilding service(s) %q after changes were detected...", services)) // Work on a copy so concurrent watch events don't race on the shared // BuildOptions pointer carried by WatchOptions. diff --git a/pkg/compose/devwatch.go b/pkg/compose/devwatch.go index 1f4a78270..2b1436ac8 100644 --- a/pkg/compose/devwatch.go +++ b/pkg/compose/devwatch.go @@ -46,10 +46,6 @@ func (s *composeService) watch(ctx context.Context, project *types.Project, opti return s.devWatch().Watch(ctx, project, options) } -func (s *composeService) rebuild(ctx context.Context, project *types.Project, services []string, options api.WatchOptions) error { - return s.devWatch().Rebuild(ctx, project, services, options) -} - // devWatchBackend is the engine of a composeService, as internal/devwatch sees it. type devWatchBackend struct { engineBackend diff --git a/pkg/compose/lifecycle_wiring_test.go b/pkg/compose/lifecycle_wiring_test.go index 006d042ea..2ab94a406 100644 --- a/pkg/compose/lifecycle_wiring_test.go +++ b/pkg/compose/lifecycle_wiring_test.go @@ -238,7 +238,7 @@ func TestWatchRebuildTouchesTheRebuiltServiceAndItsDependentsOnly(t *testing.T) }) options := api.WatchOptions{Build: &api.BuildOptions{}, LogTo: &testLogConsumer{}} - assert.NilError(t, svc.rebuild(t.Context(), project, []string{"app"}, options)) + assert.NilError(t, svc.devWatch().Rebuild(t.Context(), project, []string{"app"}, options)) touchesService := func(name, kind string) bool { for id := range touched {