fix(docker_compose): support folded scalar and docker.io-prefixed image values#15100
Merged
thavaahariharangit merged 8 commits intoMay 22, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Docker Compose image updates that previously failed when the image: value was expressed as a YAML folded/literal block scalar (e.g., image: >- on its own line) and when image references were explicitly prefixed with docker.io/. It updates the docker-compose updater logic and its shared YAML image replacement regex so Dependabot can correctly rewrite these forms instead of raising Expected content to change!.
Changes:
- Extend the shared YAML image replacement logic to handle
docker.io/-prefixed images and block scalarimage:values. - Add a docker-compose updater fallback path: try the existing “dockerfile-style” replacement first, then fall back to YAML-image updating when no changes were made.
- Add a regression fixture and spec covering a folded scalar
image:with adocker.io/library/nginx:<tag>@sha256:<digest>value.
Show a summary per file
| File | Description |
|---|---|
| docker/lib/dependabot/shared/shared_file_updater.rb | Enhances YAML image: replacement to preserve docker.io/ prefix and support folded/literal block scalar forms. |
| docker/lib/dependabot/docker_compose/file_updater.rb | Adds a fallback strategy to update compose files via YAML logic when the existing replacement path makes no changes. |
| docker/spec/dependabot/docker_compose/file_updater_spec.rb | Adds a regression spec for folded-scalar image: values (with docker.io/ prefix + digest). |
| docker/spec/fixtures/docker_compose/composefiles/folded_digest | New fixture representing a folded-scalar compose image: value with docker.io/ prefix and digest. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 2
robaiken
reviewed
May 21, 2026
Drop the YAML fallback path in the docker_compose updater and revert the shared_file_updater refactor. Folded/literal block scalar image: values are now handled by extending the existing dockerfile-style declaration regex with an optional YAML block scalar indicator.
robaiken
approved these changes
May 22, 2026
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?
Resolves #13351
Adds support in the
docker_composefile updater for image values written as folded/literal YAML block scalars (e.g.image: >-on its own line) and for values explicitly prefixed withdocker.io/. Previously these forms were not matched by the updater’s replacement regex, causing the update to fail with Expected content to change! and preventing a PR from being created.Anything you want to highlight for special attention from reviewers?
How will you know you've accomplished your goal?
Reproduced the failure in a minimal workflow: https://github.com/thavaahariharangit/docker-compose-core-issue-13351/actions/runs/26227433049/job/77178148320
Before the fix, the updater errored out and no PR was created:
After the fix, running the updater locally against the same repo produces the expected PR:
A regression spec covering the folded scalar
image:form with adocker.io/library/nginx:<tag>@sha256:<digest>value has been added, and the fulldockeranddocker_composefile updater specs pass.Checklist