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

Skip to content

Commit 546a893

Browse files
authored
chore: move vscode local out of experiments (#5773)
We've been dogfooding the VS Code extension for a while, and it seems stable enough that it's overall positive to release!
1 parent b91b453 commit 546a893

File tree

10 files changed

+20
-56
lines changed

10 files changed

+20
-56
lines changed

coderd/apidoc/docs.go

+1-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

+1-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/experiments_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ func Test_Experiments(t *testing.T) {
2929
require.NoError(t, err)
3030
require.NotNil(t, experiments)
3131
require.Empty(t, experiments)
32-
require.False(t, experiments.Enabled(codersdk.ExperimentVSCodeLocal))
3332
require.False(t, experiments.Enabled("foo"))
3433
})
3534

codersdk/experiments.go

+3-6
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,16 @@ import (
99
type Experiment string
1010

1111
const (
12-
// ExperimentVSCodeLocal enables a workspace button to launch VSCode
13-
// and connect using the local VSCode extension.
14-
ExperimentVSCodeLocal Experiment = "vscode_local"
12+
// Add new experiments here!
13+
// ExperimentExample Experiment = "example"
1514
)
1615

1716
var (
1817
// ExperimentsAll should include all experiments that are safe for
1918
// users to opt-in to via --experimental='*'.
2019
// Experiments that are not ready for consumption by all users should
2120
// not be included here and will be essentially hidden.
22-
ExperimentsAll = Experiments{
23-
ExperimentVSCodeLocal,
24-
}
21+
ExperimentsAll = Experiments{}
2522
)
2623

2724
// Experiments is a list of experiments that are enabled for the deployment.

docs/api/general.md

+4-10
Original file line numberDiff line numberDiff line change
@@ -1072,23 +1072,17 @@ curl -X GET http://coder-server:8080/api/v2/experiments \
10721072
> 200 Response
10731073
10741074
```json
1075-
["vscode_local"]
1075+
["string"]
10761076
```
10771077

10781078
### Responses
10791079

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

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

1086-
Status Code **200**
1087-
1088-
| Name | Type | Required | Restrictions | Description |
1089-
| -------------- | ----- | -------- | ------------ | ----------- |
1090-
| `[array item]` | array | false | | |
1091-
10921086
To perform this operation, you must be authenticated. [Learn more](authentication.md).
10931087

10941088
## Update check

docs/api/schemas.md

-14
Original file line numberDiff line numberDiff line change
@@ -2427,20 +2427,6 @@ CreateParameterRequest is a structure used to create a new parameter value for a
24272427
| `trial` | boolean | false | | |
24282428
| `warnings` | array of string | false | | |
24292429

2430-
## codersdk.Experiment
2431-
2432-
```json
2433-
"vscode_local"
2434-
```
2435-
2436-
### Properties
2437-
2438-
#### Enumerated Values
2439-
2440-
| Value |
2441-
| -------------- |
2442-
| `vscode_local` |
2443-
24442430
## codersdk.Feature
24452431

24462432
```json

scripts/apitypings/main.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,13 @@ func (g *Generator) generateAll() (*TypescriptTypes, error) {
223223
sort.Strings(values)
224224
var s strings.Builder
225225
_, _ = s.WriteString(g.posLine(v))
226+
joined := strings.Join(values, " | ")
227+
if joined == "" {
228+
// It's possible an enum has no values.
229+
joined = "never"
230+
}
226231
_, _ = s.WriteString(fmt.Sprintf("export type %s = %s\n",
227-
name, strings.Join(values, " | "),
232+
name, joined,
228233
))
229234

230235
var pluralName string

site/src/api/typesGenerated.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1092,8 +1092,8 @@ export const Entitlements: Entitlement[] = [
10921092
]
10931093

10941094
// From codersdk/experiments.go
1095-
export type Experiment = "vscode_local"
1096-
export const Experiments: Experiment[] = ["vscode_local"]
1095+
export type Experiment = never
1096+
export const Experiments: Experiment[] = []
10971097

10981098
// From codersdk/features.go
10991099
export type FeatureName =

site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const WorkspaceReadyPage = ({
4040
const [_, bannerSend] = useActor(
4141
workspaceState.children["scheduleBannerMachine"],
4242
)
43-
const { buildInfo, experiments } = useDashboard()
43+
const { buildInfo } = useDashboard()
4444
const featureVisibility = useFeatureVisibility()
4545
const {
4646
workspace,
@@ -115,10 +115,7 @@ export const WorkspaceReadyPage = ({
115115
builds={builds}
116116
canUpdateWorkspace={canUpdateWorkspace}
117117
hideSSHButton={featureVisibility["browser_only"]}
118-
hideVSCodeDesktopButton={
119-
!experiments.includes("vscode_local") ||
120-
featureVisibility["browser_only"]
121-
}
118+
hideVSCodeDesktopButton={featureVisibility["browser_only"]}
122119
workspaceErrors={{
123120
[WorkspaceErrors.GET_RESOURCES_ERROR]: refreshWorkspaceWarning,
124121
[WorkspaceErrors.GET_BUILDS_ERROR]: getBuildsError,

site/src/testHelpers/entities.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ export const MockEntitlementsWithAuditLog: TypesGen.Entitlements = {
982982
}),
983983
}
984984

985-
export const MockExperiments: TypesGen.Experiment[] = ["vscode_local"]
985+
export const MockExperiments: TypesGen.Experiment[] = []
986986

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

0 commit comments

Comments
 (0)