Skip to content

Commit dea754e

Browse files
committed
fix: output debug log if manifest file changes but manifest source is remote
1 parent 4ff1172 commit dea754e

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

internal/pkg/platform/localserver.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,10 @@ func (r *LocalServer) WatchManifest(ctx context.Context, auth types.SlackAuth, a
365365
return err
366366
}
367367

368-
// Skip manifest watching if manifest source is remote
369-
if manifestSource.Equals(config.ManifestSourceRemote) {
370-
r.clients.IO.PrintDebug(ctx, "Manifest watching disabled: manifest.source is set to remote")
371-
// Block until context is cancelled to keep the goroutine alive
372-
<-ctx.Done()
373-
return nil
368+
// Check if manifest source is remote - we'll still watch but only log changes
369+
isRemoteManifest := manifestSource.Equals(config.ManifestSourceRemote)
370+
if isRemoteManifest {
371+
r.clients.IO.PrintDebug(ctx, "Manifest source is remote - file changes will be logged only")
374372
}
375373

376374
// Get manifest watch configuration
@@ -396,8 +394,7 @@ func (r *LocalServer) WatchManifest(ctx context.Context, auth types.SlackAuth, a
396394
// Add provided paths to watcher
397395
for _, path := range paths {
398396
if err := w.AddRecursive(path); err != nil {
399-
r.log.Data["cloud_run_watch_error"] = fmt.Sprintf("manifest_watcher.paths: %s", err)
400-
r.log.Warn("on_cloud_run_watch_error")
397+
r.clients.IO.PrintDebug(ctx, "Skipping watch path %s: %s", path, err)
401398
}
402399
}
403400

@@ -409,15 +406,19 @@ func (r *LocalServer) WatchManifest(ctx context.Context, auth types.SlackAuth, a
409406
r.clients.IO.PrintDebug(ctx, "Manifest file watcher context canceled, returning.")
410407
return
411408
case event := <-w.Event:
412-
r.log.Data["cloud_run_watch_manifest_change"] = event.Path
413-
r.log.Info("on_cloud_run_watch_manifest_change")
414-
415-
// Reinstall the app when manifest changes
416-
if _, _, _, err := apps.InstallLocalApp(ctx, r.clients, "", r.log, auth, app); err != nil {
417-
r.log.Data["cloud_run_watch_error"] = err.Error()
418-
r.log.Warn("on_cloud_run_watch_error")
409+
if isRemoteManifest {
410+
r.clients.IO.PrintDebug(ctx, "Manifest file changed but not updating app because manifest.source=remote: %s", event.Path)
419411
} else {
420-
r.log.Info("on_cloud_run_watch_manifest_change_reinstalled")
412+
r.log.Data["cloud_run_watch_manifest_change"] = event.Path
413+
r.log.Info("on_cloud_run_watch_manifest_change")
414+
415+
// Reinstall the app when manifest changes
416+
if _, _, _, err := apps.InstallLocalApp(ctx, r.clients, "", r.log, auth, app); err != nil {
417+
r.log.Data["cloud_run_watch_error"] = err.Error()
418+
r.log.Warn("on_cloud_run_watch_error")
419+
} else {
420+
r.log.Info("on_cloud_run_watch_manifest_change_reinstalled")
421+
}
421422
}
422423
case err := <-w.Error:
423424
r.log.Data["cloud_run_watch_error"] = err.Error()
@@ -474,8 +475,7 @@ func (r *LocalServer) WatchApp(ctx context.Context) error {
474475
// Add provided paths to watcher
475476
for _, path := range paths {
476477
if err := w.AddRecursive(path); err != nil {
477-
r.log.Data["cloud_run_watch_error"] = fmt.Sprintf("app_watcher.paths: %s", err)
478-
r.log.Warn("on_cloud_run_watch_error")
478+
r.clients.IO.PrintDebug(ctx, "Skipping watch path %s: %s", path, err)
479479
}
480480
}
481481

0 commit comments

Comments
 (0)