You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by "dheeraj12347 (via GitHub)" <gi...@apache.org> on 2026/06/08 20:26:56 UTC

[PR] Use Related metadata for autocomplete API discovery [cloudstack-cloudmonkey]

dheeraj12347 opened a new pull request, #214:
URL: https://github.com/apache/cloudstack-cloudmonkey/pull/214

   ## Summary
   Fixes apache/cloudstack#10442
   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 `Related` metadata before falling back to the existing heuristic-based lookup.
   
   ## 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.
   
   ## Validation
   
   Verified runtime behavior for common entity-reference parameters:
   
   - `zoneid` → `listZones`
   - `domainid` → `listDomains`
   - `networkid` → `listNetworks`
   
   Build and validation:
   
   ```bash
   go fmt ./...
   go test ./...
   go build -o bin/cmk .


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use Related metadata for autocomplete API discovery [cloudstack-cloudmonkey]

Posted by "borisstoyanov (via GitHub)" <gi...@apache.org>.
borisstoyanov merged PR #214:
URL: https://github.com/apache/cloudstack-cloudmonkey/pull/214


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use Related metadata for autocomplete API discovery [cloudstack-cloudmonkey]

Posted by "dheeraj12347 (via GitHub)" <gi...@apache.org>.
dheeraj12347 commented on PR #214:
URL: https://github.com/apache/cloudstack-cloudmonkey/pull/214#issuecomment-4750046527

   Hi @Pearl1594 and @soreana,
   
   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 is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use Related metadata for autocomplete API discovery [cloudstack-cloudmonkey]

Posted by "dheeraj12347 (via GitHub)" <gi...@apache.org>.
dheeraj12347 commented on PR #214:
URL: https://github.com/apache/cloudstack-cloudmonkey/pull/214#issuecomment-5225477236

   > @dheeraj12347 thanks for this feature, can you share your testing please. I'm including it in the milestone
   
   Hi @borisstoyanov , thanks!
   
   For PR #214, I previously validated the changes with:
   
   * `go fmt ./...`
   * `go test ./...`
   * `go build -o bin/cmk .`
   
   The relevant package tests passed (`github.com/apache/cloudstack-cloudmonkey/cli`).
   
   I also manually verified autocomplete for common entity-reference parameters:
   
   * `zoneid` → `listZones`
   * `domainid` → `listDomains`
   * `networkid` → `listNetworks`
   
   The added unit tests cover Related noun matching, Related API fallback, empty/non-list Related metadata fallback, and map-type arguments.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use Related metadata for autocomplete API discovery [cloudstack-cloudmonkey]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #214:
URL: https://github.com/apache/cloudstack-cloudmonkey/pull/214#issuecomment-4657013615

   <!-- cmk-build-artifact-comment -->
   ✅ Build complete for PR #214.
   
   📦 Binary artifacts are available in the [workflow run](https://github.com/apache/cloudstack-cloudmonkey/actions/runs/27164883165) (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._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Use Related metadata for autocomplete API discovery [cloudstack-cloudmonkey]

Posted by "borisstoyanov (via GitHub)" <gi...@apache.org>.
borisstoyanov commented on PR #214:
URL: https://github.com/apache/cloudstack-cloudmonkey/pull/214#issuecomment-5203285295

   @dheeraj12347 thanks for this feature, can you share your testing please. I'm including it in the milestone


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org