fix(config): paginate list_config_versions DynamoDB scan (#354)#367
Merged
Conversation
ConfigurationManager.list_config_versions() did a single unpaginated table.scan(). DynamoDB scans return at most 1MB per call, so on deployments with many config versions (230+) only the first ~58 were returned. Configs uploaded via CLI or the autotune agent were invisible in the UI's View/Edit Configuration page and the upload-document config-version dropdown, though they still worked when referenced by name in processing runs. Add a pagination loop over LastEvaluatedKey so all versions are returned. Fixes every caller (update_configuration, the AppSync configuration_resolver, rules_discovery, and the SDK). Add unit tests covering single-page and multi-page (paginated) scans. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 #354.
ConfigurationManager.list_config_versions()performed a single unpaginatedtable.scan()on the ConfigurationTable. Because a DynamoDB scan returns at most 1 MB per call, deployments with many config versions (the reporter had 230+) only ever saw the ~58 versions that fit on the first page.Configs uploaded via
idp-clior the autotune agent were therefore invisible in:(The configs still worked when referenced by name in processing runs — only the listing was truncated.)
Change
Add a pagination loop over
LastEvaluatedKeyinlist_config_versions()so every version is returned. Because this is the single source for config listing, the fix repairs all callers at once:update_configuration, the AppSyncconfiguration_resolver,rules_discovery, and the SDK.Testing
Added unit tests in
tests/unit/config/test_configuration_manager.py:test_list_config_versions_single_page— single-page scan returns all items, scans once.test_list_config_versions_paginates— aLastEvaluatedKeyon page 1 triggers a second scan with the correctExclusiveStartKey, and items from both pages are returned.Risk
Low. Pure additive pagination — behavior is identical when the table fits in one page (the common case), and the loop simply continues fetching otherwise. No API/signature change.
🤖 Generated with Claude Code