diff --git a/codersdk/deployment.go b/codersdk/deployment.go index 68fcac1a91a76..59eefdccd2fb7 100644 --- a/codersdk/deployment.go +++ b/codersdk/deployment.go @@ -2039,10 +2039,6 @@ func (c *Client) BuildInfo(ctx context.Context) (BuildInfoResponse, error) { type Experiment string const ( - // ExperimentMoons enabled the workspace proxy endpoints and CRUD. This - // feature is not yet complete in functionality. - ExperimentMoons Experiment = "moons" - // https://github.com/coder/coder/milestone/19 ExperimentWorkspaceActions Experiment = "workspace_actions" diff --git a/docs/admin/workspace-proxies.md b/docs/admin/workspace-proxies.md index e88c40831e59f..972475a3a71d3 100644 --- a/docs/admin/workspace-proxies.md +++ b/docs/admin/workspace-proxies.md @@ -1,13 +1,5 @@ # Workspace Proxies -> Workspace proxies are in an -> [experimental state](../contributing/feature-stages.md#experimental-features) -> and the behavior is subject to change. Use -> [GitHub issues](https://github.com/coder/coder) to leave feedback. This -> experiment must be specifically enabled with the `--experiments="moons"` -> option on both coderd and the workspace proxy. If you have all experiements -> enabled, you have to add moons as well. `--experiments="*,moons"` - Workspace proxies provide low-latency experiences for geo-distributed teams. Coder's networking does a best effort to make direct connections to a workspace. @@ -130,10 +122,6 @@ coder: - name: CODER_WILDCARD_ACCESS_URL value: "*." - # enables new paid features that are in alpha state - - name: CODER_EXPERIMENTS - value: "*,moons" - tls: secretNames: - kubernetes-wsproxy-secret diff --git a/enterprise/cli/workspaceproxy_test.go b/enterprise/cli/workspaceproxy_test.go index df3c955af41c7..8bf9c6c212a76 100644 --- a/enterprise/cli/workspaceproxy_test.go +++ b/enterprise/cli/workspaceproxy_test.go @@ -25,7 +25,6 @@ func Test_ProxyCRUD(t *testing.T) { dv := coderdtest.DeploymentValues(t) dv.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } @@ -97,7 +96,6 @@ func Test_ProxyCRUD(t *testing.T) { dv := coderdtest.DeploymentValues(t) dv.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } diff --git a/enterprise/coderd/coderd.go b/enterprise/coderd/coderd.go index 55defaf9b964d..4123eeb482633 100644 --- a/enterprise/coderd/coderd.go +++ b/enterprise/coderd/coderd.go @@ -354,27 +354,25 @@ func New(ctx context.Context, options *Options) (_ *API, err error) { } api.derpMesh = derpmesh.New(options.Logger.Named("derpmesh"), api.DERPServer, meshTLSConfig) - if api.AGPL.Experiments.Enabled(codersdk.ExperimentMoons) { - // Proxy health is a moon feature. - api.ProxyHealth, err = proxyhealth.New(&proxyhealth.Options{ - Interval: options.ProxyHealthInterval, - DB: api.Database, - Logger: options.Logger.Named("proxyhealth"), - Client: api.HTTPClient, - Prometheus: api.PrometheusRegistry, - }) - if err != nil { - return nil, xerrors.Errorf("initialize proxy health: %w", err) - } - go api.ProxyHealth.Run(ctx) - // Force the initial loading of the cache. Do this in a go routine in case - // the calls to the workspace proxies hang and this takes some time. - go api.forceWorkspaceProxyHealthUpdate(ctx) - - // Use proxy health to return the healthy workspace proxy hostnames. - f := api.ProxyHealth.ProxyHosts - api.AGPL.WorkspaceProxyHostsFn.Store(&f) + // Proxy health is a moon feature. + api.ProxyHealth, err = proxyhealth.New(&proxyhealth.Options{ + Interval: options.ProxyHealthInterval, + DB: api.Database, + Logger: options.Logger.Named("proxyhealth"), + Client: api.HTTPClient, + Prometheus: api.PrometheusRegistry, + }) + if err != nil { + return nil, xerrors.Errorf("initialize proxy health: %w", err) } + go api.ProxyHealth.Run(ctx) + // Force the initial loading of the cache. Do this in a go routine in case + // the calls to the workspace proxies hang and this takes some time. + go api.forceWorkspaceProxyHealthUpdate(ctx) + + // Use proxy health to return the healthy workspace proxy hostnames. + f := api.ProxyHealth.ProxyHosts + api.AGPL.WorkspaceProxyHostsFn.Store(&f) err = api.PrometheusRegistry.Register(&api.licenseMetricsCollector) if err != nil { diff --git a/enterprise/coderd/templates.go b/enterprise/coderd/templates.go index 4e7e0c669dfd6..00b914046b66f 100644 --- a/enterprise/coderd/templates.go +++ b/enterprise/coderd/templates.go @@ -344,12 +344,6 @@ func (api *API) templateRBACEnabledMW(next http.Handler) http.Handler { func (api *API) moonsEnabledMW(next http.Handler) http.Handler { return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - // The experiment must be enabled. - if !api.AGPL.Experiments.Enabled(codersdk.ExperimentMoons) { - httpapi.RouteNotFound(rw) - return - } - // Entitlement must be enabled. api.entitlementsMu.RLock() proxy := api.entitlements.Features[codersdk.FeatureWorkspaceProxy].Enabled diff --git a/enterprise/coderd/workspaceproxy_test.go b/enterprise/coderd/workspaceproxy_test.go index 386149902ad5d..8e40f58f91580 100644 --- a/enterprise/coderd/workspaceproxy_test.go +++ b/enterprise/coderd/workspaceproxy_test.go @@ -38,7 +38,6 @@ func TestRegions(t *testing.T) { dv := coderdtest.DeploymentValues(t) dv.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } @@ -81,7 +80,6 @@ func TestRegions(t *testing.T) { dv := coderdtest.DeploymentValues(t) dv.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } @@ -149,7 +147,6 @@ func TestRegions(t *testing.T) { dv := coderdtest.DeploymentValues(t) dv.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } @@ -176,7 +173,6 @@ func TestWorkspaceProxyCRUD(t *testing.T) { dv := coderdtest.DeploymentValues(t) dv.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } client, _ := coderdenttest.New(t, &coderdenttest.Options{ @@ -227,7 +223,6 @@ func TestWorkspaceProxyCRUD(t *testing.T) { dv := coderdtest.DeploymentValues(t) dv.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } client, _ := coderdenttest.New(t, &coderdenttest.Options{ @@ -263,7 +258,6 @@ func TestProxyRegisterDeregister(t *testing.T) { setup := func(t *testing.T) (*codersdk.Client, database.Store) { dv := coderdtest.DeploymentValues(t) dv.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } @@ -611,7 +605,6 @@ func TestIssueSignedAppToken(t *testing.T) { dv := coderdtest.DeploymentValues(t) dv.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } @@ -708,7 +701,6 @@ func TestReconnectingPTYSignedToken(t *testing.T) { dv := coderdtest.DeploymentValues(t) dv.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } diff --git a/enterprise/coderd/workspaceproxycoordinator_test.go b/enterprise/coderd/workspaceproxycoordinator_test.go index de72c288b2eee..8fb6bf04877f6 100644 --- a/enterprise/coderd/workspaceproxycoordinator_test.go +++ b/enterprise/coderd/workspaceproxycoordinator_test.go @@ -33,7 +33,6 @@ func Test_agentIsLegacy(t *testing.T) { dv := coderdtest.DeploymentValues(t) dv.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } @@ -97,7 +96,6 @@ func Test_agentIsLegacy(t *testing.T) { dv := coderdtest.DeploymentValues(t) dv.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } diff --git a/enterprise/wsproxy/wsproxy_test.go b/enterprise/wsproxy/wsproxy_test.go index 173fb3df4edff..e80d8b1cabf12 100644 --- a/enterprise/wsproxy/wsproxy_test.go +++ b/enterprise/wsproxy/wsproxy_test.go @@ -34,7 +34,6 @@ func TestDERPOnly(t *testing.T) { deploymentValues := coderdtest.DeploymentValues(t) deploymentValues.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } @@ -82,7 +81,6 @@ func TestDERP(t *testing.T) { deploymentValues := coderdtest.DeploymentValues(t) deploymentValues.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } @@ -315,7 +313,6 @@ func TestDERPEndToEnd(t *testing.T) { deploymentValues := coderdtest.DeploymentValues(t) deploymentValues.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } @@ -443,7 +440,6 @@ func TestWorkspaceProxyWorkspaceApps_Wsconncache(t *testing.T) { deploymentValues.Dangerous.AllowPathAppSharing = clibase.Bool(opts.DangerousAllowPathAppSharing) deploymentValues.Dangerous.AllowPathAppSiteOwnerAccess = clibase.Bool(opts.DangerousAllowPathAppSiteOwnerAccess) deploymentValues.Experiments = []string{ - string(codersdk.ExperimentMoons), "*", } @@ -501,7 +497,6 @@ func TestWorkspaceProxyWorkspaceApps_SingleTailnet(t *testing.T) { deploymentValues.Dangerous.AllowPathAppSharing = clibase.Bool(opts.DangerousAllowPathAppSharing) deploymentValues.Dangerous.AllowPathAppSiteOwnerAccess = clibase.Bool(opts.DangerousAllowPathAppSiteOwnerAccess) deploymentValues.Experiments = []string{ - string(codersdk.ExperimentMoons), string(codersdk.ExperimentSingleTailnet), "*", } diff --git a/site/src/components/Dashboard/Navbar/Navbar.tsx b/site/src/components/Dashboard/Navbar/Navbar.tsx index c84dc1f12b26e..0597b7f9757d6 100644 --- a/site/src/components/Dashboard/Navbar/Navbar.tsx +++ b/site/src/components/Dashboard/Navbar/Navbar.tsx @@ -18,7 +18,6 @@ export const Navbar: FC = () => { const canViewDeployment = Boolean(permissions.viewDeploymentValues); const canViewAllUsers = Boolean(permissions.readAllUsers); const proxyContextValue = useProxy(); - const dashboard = useDashboard(); return ( { canViewAuditLog={canViewAuditLog} canViewDeployment={canViewDeployment} canViewAllUsers={canViewAllUsers} - proxyContextValue={ - dashboard.experiments.includes("moons") ? proxyContextValue : undefined - } + proxyContextValue={proxyContextValue} /> ); }; diff --git a/site/src/components/DeploySettingsLayout/Sidebar.tsx b/site/src/components/DeploySettingsLayout/Sidebar.tsx index a8683b0cc926b..a64a85f7dc404 100644 --- a/site/src/components/DeploySettingsLayout/Sidebar.tsx +++ b/site/src/components/DeploySettingsLayout/Sidebar.tsx @@ -112,14 +112,14 @@ export const Sidebar: React.FC = () => { }> Network - {dashboard.experiments.includes("moons") && ( + { } > Workspace Proxies - )} + } } diff --git a/site/src/components/DeploySettingsLayout/optionValue.test.ts b/site/src/components/DeploySettingsLayout/optionValue.test.ts index 387917723e00f..069e22eda76df 100644 --- a/site/src/components/DeploySettingsLayout/optionValue.test.ts +++ b/site/src/components/DeploySettingsLayout/optionValue.test.ts @@ -90,15 +90,6 @@ describe("optionValue", () => { additionalValues: ["single_tailnet", "deployment_health_page"], expected: { single_tailnet: false, deployment_health_page: false }, }, - { - option: { - ...defaultOption, - name: "Experiments", - value: ["moons"], - }, - additionalValues: ["single_tailnet", "deployment_health_page"], - expected: { single_tailnet: false, deployment_health_page: false }, - }, { option: { ...defaultOption, diff --git a/site/src/contexts/ProxyContext.tsx b/site/src/contexts/ProxyContext.tsx index 7992cb8bafc2e..07de908df2765 100644 --- a/site/src/contexts/ProxyContext.tsx +++ b/site/src/contexts/ProxyContext.tsx @@ -1,7 +1,6 @@ import { useQuery } from "react-query"; import { getWorkspaceProxies, getWorkspaceProxyRegions } from "api/api"; import { Region, WorkspaceProxy } from "api/typesGenerated"; -import { useDashboard } from "components/Dashboard/DashboardProvider"; import { createContext, FC, @@ -85,9 +84,6 @@ export const ProxyContext = createContext( * ProxyProvider interacts with local storage to indicate the preferred workspace proxy. */ export const ProxyProvider: FC = ({ children }) => { - const dashboard = useDashboard(); - const experimentEnabled = dashboard?.experiments.includes("moons"); - // Using a useState so the caller always has the latest user saved // proxy. const [userSavedProxy, setUserSavedProxy] = useState(loadUserSelectedProxy()); @@ -176,13 +172,7 @@ export const ProxyProvider: FC = ({ children }) => { proxyLatencies, refetchProxyLatencies, userProxy: userSavedProxy, - proxy: experimentEnabled - ? proxy - : { - // If the experiment is disabled, then call 'getPreferredProxy' with the regions from - // the api call. The default behavior is to use the `primary` proxy. - ...getPreferredProxy(proxiesResp || []), - }, + proxy, proxies: proxiesResp, isLoading: proxiesLoading, isFetched: proxiesFetched, diff --git a/site/src/pages/TerminalPage/TerminalPage.tsx b/site/src/pages/TerminalPage/TerminalPage.tsx index c27286864e510..98452bbdf46ae 100644 --- a/site/src/pages/TerminalPage/TerminalPage.tsx +++ b/site/src/pages/TerminalPage/TerminalPage.tsx @@ -15,7 +15,6 @@ import { MONOSPACE_FONT_FAMILY } from "theme/constants"; import { pageTitle } from "utils/page"; import { useProxy } from "contexts/ProxyContext"; import Box from "@mui/material/Box"; -import { useDashboard } from "components/Dashboard/DashboardProvider"; import type { Region } from "api/typesGenerated"; import { getLatencyColor } from "utils/latency"; import { ProxyStatusLatency } from "components/ProxyStatusLatency/ProxyStatusLatency"; @@ -68,7 +67,6 @@ const TerminalPage: FC = () => { const workspaceAgent = workspace.data ? getMatchingAgentOrFirst(workspace.data, workspaceNameParts?.[1]) : undefined; - const dashboard = useDashboard(); const proxyContext = useProxy(); const selectedProxy = proxyContext.proxy.proxy; const latency = selectedProxy @@ -316,11 +314,9 @@ const TerminalPage: FC = () => { prevLifecycleState.current === "starting" && } {terminalState === "disconnected" && }
- {dashboard.experiments.includes("moons") && - selectedProxy && - latency && ( - - )} + {selectedProxy && latency && ( + + )} ); diff --git a/site/src/testHelpers/entities.ts b/site/src/testHelpers/entities.ts index ad822e76e273d..2714f36593a40 100644 --- a/site/src/testHelpers/entities.ts +++ b/site/src/testHelpers/entities.ts @@ -1978,7 +1978,7 @@ export const MockEntitlementsWithUserLimit: TypesGen.Entitlements = { }), }; -export const MockExperiments: TypesGen.Experiment[] = ["moons"]; +export const MockExperiments: TypesGen.Experiment[] = []; export const MockAuditLog: TypesGen.AuditLog = { id: "fbd2116a-8961-4954-87ae-e4575bd29ce0",