Skip to content

chore: add workspace actions entitlement and experiment #7361

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 2 commits into from
May 3, 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
6 changes: 4 additions & 2 deletions coderd/apidoc/docs.go

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

4 changes: 2 additions & 2 deletions coderd/apidoc/swagger.json

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

5 changes: 5 additions & 0 deletions codersdk/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const (
FeatureAppearance FeatureName = "appearance"
FeatureAdvancedTemplateScheduling FeatureName = "advanced_template_scheduling"
FeatureWorkspaceProxy FeatureName = "workspace_proxy"
FeatureWorkspaceActions FeatureName = "workspace_actions"
)

// FeatureNames must be kept in-sync with the Feature enum above.
Expand All @@ -61,6 +62,7 @@ var FeatureNames = []FeatureName{
FeatureAppearance,
FeatureAdvancedTemplateScheduling,
FeatureWorkspaceProxy,
FeatureWorkspaceActions,
}

// Humanize returns the feature name in a human-readable format.
Expand Down Expand Up @@ -1668,6 +1670,9 @@ const (
// feature is not yet complete in functionality.
ExperimentMoons Experiment = "moons"

// https://github.com/coder/coder/milestone/19
ExperimentWorkspaceActions Experiment = "workspace_actions"

// Add new experiments here!
// ExperimentExample Experiment = "example"
)
Expand Down
7 changes: 4 additions & 3 deletions docs/api/schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -2502,9 +2502,10 @@ CreateParameterRequest is a structure used to create a new parameter value for a

#### Enumerated Values

| Value |
| ------- |
| `moons` |
| Value |
| ------------------- |
| `moons` |
| `workspace_actions` |

## codersdk.Feature

Expand Down
1 change: 1 addition & 0 deletions enterprise/coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ func (api *API) updateEntitlements(ctx context.Context) error {
codersdk.FeatureExternalProvisionerDaemons: true,
codersdk.FeatureAdvancedTemplateScheduling: true,
codersdk.FeatureWorkspaceProxy: true,
codersdk.FeatureWorkspaceActions: true,
})
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions enterprise/coderd/coderd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestEntitlements(t *testing.T) {
codersdk.FeatureExternalProvisionerDaemons: 1,
codersdk.FeatureAdvancedTemplateScheduling: 1,
codersdk.FeatureWorkspaceProxy: 1,
codersdk.FeatureWorkspaceActions: 1,
},
GraceAt: time.Now().Add(59 * 24 * time.Hour),
})
Expand Down
6 changes: 4 additions & 2 deletions site/src/api/typesGenerated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1361,8 +1361,8 @@ export const Entitlements: Entitlement[] = [
]

// From codersdk/deployment.go
export type Experiment = "moons"
export const Experiments: Experiment[] = ["moons"]
export type Experiment = "moons" | "workspace_actions"
export const Experiments: Experiment[] = ["moons", "workspace_actions"]

// From codersdk/deployment.go
export type FeatureName =
Expand All @@ -1376,6 +1376,7 @@ export type FeatureName =
| "scim"
| "template_rbac"
| "user_limit"
| "workspace_actions"
| "workspace_proxy"
export const FeatureNames: FeatureName[] = [
"advanced_template_scheduling",
Expand All @@ -1388,6 +1389,7 @@ export const FeatureNames: FeatureName[] = [
"scim",
"template_rbac",
"user_limit",
"workspace_actions",
"workspace_proxy",
]

Expand Down