Skip to content

Draft: switch to sourcemaps based off CI or release artifacts

Chad Woolley requested to merge caw-relative-sourcemaps into main

Fixes: gitlab-web-ide#24 (closed)

Goal

Every CI build of the vs code fork should have valid sourcemaps that point to a hosted location. Currently they point to the "blob.core" standard microsoft URLs, which don't match our forked source.

  1. For MR/branch/non-release builds, this can point to CI artifacts, which are not permanent, but this is OK for MRs.
  2. For tagged/release builds, this should point to some permanent release artifact.

OR - DIFFERENT APPROACH - we can have infra provision a bucket for this, and just publish them all there, distinguished by the commit. This maybe seems like a better idea, just need to handle the bucket auth during the fork build process.

Testing

TODO: Update this based on the new plan of using artifacts described above.

  • Follow instructions from Setup for integrating with local VSCode repo
    • In web IDE project, run yarn local-setup /absolute/path/to/gitlab-web-ide-vscode-fork/.build/vscode-web
    • In fork project, run gitlab:build-vscode-web
    • In web IDE project, run yarn build:vscode
  • In fork, search all files under .build for the a regex containing more than one slash for the sourceMappingURL= line: sourceMappingURL=./.*/. There should be no matches. In other words, they should all be sourceMappingURL=./<filename>, with no directories specified.
  • In web IDE:
    • Clear the terminal
    • Run yarn start:example to start the server
    • Navigate to the web IDE at http://127.0.0.1:8000/ and submit the form to enter the editor
    • Review the terminal logs server output. There should be no errors like [serve:example] [2022-09-08T23:25:40.678Z] "GET /web-ide/public/vscode/out/vs/workbench/vs/workbench/workbench.web.main.js.map" Error (404): "Not found"
Edited by Chad Woolley

Merge request reports