Skip to content

SSM: return GetParameters results in alphabetical order - #10531

Open
dailyun wants to merge 1 commit into
getmoto:masterfrom
dailyun:codex/ssm-sorted-parameters
Open

dailyun wants to merge 1 commit into
getmoto:masterfrom
dailyun:codex/ssm-sorted-parameters

Conversation

@dailyun

@dailyun dailyun commented Nov 3, 2026

Copy link
Copy Markdown

GetParameters currently returns values in set-iteration order, even though the AWS API documents alphabetical response order. This makes the mocked result order depend on Python's hash seed and differ from AWS.

Sort successful results by the parameter's actual name before serializing them. Sorting request strings would not work when names and full ARNs are mixed. Regression tests cover names, ARNs, and mixed inputs, retaining duplicate-request handling, values, and invalid-parameter reporting.

Validation on Python 3.12:

  • All three new cases fail on unchanged production code with PYTHONHASHSEED=0.
  • pytest -q tests/test_ssm: 184 passed after installing the CloudFormation extra required by four integration tests.
  • Ruff 0.14.10 check/format checks and git diff --check pass for both changed files.

Tests use mock_aws; no live AWS verification was performed. OpenAI Codex assisted with implementation and validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant