diff --git a/components/common-go/experiments/flags.go b/components/common-go/experiments/flags.go index 0dba23354872fc..a34b0c4bdd3e4c 100644 --- a/components/common-go/experiments/flags.go +++ b/components/common-go/experiments/flags.go @@ -28,10 +28,3 @@ func SupervisorPersistServerAPIChannelWhenStart(ctx context.Context, client Clie func SupervisorUsePublicAPI(ctx context.Context, client Client, attributes Attributes) bool { return client.GetBoolValue(ctx, SupervisorUsePublicAPIFlag, false, attributes) } - -func SupervisorLiveGitStatus(ctx context.Context, client Client, attributes Attributes) bool { - if client == nil { - return false - } - return client.GetBoolValue(ctx, "supervisor_live_git_status", false, attributes) -} diff --git a/components/dashboard/src/components/PendingChangesDropdown.tsx b/components/dashboard/src/components/PendingChangesDropdown.tsx index 678706f220e309..a3cfa7ad9d25ce 100644 --- a/components/dashboard/src/components/PendingChangesDropdown.tsx +++ b/components/dashboard/src/components/PendingChangesDropdown.tsx @@ -4,19 +4,12 @@ * See License.AGPL.txt in the project root for license information. */ -import { WorkspaceInstance, WorkspaceInstanceRepoStatus } from "@gitpod/gitpod-protocol"; +import { WorkspaceInstance } from "@gitpod/gitpod-protocol"; import ContextMenu, { ContextMenuEntry } from "./ContextMenu"; import CaretDown from "../icons/CaretDown.svg"; -import { useFeatureFlag } from "../data/featureflag-query"; export default function PendingChangesDropdown(props: { workspaceInstance?: WorkspaceInstance }) { - const liveGitStatus = useFeatureFlag("supervisor_live_git_status"); - let repo: WorkspaceInstanceRepoStatus | undefined; - if (liveGitStatus) { - repo = props.workspaceInstance?.gitStatus; - } else { - repo = props.workspaceInstance?.status?.repo; - } + const repo = props.workspaceInstance?.gitStatus; const headingStyle = "text-gray-500 dark:text-gray-400 text-left"; const itemStyle = "text-gray-400 dark:text-gray-500 text-left -mt-5"; const menuEntries: ContextMenuEntry[] = []; diff --git a/components/dashboard/src/data/featureflag-query.ts b/components/dashboard/src/data/featureflag-query.ts index 74bfff814b1750..11582702624f89 100644 --- a/components/dashboard/src/data/featureflag-query.ts +++ b/components/dashboard/src/data/featureflag-query.ts @@ -22,7 +22,6 @@ const featureFlags = { doRetryUserLoader: true, // Local SSH feature of VS Code Desktop Extension gitpod_desktop_use_local_ssh_proxy: false, - supervisor_live_git_status: false, enabledOrbitalDiscoveries: "", newProjectIncrementalRepoSearchBBS: false, includeProjectsOnCreateWorkspace: false, diff --git a/components/dashboard/src/workspaces/WorkspaceEntry.tsx b/components/dashboard/src/workspaces/WorkspaceEntry.tsx index 52d31f22b407fa..cdc5cc42f93b3d 100644 --- a/components/dashboard/src/workspaces/WorkspaceEntry.tsx +++ b/components/dashboard/src/workspaces/WorkspaceEntry.tsx @@ -4,13 +4,7 @@ * See License.AGPL.txt in the project root for license information. */ -import { - CommitContext, - Workspace, - WorkspaceInfo, - ContextURL, - WorkspaceInstanceRepoStatus, -} from "@gitpod/gitpod-protocol"; +import { CommitContext, Workspace, WorkspaceInfo, ContextURL } from "@gitpod/gitpod-protocol"; import { GitpodHostUrl } from "@gitpod/gitpod-protocol/lib/util/gitpod-host-url"; import { FunctionComponent, useMemo, useState } from "react"; import { Item, ItemField, ItemFieldIcon } from "../components/ItemsList"; @@ -19,7 +13,6 @@ import Tooltip from "../components/Tooltip"; import dayjs from "dayjs"; import { WorkspaceEntryOverflowMenu } from "./WorkspaceOverflowMenu"; import { WorkspaceStatusIndicator } from "./WorkspaceStatusIndicator"; -import { useFeatureFlag } from "../data/featureflag-query"; type Props = { info: WorkspaceInfo; @@ -29,13 +22,7 @@ type Props = { export const WorkspaceEntry: FunctionComponent = ({ info, shortVersion }) => { const [menuActive, setMenuActive] = useState(false); - const liveGitStatus = useFeatureFlag("supervisor_live_git_status"); - let repo: WorkspaceInstanceRepoStatus | undefined; - if (liveGitStatus) { - repo = info.latestInstance?.gitStatus; - } else { - repo = info.latestInstance?.status.repo; - } + const repo = info.latestInstance?.gitStatus; const workspace = info.workspace; const currentBranch = repo?.branch || Workspace.getBranchName(info.workspace) || ""; diff --git a/components/gitpod-protocol/go/gitpod-service.go b/components/gitpod-protocol/go/gitpod-service.go index 5a5792bb3fc441..e33b2effb86113 100644 --- a/components/gitpod-protocol/go/gitpod-service.go +++ b/components/gitpod-protocol/go/gitpod-service.go @@ -1835,7 +1835,6 @@ type WorkspaceInstanceStatus struct { NodeName string `json:"nodeName,omitempty"` OwnerToken string `json:"ownerToken,omitempty"` Phase string `json:"phase,omitempty"` - Repo *WorkspaceInstanceRepoStatus `json:"repo,omitempty"` Timeout string `json:"timeout,omitempty"` Version int `json:"version,omitempty"` } diff --git a/components/gitpod-protocol/src/workspace-instance.ts b/components/gitpod-protocol/src/workspace-instance.ts index c39ffac2a98bf2..43815bdaa1d81f 100644 --- a/components/gitpod-protocol/src/workspace-instance.ts +++ b/components/gitpod-protocol/src/workspace-instance.ts @@ -91,14 +91,6 @@ export interface WorkspaceInstanceStatus { // exposedPorts is the list of currently exposed ports exposedPorts?: WorkspaceInstancePort[]; - /** - * repo contains information about the Git working copy inside the workspace - * @deprecated use WorkspaceInstance.gitStatus instead if supervisor_live_git_status feature flag is enabled - * - * TODO(ak) remove after migration to live git status - */ - repo?: WorkspaceInstanceRepoStatus; - // timeout is a non-default timeout value configured for a workspace timeout?: string; diff --git a/components/public-api-server/pkg/apiv1/workspace.go b/components/public-api-server/pkg/apiv1/workspace.go index 47732d5a9b0532..d64136194d36b2 100644 --- a/components/public-api-server/pkg/apiv1/workspace.go +++ b/components/public-api-server/pkg/apiv1/workspace.go @@ -124,10 +124,7 @@ func (s *WorkspaceService) StreamWorkspaceStatus(ctx context.Context, req *conne } for update := range ch { - liveGitStatus := experiments.SupervisorLiveGitStatus(ctx, s.expClient, experiments.Attributes{ - UserID: workspace.Workspace.OwnerID, - }) - instance, err := convertWorkspaceInstance(update, workspace.Workspace.Context, workspace.Workspace.Config, workspace.Workspace.Shareable, liveGitStatus) + instance, err := convertWorkspaceInstance(update, workspace.Workspace.Context, workspace.Workspace.Config, workspace.Workspace.Shareable) if err != nil { log.Extract(ctx).WithError(err).Error("Failed to convert workspace instance.") return proxy.ConvertError(err) @@ -407,15 +404,12 @@ func getLimitFromPagination(pagination *v1.Pagination) (int, error) { } func (s *WorkspaceService) convertWorkspaceInfo(ctx context.Context, input *protocol.WorkspaceInfo) (*v1.Workspace, error) { - liveGitStatus := experiments.SupervisorLiveGitStatus(ctx, s.expClient, experiments.Attributes{ - UserID: input.Workspace.OwnerID, - }) - return convertWorkspaceInfo(input, liveGitStatus) + return convertWorkspaceInfo(input) } // convertWorkspaceInfo converts a "protocol workspace" to a "public API workspace". Returns gRPC errors if things go wrong. -func convertWorkspaceInfo(input *protocol.WorkspaceInfo, liveGitStatus bool) (*v1.Workspace, error) { - instance, err := convertWorkspaceInstance(input.LatestInstance, input.Workspace.Context, input.Workspace.Config, input.Workspace.Shareable, liveGitStatus) +func convertWorkspaceInfo(input *protocol.WorkspaceInfo) (*v1.Workspace, error) { + instance, err := convertWorkspaceInstance(input.LatestInstance, input.Workspace.Context, input.Workspace.Config, input.Workspace.Shareable) if err != nil { return nil, err } @@ -440,7 +434,7 @@ func convertWorkspaceInfo(input *protocol.WorkspaceInfo, liveGitStatus bool) (*v }, nil } -func convertWorkspaceInstance(wsi *protocol.WorkspaceInstance, wsCtx *protocol.WorkspaceContext, config *protocol.WorkspaceConfig, shareable bool, liveGitStatus bool) (*v1.WorkspaceInstance, error) { +func convertWorkspaceInstance(wsi *protocol.WorkspaceInstance, wsCtx *protocol.WorkspaceContext, config *protocol.WorkspaceConfig, shareable bool) (*v1.WorkspaceInstance, error) { if wsi == nil { return nil, nil } @@ -525,12 +519,7 @@ func convertWorkspaceInstance(wsi *protocol.WorkspaceInstance, wsCtx *protocol.W } recentFolders = append(recentFolders, filepath.Join("/workspace", location)) - var gitStatus *v1.GitStatus - if liveGitStatus { - gitStatus = convertGitStatus(wsi.GitStatus) - } else { - gitStatus = convertGitStatus(wsi.Status.Repo) - } + gitStatus := convertGitStatus(wsi.GitStatus) return &v1.WorkspaceInstance{ InstanceId: wsi.ID, diff --git a/components/public-api-server/pkg/apiv1/workspace_test.go b/components/public-api-server/pkg/apiv1/workspace_test.go index dc7d901bc530d2..5462d981829287 100644 --- a/components/public-api-server/pkg/apiv1/workspace_test.go +++ b/components/public-api-server/pkg/apiv1/workspace_test.go @@ -771,7 +771,7 @@ func TestConvertWorkspaceInfo(t *testing.T) { act Expectation err error ) - act.Result, err = convertWorkspaceInfo(&test.Input, false) + act.Result, err = convertWorkspaceInfo(&test.Input) if err != nil { act.Error = err.Error() } @@ -792,7 +792,7 @@ func FuzzConvertWorkspaceInfo(f *testing.F) { } // we really just care for panics - _, _ = convertWorkspaceInfo(&nfo, false) + _, _ = convertWorkspaceInfo(&nfo) }) } diff --git a/components/supervisor/pkg/supervisor/git.go b/components/supervisor/pkg/supervisor/git.go index 2de219c35c671a..229134f29a3f48 100644 --- a/components/supervisor/pkg/supervisor/git.go +++ b/components/supervisor/pkg/supervisor/git.go @@ -182,12 +182,6 @@ func (s *GitStatusService) Run(ctx context.Context, wg *sync.WaitGroup) { } func (s *GitStatusService) update(ctx context.Context, updateContext *gitStatusUpdateContext) { - liveGitStatus := experiments.SupervisorLiveGitStatus(ctx, s.experiments, experiments.Attributes{ - UserID: s.cfg.OwnerId, - }) - if !liveGitStatus { - return - } status, err := s.git.Status(ctx) if err != nil { log.WithError(err).Error("git: error getting status") diff --git a/components/ws-manager-bridge/src/bridge.ts b/components/ws-manager-bridge/src/bridge.ts index 9915494cba54be..7addd391c6437d 100644 --- a/components/ws-manager-bridge/src/bridge.ts +++ b/components/ws-manager-bridge/src/bridge.ts @@ -269,22 +269,6 @@ export class WorkspaceManagerBridge implements Disposable { instance.status.nodeIp = instance.status.nodeIp || status.runtime?.nodeIp; instance.status.ownerToken = status.auth!.ownerToken; - if (status.repo) { - const r = status.repo; - const undefinedIfEmpty = (l: T[]) => (l.length > 0 ? l : undefined); - - instance.status.repo = { - branch: r.branch, - latestCommit: r.latestCommit, - uncommitedFiles: undefinedIfEmpty(r.uncommitedFilesList), - totalUncommitedFiles: r.totalUncommitedFiles, - unpushedCommits: undefinedIfEmpty(r.unpushedCommitsList), - totalUntrackedFiles: r.totalUntrackedFiles, - untrackedFiles: undefinedIfEmpty(r.untrackedFilesList), - totalUnpushedCommits: r.totalUnpushedCommits, - }; - } - let lifecycleHandler: (() => Promise) | undefined; switch (status.phase) { case WorkspacePhase.PENDING: