Skip to content

Commit

Permalink
cloud: discard suggested version from the server (#5763)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicks authored May 4, 2022
1 parent 3585fc6 commit 190a930
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 18 deletions.
8 changes: 3 additions & 5 deletions internal/cloud/cloud_status_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ type HttpClient interface {
}

type whoAmIResponse struct {
Found bool
Username string
TeamName string
SuggestedTiltVersion string
Found bool
Username string
TeamName string
}

func (c *CloudStatusManager) error() {
Expand Down Expand Up @@ -160,7 +159,6 @@ func (c *CloudStatusManager) CheckStatus(ctx context.Context, st store.RStore, c
Username: r.Username,
TeamName: r.TeamName,
IsPostRegistrationLookup: blocking,
SuggestedTiltVersion: r.SuggestedTiltVersion,
})
}

Expand Down
8 changes: 3 additions & 5 deletions internal/cloud/cloud_status_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ func TestWhoAmI(t *testing.T) {
f := newCloudStatusManagerTestFixture(t)

resp := whoAmIResponse{
Found: true,
Username: "myusername",
SuggestedTiltVersion: "10.0.0",
Found: true,
Username: "myusername",
}

if tc.teamID != "" {
Expand Down Expand Up @@ -80,7 +79,6 @@ func TestWhoAmI(t *testing.T) {
Found: true,
Username: "myusername",
IsPostRegistrationLookup: false,
SuggestedTiltVersion: "10.0.0",
}

if tc.teamID != "" {
Expand All @@ -105,7 +103,7 @@ func TestStatusRefresh(t *testing.T) {
req := f.waitForRequest(fmt.Sprintf("https://%s/api/whoami", testCloudAddress))
require.Equal(t, "test token", req.Header.Get(TiltTokenHeaderName))

expected := store.TiltCloudStatusReceivedAction{Username: "user1", Found: true, IsPostRegistrationLookup: false, SuggestedTiltVersion: "10.0.0"}
expected := store.TiltCloudStatusReceivedAction{Username: "user1", Found: true, IsPostRegistrationLookup: false}
a := store.WaitForAction(t, reflect.TypeOf(store.TiltCloudStatusReceivedAction{}), f.st.Actions)
require.Equal(t, expected, a)

Expand Down
2 changes: 0 additions & 2 deletions internal/engine/upper.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,6 @@ func handleTiltCloudStatusReceivedAction(state *store.EngineState, action store.
state.CloudStatus.Username = action.Username
state.CloudStatus.TeamName = action.TeamName
}

state.SuggestedTiltVersion = action.SuggestedTiltVersion
}

func handleUserStartedTiltCloudRegistrationAction(state *store.EngineState) {
Expand Down
1 change: 0 additions & 1 deletion internal/hud/webview/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ func ToUISession(s store.EngineState) *v1alpha1.UISession {
Dev: s.TiltBuildInfo.Dev,
Date: s.TiltBuildInfo.Date,
}
status.SuggestedTiltVersion = s.SuggestedTiltVersion
status.FeatureFlags = []v1alpha1.UIFeatureFlag{}
for k, v := range s.Features {
status.FeatureFlags = append(status.FeatureFlags, v1alpha1.UIFeatureFlag{
Expand Down
1 change: 0 additions & 1 deletion internal/store/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ type TiltCloudStatusReceivedAction struct {
Username string
TeamName string
IsPostRegistrationLookup bool
SuggestedTiltVersion string
}

func (TiltCloudStatusReceivedAction) Action() {}
Expand Down
3 changes: 1 addition & 2 deletions internal/store/engine_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ type EngineState struct {
// which we listen to for reload.
TiltfileConfigPaths map[model.ManifestName][]string

SuggestedTiltVersion string
VersionSettings model.VersionSettings
VersionSettings model.VersionSettings

// Analytics Info
AnalyticsEnvOpt analytics.Opt
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/core/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/apis/core/v1alpha1/uisession_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ type UISessionStatus struct {
// SuggestedTiltVersion tells the UI the recommended version for this
// user. If the version is different than what's running, the UI
// may display a prompt to upgrade.
//
// Deprecated: Tilt no longer uses suggested versions from cloud.tilt.dev.
//
// +optional
SuggestedTiltVersion string `json:"suggestedTiltVersion,omitempty" protobuf:"bytes,4,opt,name=suggestedTiltVersion"`

Expand Down
2 changes: 1 addition & 1 deletion pkg/openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/webview/view.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@
},
"suggestedTiltVersion": {
"type": "string",
"title": "SuggestedTiltVersion tells the UI the recommended version for this\nuser. If the version is different than what's running, the UI\nmay display a prompt to upgrade.\n+optional"
"description": "SuggestedTiltVersion tells the UI the recommended version for this\nuser. If the version is different than what's running, the UI\nmay display a prompt to upgrade.\n\nDeprecated: Tilt no longer uses suggested versions from cloud.tilt.dev.\n\n+optional"
},
"versionSettings": {
"$ref": "#/definitions/corev1alpha1VersionSettings",
Expand Down
9 changes: 9 additions & 0 deletions web/src/view.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,15 @@ declare namespace Proto {
featureFlags?: v1alpha1UIFeatureFlag[];
needsAnalyticsNudge?: boolean;
runningTiltBuild?: corev1alpha1TiltBuild;
/**
* SuggestedTiltVersion tells the UI the recommended version for this
* user. If the version is different than what's running, the UI
* may display a prompt to upgrade.
*
* Deprecated: Tilt no longer uses suggested versions from cloud.tilt.dev.
*
* +optional
*/
suggestedTiltVersion?: string;
versionSettings?: corev1alpha1VersionSettings;
tiltCloudUsername?: string;
Expand Down

0 comments on commit 190a930

Please sign in to comment.