@@ -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,20 @@ 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 .log .Data ["cloud_run_watch_manifest_change_skipped" ] = event .Path
411+ r .log .Info ("on_cloud_run_watch_manifest_change_skipped_remote" )
419412 } else {
420- r .log .Info ("on_cloud_run_watch_manifest_change_reinstalled" )
413+ r .log .Data ["cloud_run_watch_manifest_change" ] = event .Path
414+ r .log .Info ("on_cloud_run_watch_manifest_change" )
415+
416+ // Reinstall the app when manifest changes
417+ if _ , _ , _ , err := apps .InstallLocalApp (ctx , r .clients , "" , r .log , auth , app ); err != nil {
418+ r .log .Data ["cloud_run_watch_error" ] = err .Error ()
419+ r .log .Warn ("on_cloud_run_watch_error" )
420+ } else {
421+ r .log .Info ("on_cloud_run_watch_manifest_change_reinstalled" )
422+ }
421423 }
422424 case err := <- w .Error :
423425 r .log .Data ["cloud_run_watch_error" ] = err .Error ()
@@ -474,8 +476,7 @@ func (r *LocalServer) WatchApp(ctx context.Context) error {
474476 // Add provided paths to watcher
475477 for _ , path := range paths {
476478 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" )
479+ r .clients .IO .PrintDebug (ctx , "Skipping watch path %s: %s" , path , err )
479480 }
480481 }
481482
0 commit comments