Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions coderd/apidoc/docs.go

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

7 changes: 1 addition & 6 deletions coderd/apidoc/swagger.json

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

1 change: 0 additions & 1 deletion coderd/experiments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func Test_Experiments(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, experiments)
require.Empty(t, experiments)
require.False(t, experiments.Enabled(codersdk.ExperimentVSCodeLocal))
require.False(t, experiments.Enabled("foo"))
})

Expand Down
10 changes: 1 addition & 9 deletions codersdk/experiments.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,12 @@ import (

type Experiment string

const (
// ExperimentVSCodeLocal enables a workspace button to launch VSCode
// and connect using the local VSCode extension.
ExperimentVSCodeLocal Experiment = "vscode_local"
)

var (
// ExperimentsAll should include all experiments that are safe for
// users to opt-in to via --experimental='*'.
// Experiments that are not ready for consumption by all users should
// not be included here and will be essentially hidden.
ExperimentsAll = Experiments{
ExperimentVSCodeLocal,
}
ExperimentsAll = Experiments{}
)

// Experiments is a list of experiments that are enabled for the deployment.
Expand Down
14 changes: 4 additions & 10 deletions docs/api/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -1037,23 +1037,17 @@ curl -X GET http://coder-server:8080/api/v2/experiments \
> 200 Response

```json
["vscode_local"]
["string"]
```

### Responses

| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Experiment](schemas.md#codersdkexperiment) |
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | --------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of string |

<h3 id="get-experiments-responseschema">Response Schema</h3>

Status Code **200**

| Name | Type | Required | Restrictions | Description |
| -------------- | ----- | -------- | ------------ | ----------- |
| `[array item]` | array | false | | |

To perform this operation, you must be authenticated. [Learn more](authentication.md).

## Update check
Expand Down
14 changes: 0 additions & 14 deletions docs/api/schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -2354,20 +2354,6 @@ CreateParameterRequest is a structure used to create a new parameter value for a
| `trial` | boolean | false | | |
| `warnings` | array of string | false | | |

## codersdk.Experiment

```json
"vscode_local"
```

### Properties

#### Enumerated Values

| Value |
| -------------- |
| `vscode_local` |

## codersdk.Feature

```json
Expand Down
7 changes: 6 additions & 1 deletion scripts/apitypings/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,13 @@ func (g *Generator) generateAll() (*TypescriptTypes, error) {
sort.Strings(values)
var s strings.Builder
_, _ = s.WriteString(g.posLine(v))
joined := strings.Join(values, " | ")
if joined == "" {
// It's possible an enum has no values.
joined = "never"
}
_, _ = s.WriteString(fmt.Sprintf("export type %s = %s\n",
name, strings.Join(values, " | "),
name, joined,
))

var pluralName string
Expand Down
4 changes: 2 additions & 2 deletions site/src/api/typesGenerated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,8 @@ export const Entitlements: Entitlement[] = [
]

// From codersdk/experiments.go
export type Experiment = "vscode_local"
export const Experiments: Experiment[] = ["vscode_local"]
export type Experiment = never
export const Experiments: Experiment[] = []

// From codersdk/features.go
export type FeatureName =
Expand Down
9 changes: 1 addition & 8 deletions site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ export const WorkspaceReadyPage = ({
workspaceState.children["scheduleBannerMachine"],
)
const xServices = useContext(XServiceContext)
const experiments = useSelector(
xServices.experimentsXService,
(state) => state.context.experiments || [],
)
const featureVisibility = useSelector(
xServices.entitlementsXService,
selectFeatureVisibility,
Expand Down Expand Up @@ -123,10 +119,7 @@ export const WorkspaceReadyPage = ({
builds={builds}
canUpdateWorkspace={canUpdateWorkspace}
hideSSHButton={featureVisibility["browser_only"]}
hideVSCodeDesktopButton={
!experiments.includes("vscode_local") ||
featureVisibility["browser_only"]
}
hideVSCodeDesktopButton={featureVisibility["browser_only"]}
workspaceErrors={{
[WorkspaceErrors.GET_RESOURCES_ERROR]: refreshWorkspaceWarning,
[WorkspaceErrors.GET_BUILDS_ERROR]: getBuildsError,
Expand Down