Skip to content

Move documentation images away from the `main` branch

Problem to solve

We currently store all documentation images in src/assets on the main branch.

The images currently take about 13 MB.

This has several problems:

  • It increases the size of the repository for cloning

  • All pictures need to be referenced in README.md with absolute URLs (because the README is also rendered in the Marketplace)

  • The images are in the wrong folder (I'd expect src/ folder to contain files needed for the extension runtime)

  • some of these images get packaged with the extension, where they increase the download size without any purpose (this could be "fixed"1 without removing the images from main)

    ~/.v/e/g/s/assets ❯❯❯ ll
    Permissions Size User  Date Modified Name
    .rw-r--r--   27k tomas 13 Jul 15:01  gitlab-logo.png
    .rw-r--r--  207k tomas 13 Jul 15:01  gitlab-vscode.png
    drwxr-xr-x     - tomas 13 Jul 15:01  images
    .rw-r--r--  892k tomas 13 Jul 15:01  insert-multi-file-snippet.gif
    .rw-r--r--  149k tomas 13 Jul 15:01  logo.png
    .rw-r--r--   44k tomas 13 Jul 15:01  pipeline-actions.png
    .rw-r--r--   74k tomas 13 Jul 15:01  screencast-cover.jpg
    ~/.v/e/g/s/assets ❯❯❯ pwd
    /Users/tomas/.vscode-insiders/extensions/gitlab.gitlab-workflow-3.26.0/src/assets

    This is controled by the expression in .vsignore file

Proposal

There are two options I can think of:

  • put the images outside of git (e.g. imgur.com)
  • put the images into a separate git branch (e.g. images or documentation-assets) and make this branch protected

My preference would be the images protected branch.

Further details

The migration must happen in several steps:

  1. copy the images outside of the main branch and change the links in README.md
  2. Wait for a few months (because older versions of the README still reference the resources in main branch)
  3. Remove the images from the main brach.

Links / references

  1. Fixed is in quotes because, without some automated checking, we are bound to forget to put the _ prefix to some future documentation image.

Edited by Tomas Vik