Add a fetch_files entrypoint so the clone can happen in its own container - #15862
Open
v-robaiken wants to merge 10 commits into
Open
Add a fetch_files entrypoint so the clone can happen in its own container#15862v-robaiken wants to merge 10 commits into
v-robaiken wants to merge 10 commits into
Conversation
…iner `bin/run fetch_files` was a stub that printed a message and exited 0. Dispatch it to a real entrypoint that runs FileFetcherCommand, which clones into DEPENDABOT_REPO_CONTENTS_PATH. When that path is a shared volume, a second container running `bin/run update_files` reuses the clone rather than making its own: `_clone_repo_contents` returns early when `.git` is already present, and with `repo_contents_path` set the file fetchers read from the clone instead of the API. `bin/run` now execs, so the Ruby process' exit code becomes the container's. Callers chaining `run fetch_files && run update_files` previously could not tell a fetch failure from a success, because the stub always exited 0. No behaviour change for the combined topology: `update_files` still fetches for itself when it runs alone.
Copilot stopped reviewing on behalf of
v-robaiken due to an error
August 19, 2026 15:52
Copilot stopped reviewing on behalf of
v-robaiken due to an error
August 19, 2026 16:38
…d FileFetcherCommandLocalCheckout
…ommand initialization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
First step towards running fetch and update in separate containers This only moves the clone — no file stripping, no serialization, no credential changes.
bin/run fetch_fileswas a stub that exited 0. It now runsFileFetcherCommand, which clones intoDEPENDABOT_REPO_CONTENTS_PATH. When that's a shared volume, a second container runningupdate_filesreuses the clone instead of making its own.bin/runnowexecs so exit codes propagate — the stub always exited 0, so callers couldn't tell a fetch failure from a success.Anything you want to highlight for special attention from reviewers?
Only two files are needed because existing code already handles the rest:
_clone_repo_contentsreturns early when.gitexists, and file fetchers read from the clone instead of the API whenrepo_contents_pathis set.Not a security boundary yet: the update container still calls the target repo twice (branch validation, PR name prefixing), so its credential can't be dropped.
How will you know you've accomplished your goal?
Ran against the real gomod image and
dependabot-fixtures/go-modules-lib, both topologies:git clonehappens once in bothcontentsAPI calls from the update containercreate_pull_requestpayloadsscript/dependabotdoesn't work for this (gemspec/lockfile mismatch). Mount onlyupdater/bin:Checklist
Sorbet and RuboCop clean; specs need Docker, so I diffed the failing-example set against a baseline — identical. No new spec: the
bin/*.rbentrypoints have none, and the behaviour is cross-container. Covered by a script test in dependabot/cli#647.