You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run fetch and update in separate containers behind isolated_fetch_update
With the experiment on, the CLI clones in one updater container and updates in
another. The clone travels between them on a Docker volume mounted at
DEPENDABOT_REPO_CONTENTS_PATH in both, so it is made once rather than twice.
Each side gets its own proxy on its own network pair, so the update container
has no route to the fetch proxy and the two credential sets can diverge later.
They are identical for now; the call site marks the seam.
`--local` populates the fetch container only. Debug shells, the OpenTelemetry
collector and use_case_insensitive_filesystem are rejected rather than silently
misbehaving under the split.
Combined mode drops the `bin/run fetch_files &&` prefix. That entrypoint used to
be a no-op stub, so this is byte-identical to today, and it avoids fetching
twice now that dependabot-core makes it do real work.
Also fixes container output being truncated: RunCmd piped through io.Copy and
prefixer, but Prefixer.WriteTo returns without writing pending data at EOF and
io.Copy only calls WriteTo once, so the tail of every command was dropped.
Running `bin/run` twice used to mask it, which is what the "unless I echo here
the json doesn't output" comment in input.txt was working around.
Copy file name to clipboardExpand all lines: docs/debugging.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,13 @@ Next, clone https://github.com/dependabot/dependabot-core. This project contains
10
10
11
11
Try opening a terminal and run `script/dependabot update go_modules dependabot/cli --debug` in the `dependabot-core` project directory. This will drop you in an interactive session with the update ready to proceed.
12
12
13
-
To perform the update, you need to run two commands:
13
+
To perform the update, run:
14
14
15
-
-`bin/run fetch_files`
16
15
-`bin/run update_files`
17
16
18
-
If the problem you are debugging is during the fetch step, the fetch_files command will be all you need to run.
17
+
This fetches the dependency files and then updates them.
19
18
20
-
If the problem is after the fetch step, you can repeatedly run update_fileswhile you're debugging.
19
+
If the problem you are debugging is during the fetch step, run `bin/run fetch_files` instead. It needs somewhere to write the fetched file set, so set `DEPENDABOT_HANDOFF_PATH` first, for example `export DEPENDABOT_HANDOFF_PATH=/tmp/handoff.json`. `update_files` reads that file instead of fetching again when the variable is set, so you can repeatedly run `update_files` against a single fetch while you're debugging.
21
20
22
21
In the example `script/dependabot` command above, try running an update in the container.
23
22
@@ -32,7 +31,7 @@ Next, let's try adding a `debugger` statement. Open the `dependabot-core` projec
32
31
33
32
> **Note** You don't have to restart your CLI session, the changes are automatically synced to the container!
34
33
35
-
In the interactive debugging session, run `bin/run fetch_files` and `bin/run update_files`. During the update_files command, the Ruby debugger will open. It should look something like this:
34
+
In the interactive debugging session, run `bin/run update_files`. During that command, the Ruby debugger will open. It should look something like this:
@@ -60,7 +59,7 @@ At this prompt, you can run [debugger commands](https://github.com/ruby/debug) t
60
59
61
60
If your Dependabot job is hanging and would like to figure out why, the CLI is the perfect tool for the job.
62
61
63
-
Start by running the update that recreates the hang with `dependabot update <ecosystem> <org/repo>`. Once the hang is reproducible, run with the `--debug` flag and the run the `fetch_files` and `update_files`commands and wait until the job hangs.
62
+
Start by running the update that recreates the hang with `dependabot update <ecosystem> <org/repo>`. Once the hang is reproducible, run with the `--debug` flag and then run the `update_files`command and wait until the job hangs.
64
63
65
64
Once it does hang, hit CTL-C, and you'll get a stack trace leading you to the problematic code.
// put the clone dir in the updater container to be used by during the update
459
-
ifparams.LocalDir!="" {
460
-
containerDir:=guestRepoDir
461
-
ifparams.Job.UseCaseInsensitiveFileSystem() {
462
-
// since the updater is using the storage container, we need to populate the repo on that device because that's the directory that will be used for the update
// since the updater is using the storage container, we need to populate the repo on that device because that's the directory that will be used for the update
0 commit comments