You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CloudMonkey already parses and stores the Related metadata exposed by CloudStack APIs in APIArg.Related, but findAutocompleteAPI() did not use this information during autocomplete API discovery.
This change updates autocomplete API selection to prefer authoritative Related metadata before falling back to the existing heuristic-based lookup logic. This improves reliability for entity-reference parameter completion while preserving backward compatibility with the current behavior.
Changes
Use APIArg.Related when selecting the autocomplete lookup API.
Prefer Related APIs whose noun matches the expected resource noun.
Fall back to any valid Related list* API if no noun match is found.
Preserve all existing heuristic-based lookup logic as a fallback.
Add unit test coverage for Related-based autocomplete API discovery.
Validation
Verified runtime behavior for common entity-reference parameters:
zoneid → listZones
domainid → listDomains
networkid → listNetworks
Added unit tests covering:
Related noun match selection.
Related API fallback selection.
Empty Related metadata fallback to existing heuristics.
Non-list Related metadata fallback to existing heuristics.
📦 Binary artifacts are available in the workflow run (expires on June 19, 2026).
Note: Download artifacts by clicking on the workflow run link above, then scroll to the "Artifacts" section. Artifacts from PR builds are for testing only and may contain unreviewed, malicious code.
I've updated PR #214 based on my planned Phase 1 deliverable. The implementation now uses APIArg.Related metadata for autocomplete API discovery, with fallback to the existing heuristic-based logic to preserve current behavior.
Since opening the PR, I've also added unit tests covering:
Related noun match selection
Related API fallback selection
Empty Related metadata fallback
Non-list Related metadata fallback
Map-type argument handling
The PR has been marked ready for review. Whenever you have time, I would appreciate your feedback on the approach and implementation.
Thank you!
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
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 apache/cloudstack#10442
CloudMonkey already parses and stores the Related metadata exposed by CloudStack APIs in
APIArg.Related, butfindAutocompleteAPI()did not use this information during autocomplete API discovery.This change updates autocomplete API selection to prefer authoritative Related metadata before falling back to the existing heuristic-based lookup logic. This improves reliability for entity-reference parameter completion while preserving backward compatibility with the current behavior.
Changes
APIArg.Relatedwhen selecting the autocomplete lookup API.list*API if no noun match is found.Validation
Verified runtime behavior for common entity-reference parameters:
zoneid→listZonesdomainid→listDomainsnetworkid→listNetworksAdded unit tests covering:
Build and validation:
Test results: