Skip to content

Update useLatestVersion in autostart options when user pref updaetd #19181

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
Dec 5, 2023

Conversation

selfcontained
Copy link
Contributor

@selfcontained selfcontained commented Dec 1, 2023

Description

When a user changes their ide preference to either use latest version, or stable, we update any records we have under user.additionalData.workspaceAutostartOptions and update the ideSettings.useLatestVersion` to whatever they changed their preference to. This helps fix an issue where users can't change from latest/stable after starting a workspace on a repo.

Summary generated by Copilot

🤖[deprecated] Generated by Copilot at fe41d7c

Update autostart options for workspaces based on user's IDE choice in SelectIDE.tsx. Add TODO comment to refactor user object mutation.

Issues

Fixes EXP-865

How to test

  • Make sure your user prefs are set to NOT use the latest version of the ide
  • Start a workspace on a repo (should not be the latest version).
  • Change your user ide pref to use the latest version
  • Go to the create workspace page and select the same repo.
  • It should now be using Latest for the IDE
  • Turn the use latest pref back off and verify if you try to create a workspace for that same repo it isn't using the latest version.
  • You can also do the same steps testing autostart by manually constructing the URL for your repo, and adding ?autostart=true to the url (before the #<repo-url> hash)

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@selfcontained selfcontained changed the title update useLatestVersion in autostart options Update useLatestVersion in autostart options when user pref updaetd Dec 1, 2023
@selfcontained selfcontained marked this pull request as ready for review December 1, 2023 18:47
@selfcontained selfcontained requested a review from a team as a code owner December 1, 2023 18:47
@akosyakov
Copy link
Member

/gh run recreate-vm=true

@mustard-mh
Copy link
Contributor

mustard-mh commented Dec 5, 2023

[not-blocking] Will it be better to not store version (latest, stable) in autostart option but always get the current editor settings?

Copy link
Contributor

@mustard-mh mustard-mh left a comment

Choose a reason for hiding this comment

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

Code LGTM.

Tested with latest enable / disable / enable, works as promised. Validate by latest editor warning

image

@selfcontained
Copy link
Contributor Author

[not-blocking] Will it be better to not store version (latest, stable) in autostart option but always get the current editor settings?

That's an interesting idea 🤔

I'm going to go ahead w/ this approach for now to get the bug addressed, and not totally sure what side-effects that approach would have yet. When we revisit this page we should consider an approach like that though, as it could remove a layer of settings potentially in the logic.

@selfcontained
Copy link
Contributor Author

/unhold

@roboquat roboquat merged commit 0e7fae6 into main Dec 5, 2023
@roboquat roboquat deleted the brad/use-latest-autostart-options branch December 5, 2023 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants