Skip to content

feat: Include GitLab VSCode Extension using a release artifact instead of a submodule

What does this MR do and why?

Replaces the GitLab VSCode Extension git submodule with a release artifact approach for better version management and automation.

Changes:

  • Removes the gitlab-vscode-extension git submodule
  • Adds packages/vscode-extension-gitlab-vscode-extension package that downloads and builds the extension from release artifacts
  • Updates build system to use the new artifact-based approach
  • Maintains the same functionality - the extension still works identically in the Web IDE
  • Update documentation in relation to this new approach

Technical Implementation:

  • Downloads extension from GitLab releases (tarball format)
  • Extracts and builds the extension using npm run build:browser
  • Copies built dist-browser files to the expected location for Web IDE integration
  • Version controlled via JSON metadata file (gitlab_vscode_extension_version.json)

Why?

The git submodule approach had several limitations that this change addresses:

Problems with submodule:

  • Unclear versioning - Difficult to identify which extension version is included
  • Manual updates - Updating requires manual git submodule commands
  • Automation challenges - Hard to automate dependency updates and create update MRs

Benefits of release artifacts:

  • Clear version tracking - JSON file explicitly shows which version is used
  • Easy updates - Simply change version number and location in JSON file
  • Faster cloning - No submodule initialization required

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Setup Steps

  1. Pull the MR branch and install dependencies:

    git checkout <mr-branch>
    yarn install
  2. Verify the configuration file exists:

    ls packages/vscode-extension-gitlab-vscode-extension/gitlab_vscode_extension_version.json
  3. Build the Web IDE with the new extension approach:

    # This should download the extension artifact
    yarn build:example
  4. Start the development server:

    yarn start:example

Validation Steps

  1. Verify extension files were downloaded and built:

    # Check that the extension was downloaded
    ls packages/vscode-extension-gitlab-vscode-extension/dist/gitlab-extension.tar.gz
    
    # Check that it was extracted and built
    ls packages/vscode-extension-gitlab-vscode-extension/dist/gitlab-vscode-extension/dist-browser/
    # Should contain main.js, package.json, and other built extension files
  2. Verify extension is integrated into Web IDE:

    ls packages/web-ide/dist/public/vscode/extensions/gitlab-vscode-extension/
    # Should contain the built extension files copied from the artifact
  3. Test in browser:

    • Open the Web IDE URL (displayed in terminal after yarn start:example)
    • Open a GitLab project
    • Verify GitLab Workflow Extension features work:
      • GitLab Duo
      • GitLab Duo commands
  4. Test version tracking:

    # Check what version was downloaded
    cat packages/vscode-extension-gitlab-vscode-extension/gitlab_vscode_extension_version.json
    
    # Verify it matches what's in the built extension
    cat packages/vscode-extension-gitlab-vscode-extension/dist/gitlab-vscode-extension/package.json | grep version

Expected Results

  • Extension downloads automatically during build
  • Updating the extension version in gitlab_vscode_extension_version.json and location should trigger the watch to redownload the different extension version you specify
  • Web IDE loads without errors
  • GitLab Workflow Extension functionality works identically to before
  • No git submodule references remain in the codebase

Closes #500 (closed)

Edited by Mohammed Osumah

Merge request reports

Loading