Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: do not warn on valid known experiments#18514

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

Merged
johnstcn merged 3 commits intomainfromcj/ui-invalid-experiments
Jun 24, 2025

Conversation

johnstcn
Copy link
Member

Fixes#18024

  • drive-by: renameshandleExperimentsSafe tohandleExperimentsAvailable to better match semantics
  • defines list ofcodersdk.ExperimentsKnown and updatesReadExperiments to log on invalid experiments
  • typescript-ignorescodersdk.Experiments so apitypings generates a valid enum list of possible values of experiment
  • updates OverviewPageView to distinguish between known 'hidden' experiments and unknown 'invalid' experiments

@johnstcnjohnstcn self-assigned thisJun 23, 2025
Comment on lines +23 to +25
exportconstisKnownExperiment=(experiment:string):boolean=>{
returnExperiments.includes(experimentasExperiment);
};
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Alternatively, we could have the FE return the list of known experiments, but it seems silly to do this when we can just use the auto-generated type.

Comment on lines 23 to +25
deploymentOptions:SerpentOption[];
dailyActiveUsers:DAUsResponse|undefined;
readonlyinvalidExperiments:Experiments|string[];
readonlysafeExperiments:Experiments|string[];
readonlyinvalidExperiments:readonlystring[];
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

review: this has to be a string because it might not be an Experiment

@@ -118,7 +118,7 @@ export const invalidExperimentsEnabled: Story = {
hidden:false,
},
],
safeExperiments:["shared-ports"],
safeExperiments:["example"],
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

review: using the "example" experiment enum here instead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Makes sense to me. Using a consistent experiment that we don't need to keep changing.

I wonder ifexample is the best name, but I do not have a better suggestion.

ExperimentPlaceholder,ExperimentDummy, idk.

Copy link
Member

@EmyrkEmyrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The nomenclature aroundavailable andsafe feels inconsistent in the api and usage. But that is not introduced in this PR.

@@ -972,7 +972,7 @@ func New(options *Options) *API {
})
r.Route("/experiments",func(r chi.Router) {
r.Use(apiKeyMiddleware)
r.Get("/available",handleExperimentsSafe)
r.Get("/available",handleExperimentsAvailable)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Kinda unfortunate we have/available that returns only the safe experiments. Ideally there would be a/available and/safe. Or just have/available return amap[string]bool where thebool istrue for safe or something.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yeah I considered also returning all available experiments here but elected to keep the scope of this PR small.

Comment on lines +1898 to +1900
if!slice.Contains(codersdk.ExperimentsKnown,ex) {
log.Warn(context.Background(),"ignoring unknown experiment",slog.F("experiment",ex))
}elseif!slice.Contains(codersdk.ExperimentsSafe,ex) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍.

@johnstcnjohnstcn merged commitd892427 intomainJun 24, 2025
38 of 39 checks passed
@johnstcnjohnstcn deleted the cj/ui-invalid-experiments branchJune 24, 2025 08:14
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 24, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@EmyrkEmyrkEmyrk approved these changes

@mafredrimafredriAwaiting requested review from mafredri

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

bug: valid experiments are showing as invalid on/deployment/overview
2 participants
@johnstcn@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp