Skip to content

2026 11 11 tjr reference repos - #463

Merged
tomrittervg merged 3 commits into
masterfrom
2026-11-11-tjr-reference-repos
Nov 12, 2026
Merged

tomrittervg merged 3 commits into
masterfrom
2026-11-11-tjr-reference-repos

Conversation

@tomrittervg

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A relative pre-existing-repos path is opened from the temporary clone directory, causing valid mappings to be missed and reference-repository reuse to be disabled for the rest of the run.

1 open issue
What changed in this PR

This PR reduces SCM cloning costs by using partial clones and optionally borrowing objects from pre-existing local repositories.

Changes:

  • Adds blob filtering and skips checkout during cloning.
  • Adds a JSON mapping from library names to local reference repositories.
  • Adds clone-behavior tests and updates the mocked clone command.
File Description
tests/​scm.py Tests partial clones, reference reuse, and fallback behavior.
tests/​functionality_utilities.py Updates the clone mock to match the new flags.
components/​scmprovider.py Implements partial cloning and optional reference-repository lookup.

Review effort: Balanced

Comment thread components/scmprovider.py
# A JSON file mapping library names to local clones of their upstream
# repositories (e.g. ones baked into the Docker image), which clones can
# borrow objects from instead of downloading them.
self.pre_existing_repos_file = config.get('pre-existing-repos')

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Malformed cache data can block unrelated library clones, and explicit-branch tasks still populate the worktree, defeating the blobless, no-checkout optimization.

3 open issues

Review effort: Balanced

Comment thread components/scmprovider.py Outdated
Comment on lines +161 to +163
repos = {}
for name, path in mapping.items():
if os.path.isabs(path):
Comment thread components/scmprovider.py
# --reference-if-able takes whatever objects it can from the local copy, and
# falls back to a normal clone if the copy isn't there.
reference = ["--reference-if-able", pre_existing_repo] if pre_existing_repo else []
self.run(["git", "clone"] + reference + ["--filter=blob:none", "--no-checkout", repo_url, "."])

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Invalid cache schemas can abort update checks instead of falling back, while explicit branch checkouts download missing blobs and materialize files, defeating the partial-clone optimization.

3 open issues

Review effort: Balanced

@tomrittervg
tomrittervg force-pushed the 2026-11-11-tjr-reference-repos branch from 047c1e0 to c190498 Compare November 12, 2026 04:29
Updatebot only reads commits and trees from an upstream clone, never file contents,
so make it a blobless clone with no checkout. For irregexp's V8 that's 366 MB
instead of 1.7 GB, and a 104 second clone in production should take a few seconds.
A host that doesn't support partial clones ignores the filter.
… is one.

The Docker image already has clones of V8 and PDF.js, which mach vendor
updates to the revision being vendored before we clone the same
repository again to list its commits. The new 'pre-existing-repos' setting
under 'SCM' names a JSON file mapping library names to such copies, and
we clone with --reference-if-able so that git downloads only what the
copy lacks. A missing copy falls back to a normal clone, and an
unreadable or malformed mapping file is a warning. Paths must be absolute, because
we read the file and use its paths from inside the clone directory; a
relative one is ignored and reported to Sentry. (Bug 2091623, #385)
…g Mercurial.

GitHub is moving ubuntu-latest to Ubuntu 26.04 (actions/runner-images#14748),
and since then installing Mercurial fails. Pin the version so that the OS
CI runs on only changes when we choose. apt-get update also keeps the
install from depending on the package lists the runner image was built
with.
@tomrittervg
tomrittervg force-pushed the 2026-11-11-tjr-reference-repos branch from c190498 to ba1b260 Compare November 12, 2026 04:37
@tomrittervg
tomrittervg merged commit f15f1a5 into master Nov 12, 2026
11 checks passed
@tomrittervg
tomrittervg deleted the 2026-11-11-tjr-reference-repos branch November 12, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants