github.com/grahambrereton-form3/tilt@v0.10.18/internal/hud/webview/analytics_nudge.go (about)

     1  package webview
     2  
     3  import (
     4  	"github.com/windmilleng/wmclient/pkg/analytics"
     5  
     6  	"github.com/windmilleng/tilt/internal/store"
     7  )
     8  
     9  func NeedsNudge(st store.EngineState) bool {
    10  	if st.AnalyticsEffectiveOpt() != analytics.OptDefault {
    11  		// already opted in/out
    12  		return false
    13  	}
    14  
    15  	manifestTargs := st.ManifestTargets
    16  	if len(manifestTargs) == 0 {
    17  		return false
    18  	}
    19  
    20  	for _, targ := range manifestTargs {
    21  		if targ.Manifest.IsUnresourcedYAMLManifest() {
    22  			continue
    23  		}
    24  
    25  		if !targ.State.LastSuccessfulDeployTime.IsZero() {
    26  			// A resource has been green at some point
    27  			return true
    28  		}
    29  	}
    30  	return false
    31  }