豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

remove separate file fetcher command#13275

Merged
jakecoffman merged 7 commits intomainfrom
remove-file-fetcher-command
Oct 13, 2025
Merged

remove separate file fetcher command#13275
jakecoffman merged 7 commits intomainfrom
remove-file-fetcher-command

Conversation

@jakecoffman
Copy link
Copy Markdown
Member

@jakecoffman jakecoffman commented Oct 10, 2025

What are you trying to accomplish?

Originally Dependabot ran fetch_files command in a different container than update_files which might run arbitrary code. To communicate between containers, it would write the gathered files to disk base64 encoded, and the update_files would read and decode it.

I dug into it and it seems the original idea was that the update_files could run with a smaller set of credentials, but that was never implemented.

So let's discard all that and simply fetch the files in the update_files command and keep it in memory. No need to encode, decode, and write to disk. A nice simplification!

Anything you want to highlight for special attention from reviewers?

If you ignore the VCR that needed an update, this PR is +159 -251 so it removes almost 100 lines of code. Nice!

How will you know you've accomplished your goal?

Things will still work, but slightly faster.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@jakecoffman
Copy link
Copy Markdown
Member Author

jakecoffman commented Oct 10, 2025

Removing the filesystem IO and base64 encoding has sped up the smoke tests by 30 seconds across the board. We should see that in production as well.

Edit: Nope, I was wrong. I was comparing these smoke tests to the smoke tests that downloaded the image during the run. So the 30 seconds was just the difference in how the tests are setup. This is still a nice cleanup, but no major performance improvements unless there are a lot of large binaries in the manifests (which there usually aren't).

@jakecoffman jakecoffman marked this pull request as ready for review October 10, 2025 18:31
@jakecoffman jakecoffman requested a review from a team as a code owner October 10, 2025 18:31
Copy link
Copy Markdown
Contributor

@honeyankit honeyankit left a comment

Choose a reason for hiding this comment

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

@jakecoffman Can we also update the docs related to this change. I remember there are few places where we have instruction to use file_fetch command to debug.

Copy link
Copy Markdown
Contributor

@brrygrdn brrygrdn left a comment

Choose a reason for hiding this comment

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

This change makes good sense to me as my understand is that the separate fetch- and update-commands predates the invention of the proxy being used everywhere, i.e. you had to be careful to supply a subset of creds to the first to pull repo content that you didn't necessarily want the latter to have.

The way we run this now means it's weird indirection and it's much simpler to think about the job definition as just input.

sig { returns(T.nilable(Integer)) }
def save_job_details
# TODO: Use the Dependabot::Environment helper for this
return unless ENV["UPDATER_ONE_CONTAINER"]
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.

🔍 We're always executing as a single container these days so as I understand it, this config point is just a hold over I think

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, I added this in https://github.com/dependabot/dependabot-updater/pull/1743 so that in Actions we could avoid all the passing around of the outputs.

dependency_snapshot = Dependabot::DependencySnapshot.create_from_job_definition(
job: job,
job_definition: Environment.job_definition
fetched_files: @fetched_files
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.

💯 I like the implication that the job_definition is now immutable as it was hard to reason about in some tests and fixtures

@jakecoffman jakecoffman merged commit bb1de8f into main Oct 13, 2025
318 of 323 checks passed
@jakecoffman jakecoffman deleted the remove-file-fetcher-command branch October 13, 2025 13:47
mburumaxwell added a commit to mburumaxwell/paklo that referenced this pull request Jan 8, 2026
In dependabot/dependabot-core#13275 the `fetch_files` command was made a no-op, and it does not need to be called.
Also cleaned up environment variables that are not used as a result.

Copied from: github/dependabot-action#1550
mburumaxwell added a commit to mburumaxwell/paklo that referenced this pull request Jan 9, 2026
In dependabot/dependabot-core#13275 the `fetch_files` command was made a no-op, and it does not need to be called.
Also cleaned up environment variables that are not used as a result.

Copied from: github/dependabot-action#1550
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.

3 participants