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

Impl: update ssh config when settings change #51

Merged
merged 2 commits into from
Mar 29, 2025

Conversation

fioan89
Copy link
Collaborator

@fioan89 fioan89 commented Mar 28, 2025

  • right now the ssh config is triggered only when at the login and only when new workspaces are
    created. In the last case, the ssh config updates only the new sections.
  • but the user can go into settings page and enable or disable the wildcard ssh config. With this patch
    after the user hits Save, the ssh re-configuration is triggered, without the need to restart Toolbox.

Also a major fix - read only settings acted as snapshots in the sense that they did not reflect any subsequent update to the underlying store because updates create a new readonly instance

  • with this patch we simplified the code even more by exposing a readonly interface with all of the
    implementation in the CoderSettingsStore. PluginSettingsStore and Environments are the only persist-able
    stores.
  • because read only instances share the same settings store instances any update on the writable will reflect
    on the readable instances as well.

fioan89 added 2 commits March 29, 2025 00:52
- they did not reflect any subsequent update because updates create a new backing readonly instance
- with this patch we simplified the code even more by exposing a readonly interface with all of the
  implementation in the CoderSettingsStore. PluginSettingsStore and Environments are the only persist-able
  stores.
- because read only instances share the same settings store instances any update on the writable will reflect
  on the readable instances as well.
…ings

- right now the ssh config is triggered only when at the login and only when new workspaces are
  created. In the last case, the ssh config updates only the new sections.
- but the user can go into settings page and enable or disable the wildcard ssh config. With this patch
  after the user hits Save, the ssh re-configuration is triggered, without the need to restart Toolbox.
@fioan89 fioan89 requested a review from matifali March 28, 2025 23:09
@fioan89 fioan89 marked this pull request as ready for review March 28, 2025 23:09
@fioan89 fioan89 requested a review from bcpeinhardt March 28, 2025 23:09
@matifali matifali requested a review from Copilot March 29, 2025 00:08
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (9)
  • src/main/kotlin/com/coder/toolbox/CoderRemoteEnvironment.kt: Language not supported
  • src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt: Language not supported
  • src/main/kotlin/com/coder/toolbox/cli/CoderCLIManager.kt: Language not supported
  • src/main/kotlin/com/coder/toolbox/settings/CoderSettings.kt: Language not supported
  • src/main/kotlin/com/coder/toolbox/settings/ReadOnlyCoderSettings.kt: Language not supported
  • src/main/kotlin/com/coder/toolbox/store/CoderSettingsStore.kt: Language not supported
  • src/main/kotlin/com/coder/toolbox/util/TLS.kt: Language not supported
  • src/main/kotlin/com/coder/toolbox/views/CoderSettingsPage.kt: Language not supported
  • src/main/kotlin/com/coder/toolbox/views/EnvironmentView.kt: Language not supported

@matifali matifali requested review from f0ssel and removed request for bcpeinhardt March 29, 2025 00:08
@fioan89 fioan89 merged commit da7656f into main Mar 29, 2025
5 checks passed
@fioan89 fioan89 deleted the impl-update-ssh-config-when-settings-change branch March 29, 2025 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants