Skip to content

refactor(metastore): order resources returned by age#904

Merged
AlessandroPomponio merged 1 commit into
mainfrom
ap_902_sort_get_resources
Apr 23, 2026
Merged

refactor(metastore): order resources returned by age#904
AlessandroPomponio merged 1 commit into
mainfrom
ap_902_sort_get_resources

Conversation

@AlessandroPomponio
Copy link
Copy Markdown
Member

Summary

This PR adds sorting functionality to the getResources method in SQLResourceStore to return resources ordered by their created timestamp in ascending order (oldest first). This change ensures consistency with the AGE sorting behavior used in CLI commands.

Resolve #902 with a bit of a hack. Proper rework of metastore methods will be delegated to #903

Files Changed

📄 orchestrator/metastore/sqlstore.py

Updated the getResources method to sort the returned dictionary by the created timestamp of each resource in ascending order. The method now returns resources ordered from oldest to newest, matching the AGE sorting behavior used in CLI commands. Documentation was also enhanced to clearly describe this sorting behavior.

📄 tests/metastore/test_resourcestore.py

Added a new test test_get_resources_sorted_by_created_ascending to verify that the getResources method correctly returns resources sorted by their created timestamp in ascending order. The test creates three resources with explicit timestamps, retrieves them, and validates that they are returned in the correct chronological order (oldest first).

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
@AlessandroPomponio AlessandroPomponio added this pull request to the merge queue Apr 23, 2026
Merged via the queue into main with commit 16288d0 Apr 23, 2026
19 checks passed
@AlessandroPomponio AlessandroPomponio deleted the ap_902_sort_get_resources branch April 23, 2026 11:31
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.

bug: output of ado get is inconsistently ordered

2 participants