Skip to content

Settings sync API adjustments

Enrique Alcántara requested to merge 426276-adjust-settings-sync-api into master

What does this MR do and why?

It adjusts the VSCode Settings Sync API in the following ways:

uuid and version attributes

What: This MR adds two fields to the VsCodeSetting model: uuid and version.

Why: We need to generate a new UUID every time that a VsCodeSetting is updated. This allows to invalidate the /manifest endpoint cache and indicate other Web IDE instances that they need to synchronize their settings.

REST API adjustments

What

  • /resource/:resource_type/:id responds 204 no content when setting resource does not exist. When the Web IDE receives a 204 response, it sends a POST request to create the setting.
  • /resource/:resource_type/:id sets ETag header to "0" when setting resource does not exist.
  • /resource/:resource_type/:id sets ETag header to the VsCodeSetting uuid attribute when setting resource exists.
  • Handle POST requests for the machines resource.
  • /manifest endpoint always includes the default machine ID.

Why These adjustments ensure that the Settings Sync API satisfies the Settings Sync client expectations.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  • Use the VSCode Settings Sync proof of concept to test the Settings Sync API gitlab-web-ide!239 (closed).
  • Create a Personal Access Token (PAT) with API scope in your local environment.
  • Copy the PAT and replace the following line in the Settings Sync Client Proof of concept gitlab-web-ide!239 (diffs).
  • Run the Web IDE and enable Settings Sync

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #426276 (closed)

Edited by Enrique Alcántara

Merge request reports