feat(pull_policy): add pull_if_missing and make it the default#254
Merged
Conversation
Adds PullPolicy.pull_if_missing/0 which inspects the local Docker daemon and only pulls the image if it is not already present, avoiding Docker Hub rate limits. Changes the default pull policy (when neither set on the container config nor overridden via the "pull.policy" property) from always_pull to pull_if_missing, matching testcontainers-java behavior. Also addresses all credo --strict and dialyzer warnings across the codebase and wires `mix credo --strict` into the Elixir CI workflow.
Contributor
|
This is wonderful 🥳 I let it use for quite some time. Telling AI to use TDD for fixing the tests, running in the background. Maybe it fixes them (that is unchanged), but it doesn't stop anymore due to rate limits 🎉 |
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.
Summary
Fixes #250.
PullPolicy.pull_if_missing/0, which inspects the local Docker daemon and only pulls the image if it is not already present. This avoids Docker Hub rate limits when running containers whose images are already cached locally.pull_if_missingthe default when nopull_policyis set on the container config and"pull.policy"is not overridden via properties."always"and"never"remain opt-in, matching testcontainers-java semantics.mix credo --strictfindings (numbers with underscores,@moduledoc, alphabetical aliases, struct-in-@SPEC →t(), nested/complex function extraction,with→casewhere only one<-, etc.) and wiresmix credo --strictinto.github/workflows/elixir.yml.pattern_match_covin the newDocker.Api.image_exists?/2.Test plan
mix credo --strict— 0 issuesmix dialyzer— passesmix test— 191 tests, 0 failures (including 2 new tests forpull_if_missing: one where the image is already tagged locally and pulling is skipped, one where the image is deleted and must be pulled)