-
Notifications
You must be signed in to change notification settings - Fork 1.3k
docker: consider the tag when checking if a digest is up-to-date #13842
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
base: main
Are you sure you want to change the base?
Conversation
844d7dc to
9cc12f0
Compare
9cc12f0 to
e4510f9
Compare
kbukum1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug in Docker digest update checking where all requirements were incorrectly compared against a single updated_digest value. The fix ensures that requirements with specific tags are compared against the digest of their own updated tag, rather than a global digest value.
Key Changes
- Modified
digest_up_to_date?to compute tag-specific expected digests for each requirement - Requirements with a tag now check their digest against the digest of the latest version of that specific tag
- Requirements without a tag continue to use the global
updated_digest(preserving existing behavior) - Added comprehensive test coverage with 6 new test contexts covering various digest scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docker/lib/dependabot/docker/update_checker.rb | Updated digest_up_to_date? method to compute expected digest per-requirement based on tag, fixing the bug where all requirements compared against a single digest |
| docker/spec/dependabot/docker/update_checker_spec.rb | Added comprehensive test suite for digest_up_to_date? covering tag+digest scenarios, multiple requirements, missing digests, and edge cases |
333edf8 to
c7b4dfb
Compare
|
@kbukum1 Unfortunately, applying Copilot's feedback and rebasing dismissed your review. Could you please review it again? |
kbukum1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
When verifying whether Docker image digests are up to date, we previously compared every requirement’s `source.digest` against `updated_digest`. This was incorrect for requirements that include a `source.tag`, as the expected digest should be derived from that _updated tag._
c7b4dfb to
9163f25
Compare
What are you trying to accomplish?
When verifying whether Docker image digests are up to date, we previously compared every requirement’s
source.digestagainstupdated_digest. This was incorrect for requirements that include asource.tag, as the expected digest should be derived from that updated tag.Fixes #11215
Anything you want to highlight for special attention from reviewers?
The updated tests should be an improvement over the previous attempts, and the accompanying integration tests should help us catch issues like this earlier in the future.
One key takeaway from #13794 is that our current integration test coverage can be improved to catch basic regressions like #13794. For that reason, I opened dependabot/smoke-tests#361 to improve the coverage
How will you know you've accomplished your goal?
- The reproducer documented in Dependabot fails for Docker updates with multiple tags in the same image #11215 no longer fails
Before :
Full logs
After:
Full logs
- There is no impact to existing updates such as https://github.com/github/dependabot-action
Full logs
After:
Full logs
Checklist