Skip to content
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

feat: add warning about use of old/removed/invalid experiments #12962

Merged
merged 14 commits into from
Apr 17, 2024

Conversation

dannykopping
Copy link
Contributor

@dannykopping dannykopping commented Apr 15, 2024

Fixes #12725

image

If one of the FE folks could help me refactor site/src/pages/DeploySettingsPage/Option.tsx and site/src/pages/DeploySettingsPage/optionValue.ts to allow another boolean indicating whether an experiment is invalid or not, we could change the display of enabled experiments to indicate invalid ones as well. I tried various attempts at this but my lack of TS knowledge is hindering me.

I changed the CheckCircleOutlined to LabelImportant because a check indicates that it is valid, where really we just want to display that it's enabled. We could leave it like this IMHO but doing the above would be more user-friendly.

I haven't done frontend in a very long time so please forgive any glaringly obvious violations of good practice and point them out to me so I can improve them.

@dannykopping dannykopping changed the title Warn about using old/removed/invalid experiments enhancement: warn about using old/removed/invalid experiments Apr 15, 2024
@dannykopping dannykopping changed the title enhancement: warn about using old/removed/invalid experiments feat: warn about using old/removed/invalid experiments Apr 15, 2024
@dannykopping dannykopping changed the title feat: warn about using old/removed/invalid experiments feat: add warning about use of old/removed/invalid experiments Apr 15, 2024
@dannykopping dannykopping marked this pull request as ready for review April 15, 2024 14:40
@johnstcn
Copy link
Member

We already generate the list of all valid experiments via typesgen, which means we have:

// From codersdk/deployment.go
export type Experiment = "auto-fill-parameters" | "example" | "shared-ports";
export const Experiments: Experiment[] = [
  "auto-fill-parameters",
  "example",
  "shared-ports",
];

Can we simply just use this to check if an experiment is valid or not?

@dannykopping
Copy link
Contributor Author

Oh interesting! I didn't know about that list...
It seems stale though? auto-fill-parameters is not part of codersdk.ExperimentsAll. Perhaps I'll add a linter for this and move over to just using that list as the source of truth.

@johnstcn
Copy link
Member

Oh interesting! I didn't know about that list... It seems stale though? auto-fill-parameters is not part of codersdk.ExperimentsAll. Perhaps I'll add a linter for this and move over to just using that list as the source of truth.

I think that may be due to auto-fill-parameters not being something we want to include as a "safe" experiment.

Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Replaced green circle with more neutral icon to indicate enabled experiments

Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

LGTM, but would probably also wait for someone from @fe to review.
Also note: when you make changes, you need to go into Chromatic to accept the new baseline.

site/src/pages/DeploySettingsPage/Option.tsx Outdated Show resolved Hide resolved
@Parkreiner
Copy link
Contributor

Accidentally published my reviews early – not quite done yet

Copy link
Contributor

@Parkreiner Parkreiner left a comment

Choose a reason for hiding this comment

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

Had a couple of recommendations, but nothing worth blocking over.

I haven't worked as much with the E2E tests, but if you need help getting that to pass, I'm happy to pair on that

site/src/pages/DeploySettingsPage/optionValue.ts Outdated Show resolved Hide resolved
site/src/pages/DeploySettingsPage/Option.tsx Outdated Show resolved Hide resolved
site/src/pages/DeploySettingsPage/Option.tsx Outdated Show resolved Hide resolved
site/src/pages/DeploySettingsPage/Option.tsx Outdated Show resolved Hide resolved
Copy link
Member

@Kira-Pilot Kira-Pilot left a comment

Choose a reason for hiding this comment

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

@Parkreiner already gave a thorough review so I don't have too much to add. I approved your storybooks and the new UI looks nice! @mtojek might be able to help you out with that E2E test; it was added recently here.

Signed-off-by: Danny Kopping <danny@coder.com>
…he previous behaviour

Signed-off-by: Danny Kopping <danny@coder.com>
@dannykopping
Copy link
Contributor Author

@Parkreiner thanks for the detailed review! I've made your suggested changes plus a couple others.
Would you mind having one last look before I smash that like merge button?

Copy link
Contributor

@Parkreiner Parkreiner left a comment

Choose a reason for hiding this comment

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

Had one last suggestion, but this looks good!

Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
@dannykopping dannykopping merged commit b85d5d8 into coder:main Apr 17, 2024
26 checks passed
@dannykopping dannykopping deleted the dk/old-exps branch April 17, 2024 14:59
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn about using old/removed/invalid experiments
4 participants