fix(local): detect docker compose v2+ when version has no 'v' prefix - #6231
Merged
mohamedzeidan2021 merged 1 commit intoSep 1, 2026
Conversation
Docker Compose installed via Homebrew reports its version without a leading 'v' (e.g. "Docker Compose version 2.22.0"). The detection regex `v(\d+)` required a literal 'v' before the digits, so `_get_compose_cmd_prefix` failed to recognize a valid Compose v2+ plugin in that case. Change the regex to `version\s+v?(\d+)`, making the 'v' optional and anchoring to the "version" keyword so a stray number elsewhere in the output can't cause a false positive. v1 is still correctly rejected. Applied to all three v3 copies (core local image, core modules local container, train local container) with regression tests for the no-'v'-prefix format. Fixes aws#4137
|
Claude finished @mohamedzeidan2021's task in 1m 0s —— View job PR Review — Docker Compose version detection fix
Verdict: ✅ Looks goodThe fix is correct, minimal, and consistently applied. Changing
TestsRegression tests for the no-'v'-prefix format were added to all three test suites ( Minor (optional, non-blocking)
Nothing else stood out — no correctness, security, or backward-compat concerns. The change is a pure bug fix to an internal detection helper ( |
lucasjia-aws
approved these changes
Sep 1, 2026
mohamedzeidan2021
deleted the
fix/docker-compose-version-no-v-prefix-4137
branch
September 1, 2026 18:11
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.
Docker Compose installed via Homebrew reports its version without a leading 'v' (e.g. "Docker Compose version 2.22.0"). The detection regex
v(\d+)required a literal 'v' before the digits, so_get_compose_cmd_prefixfailed to recognize a valid Compose v2+ plugin in that case.Change the regex to
version\s+v?(\d+), making the 'v' optional and anchoring to the "version" keyword so a stray number elsewhere in the output can't cause a false positive. v1 is still correctly rejected.Applied to all three v3 copies (core local image, core modules local container, train local container) with regression tests for the no-'v'-prefix format.
Fixes #4137
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.