Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependabot-cli: 1.41.0 -> 1.57.0, pin image dependencies #352866

Merged
merged 4 commits into from
Nov 1, 2024

Conversation

infinisil
Copy link
Member

@infinisil infinisil commented Nov 1, 2024

Noticed that the dependabot updates for https://github.com/NixOS/nixpkgs-vet aren't working anymore. Tracked it down to it needing a dependabot CLI update, but to prevent future breakage, this PR also introduces a dependabot-pinned wrapper that pins the docker images.

Ping @NixOS/nixpkgs-vet

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Successfully ran the nixpkgs-vet update script making use of dependabot

This work is sponsored by Antithesis

Add a 👍 reaction to pull requests you find important.

…mages

By default, the dependabot CLI fetches the latest versions of two images
it depends on, with the underlying assumption that the CLI is also a recent version.
This of course causes problems if the CLI is outdated and doesn't
support the latest images.

This commit introduces a separate wrapper binary that pins these images
to the latest version of them at the time of updating.
@infinisil infinisil changed the title dependabot-cli: 1.41.0 -> 1.57.0 dependabot-cli: 1.41.0 -> 1.57.0, pin image dependencies Nov 1, 2024
Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

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

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 352866


x86_64-linux

✅ 1 package built:
  • dependabot-cli

@philiptaron
Copy link
Contributor

$ results/dependabot-cli-x86_64-linux/bin/dependabot-pinned --help
results/dependabot-cli-x86_64-linux/bin/dependabot-pinned: line 2: docker: command not found

@infinisil
Copy link
Member Author

@philiptaron Since dependabot requires the docker daemon to run anyways, I think it's fine to not include it, especially also to avoid extra closure size.

@philiptaron
Copy link
Contributor

@philiptaron Since dependabot requires the docker daemon to run anyways, I think it's fine to not include it, especially also to avoid extra closure size.

You got the green check.

I think I would have made this be a passthru, separate derivation with the extra dependency, but you do you.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Nov 1, 2024
@infinisil
Copy link
Member Author

Ah yeah that's fair, I guess let's merge this as is for now, but consider doing that in the future if this becomes more complex, or people demand smaller closure sizes :)

@infinisil infinisil merged commit b7a2f95 into NixOS:master Nov 1, 2024
21 of 22 checks passed
@infinisil infinisil deleted the update/dependabot branch November 1, 2024 16:38
@infinisil infinisil requested a review from l0b0 November 1, 2024 16:38
@infinisil
Copy link
Member Author

Requested a review from the maintainer manually because ofborg was apparently too slow. Let us know if you have any input @l0b0, happy to address retroactively!

Copy link
Contributor

@l0b0 l0b0 left a comment

Choose a reason for hiding this comment

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

Thank you!

Comment on lines +8 to +9
dockerTools,
makeWrapper,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: These should be sorted alphabetically with the rest.

Comment on lines +69 to +74
# Create a wrapper that pins the docker images that are depended upon
makeWrapper $out/bin/dependabot $out/bin/dependabot-pinned \
--run "docker load --input ${updateJobProxy}" \
--add-flags "--proxy-image=dependabot-update-job-proxy:${tag}" \
--run "docker load --input ${updaterGitHubActions}" \
--add-flags "--updater-image=dependabot-updater-github-actions:${tag}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be a separate output, or behind a feature flag like withDockerImages?

@infinisil infinisil mentioned this pull request Nov 6, 2024
13 tasks
@infinisil
Copy link
Member Author

#354085

infinisil added a commit to NixOS/nixpkgs-vet that referenced this pull request Nov 7, 2024
The automated GitHub workflow updates have been broken for some time

See NixOS/nixpkgs#352866 and NixOS/nixpkgs#354085
infinisil added a commit to NixOS/nixpkgs-vet that referenced this pull request Nov 25, 2024
The automated GitHub workflow updates were broken for some time due to dependabot's images fetched
at runtime went out of sync with the binary.

While updating dependabot fixed it for now, a more permanent fix is to use the version of dependabot
that pins the images at build time, introduced in
NixOS/nixpkgs#352866 and NixOS/nixpkgs#354085
infinisil added a commit to NixOS/nixpkgs-vet that referenced this pull request Nov 25, 2024
The automated GitHub workflow updates were broken for some time due to dependabot's images fetched
at runtime went out of sync with the binary.

While updating dependabot fixed it for now, a more permanent fix is to use the version of dependabot
that pins the images at build time, introduced in
NixOS/nixpkgs#352866 and NixOS/nixpkgs#354085
infinisil added a commit to NixOS/nixpkgs-vet that referenced this pull request Nov 25, 2024
The automated GitHub workflow updates were broken for some time due to dependabot's images fetched
at runtime went out of sync with the binary.

While updating dependabot fixed it for now, a more permanent fix is to use the version of dependabot
that pins the images at build time, introduced in
NixOS/nixpkgs#352866 and NixOS/nixpkgs#354085
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants