-
Notifications
You must be signed in to change notification settings - Fork 1k
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
docker: FileParser consider image prefix/suffixes as unique #3627
Conversation
@dependabot/reviewers I'd dig an early peek at this thinking: it seems promising (e.g. dry-runs in the OP) but I may be missing something. I intend to follow up with tests before RFR. |
I had a prior look at this as a day of learning exercise when looking into #3173. I started with a similar approach and there were some concerns about increasing the # of PRs we'd open: #3251 That led to #3277 which was able to make all the changes in the same PR but didn't yet support this multi stage docker case. That said, I think it's worth revisiting if this is the better change. It's simpler and avoids some awkwardness when the PR says it's updating |
@mctofu noice, that's exactly the context I was looking for! I pinged the reporters in #3261 for their expectations about single/multiple PRs. I'm pondering a middle ground where instead of using |
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.
The goal would be to keep php:8.0.1 and php:8.0.3 as grouped dependencies, but treat php:8.0.1 as a distinct from php:8.0.1-apache and php:8.0.1-cli.
This sounds like a good approach and I like that the change is pretty minimal 👍
Thinking about it, there's probably not a huge number of projects with the same image with different prefixes/suffixes (assuming we'd hear a lot more noise if it was the case?) so probably won't start creating a lot more PRs and fixes currently broken PRs which is a big plus 💯
This modifies the
Dependabot::Docker::FileParser
to treat image variants likeimage:1.0.0
andimage:1.0.0-alpine
as unique dependencies, even within a single multistage Dockerfile.Consider a multistage Dockerfile like:
Previously, Dependabot would parse this as multiple requirements for an image called
nginx
, and update allFROM
statements to a single image if available.By switching the parsing to allow multiple versions, the existing suffix handling code "just works" 🎉 .
Pre
Post
Related