Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: move vscode local out of experiments #5773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 3 additions & 6 deletions codersdk/experiments.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,16 @@ import (
type Experiment string

const (
// ExperimentVSCodeLocal enables a workspace button to launch VSCode
// and connect using the local VSCode extension.
ExperimentVSCodeLocal Experiment = "vscode_local"
// Add new experiments here!
// ExperimentExample Experiment = "example"
)

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 @@ -1072,23 +1072,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 @@ -2427,20 +2427,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 @@ -1092,8 +1092,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
7 changes: 2 additions & 5 deletions site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const WorkspaceReadyPage = ({
const [_, bannerSend] = useActor(
workspaceState.children["scheduleBannerMachine"],
)
const { buildInfo, experiments } = useDashboard()
const { buildInfo } = useDashboard()
const featureVisibility = useFeatureVisibility()
const {
workspace,
Expand Down Expand Up @@ -115,10 +115,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
2 changes: 1 addition & 1 deletion site/src/testHelpers/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ export const MockEntitlementsWithAuditLog: TypesGen.Entitlements = {
}),
}

export const MockExperiments: TypesGen.Experiment[] = ["vscode_local"]
export const MockExperiments: TypesGen.Experiment[] = []

export const MockAuditLog: TypesGen.AuditLog = {
id: "fbd2116a-8961-4954-87ae-e4575bd29ce0",
Expand Down