-
-
Notifications
You must be signed in to change notification settings - Fork 652
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: Support multiple cache_from
values for docker_image
.
#20600
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bb64598
Initial attempt at making 'cache_from' support a list
f974988
bump actions
862149e
Formatting fix
9abcaef
Fix type errors
b0d4017
Fix again
f721ecb
Fix doc formatting
c63ed91
Support passing single dict
939fd0c
Update docs
efa1a33
Fix flake8
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Does this old value continue to work? Or does it become a hard error after this change?
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.
It will be a hard error as it is validating against a list in
target.py
belowThere 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.
Ah I see. That's potentially something we should try to improve, given this is a feature released as stable and even highlighted in release notes (e.g. https://www.pantsbuild.org/blog/2024/01/24/pants-2-19#docker-improvements), so making a change like this would mean that any users who've adopted it will have a harder time upgrading.
Do we have any path for doing this with some sort of a deprecation and guidance for users? I can think of:
dict
or alist
of such (and can emit deprecation warnings about thedict
version, to eventually be able to remove that code)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.
Yes, I was wondering what we want to do / usually do there.
Probably the easiest is to modify the
ListOfDictStringToStringField
to accept a single dict - I think that would be reasonable in general.I'm not sure if we would want a deprecation - or just always allow both a single dict / list of dicts.
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.
Wow, nice catch @huonw
I agree that translating a dict value into a single element list wrapping the dict is a sensible thing to do.
Question is if we want to accept this as a feature long term, or if we want to issue a warning doing so, to urge users to explicitly use a single value list?
I think supporting this as a feature does align with how list options are supported on the cli. I.e.
--flag=1 --flag=2
collects into a list option of[1, 2]
. It's not the same, for sure, but the semantics are close enough I think.