- Notifications
You must be signed in to change notification settings - Fork927
feat: add --experiments flag#5767
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
76c7b91
626d81b
d93a373
e82c306
047771c
3ba27ea
3ebb778
2aeb93e
53d92d7
ef0cbc3
8fdb21b
0cb9a6a
44e9638
6c32aa5
1cbaaf7
67d07f3
196b263
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -446,10 +446,19 @@ func newConfig() *codersdk.DeploymentConfig { | ||
Default: 512, | ||
}, | ||
}, | ||
// DEPRECATED: use Experiments instead. | ||
Experimental: &codersdk.DeploymentConfigField[bool]{ | ||
Name: "Experimental", | ||
Usage: "Enable experimental features. Experimental features are not ready for production.", | ||
Flag: "experimental", | ||
Default: false, | ||
Hidden: true, | ||
}, | ||
Comment on lines 450 to +456 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Should print a deprecation notice at the top of server.go. Or we could implement it as a "Deprecated string" on DeploymentConfigField There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. It's hidden. So it should not matter right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Well to notify old deployments that still have the variable set that they need to unset it or it won't work soon There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I mean printing a notice if the flag or env var is present There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. warning gets printed in | ||
Experiments: &codersdk.DeploymentConfigField[[]string]{ | ||
Name: "Experiments", | ||
Usage: "Enable one or more experiments. These are not ready for production. Separate multiple experiments with commas, or enter '*' to opt-in to all available experiments.", | ||
Flag: "experiments", | ||
Default: []string{}, | ||
johnstcn marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
}, | ||
UpdateCheck: &codersdk.DeploymentConfigField[bool]{ | ||
Name: "Update Check", | ||
@@ -557,12 +566,12 @@ func setConfig(prefix string, vip *viper.Viper, target interface{}) { | ||
// with a comma, but Viper only supports with a space. This | ||
// is a small hack around it! | ||
rawSlice := reflect.ValueOf(vip.GetStringSlice(prefix)).Interface() | ||
stringSlice, ok := rawSlice.([]string) | ||
if !ok { | ||
panic(fmt.Sprintf("string slice is of type %T", rawSlice)) | ||
} | ||
value := make([]string, 0, len(stringSlice)) | ||
for _, entry := rangestringSlice { | ||
value = append(value, strings.Split(entry, ",")...) | ||
} | ||
val.FieldByName("Value").Set(reflect.ValueOf(value)) | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package coderd | ||
import ( | ||
"net/http" | ||
"github.com/coder/coder/coderd/httpapi" | ||
) | ||
// @Summary Get experiments | ||
// @ID get-experiments | ||
// @Security CoderSessionToken | ||
// @Produce json | ||
// @Tags General | ||
// @Success 200 {array} codersdk.Experiment | ||
// @Router /experiments [get] | ||
func (api *API) handleExperimentsGet(rw http.ResponseWriter, r *http.Request) { | ||
ctx := r.Context() | ||
httpapi.Write(ctx, rw, http.StatusOK, api.Experiments) | ||
} |
Uh oh!
There was an error while loading.Please reload this page.