Skip to content

Only fetch archive of subdirectories in workspaces

Warren Gifford requested to merge mrn/workspace-subdir-archives into main

Created by: mrnugget

This does two things:

  1. When workspaces are used in the campaign spec, only an archive of the workspace (including all subdirectories and subworkspaces) is downloaded. That helps a lot with monorepos where it's unfeasible to download the whole repository.
  2. When only the workspace is downloaded two files from the root of the repository are additionally downloaded, if they exist: .gitignore and .gitattributes.

The code is by not polished yet, but it works, I added a lot of tests and hope to get a first round of reviews that I can then work off tomorrow.

What's missing:

  • I haven't tested the volume workspace mode manually yet
  • I want to remove the duplication between unzip and (wc *dockerBindWorkspaceCreator) copyToWorkspace and already have prepareCopyDestinationFile
  • Changelog entry
  • Make fetchOnlyWorkspace a flag that enables this feature
  • Documentation in sourcegraph/sourcegraph

Big questions:

  • Do we want to make only-download-workspace-archive the default behaviour?
  • Do we want to make download-additional-files the default behaviour?

Thank you for reviewing.

Yours truly,

image

Merge request reports

Loading