feat(compute): improve error message when instance not found in zone#805
Open
natalie-o-perret wants to merge 1 commit intomasterfrom
Open
Conversation
1353595 to
242469c
Compare
40b598f to
9ca3d94
Compare
242469c to
dd783eb
Compare
Base automatically changed from
natalieperret/sc-167544/feature-request-cli-add-testscript
to
master
March 4, 2026 07:32
4caef3c to
bfa2851
Compare
…[sc-167368] - Introduce findInstance helper wrapping FindListInstancesResponseInstances with a zone-aware error and -z hint when the instance is not found. - Apply findInstance across all 24 instance subcommands that look up by name/ID. - Add e2e txtar tests covering every affected command. - Redirect go test stderr in e2e CI to suppress false Error banner in Actions UI.
026fc0d to
3961716
Compare
kobajagi
reviewed
Mar 5, 2026
Contributor
There was a problem hiding this comment.
The file naming does not fit in our code organization (file name -> command name).
Put this function in the instance.go which is logically shared by all commands.
kobajagi
reviewed
Mar 5, 2026
| run: | | ||
| cd tests/e2e | ||
| go test -v -tags=api -timeout 30m -run TestScriptsAPI | ||
| go test -v -tags=api -timeout 30m -run TestScriptsAPI 2>&1 |
Contributor
There was a problem hiding this comment.
Why is stderr redirection needed now? Put at least a note about it in the PR description so it ends up in the commit message when we merge.
Contributor
Author
There was a problem hiding this comment.
It's a tiny detail, GitHub Action that shows an error cause of the presence of a stderr (when looking at the details, the job isn't in error, though just when you're about to expand the job output / details)
kobajagi
requested changes
Mar 5, 2026
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.
Description
When
exo compute instance <action>commands fail because the instance does not exist in the default zone, the error message previously surfaced a raw SDK message with no context:This PR introduces a
findInstancehelper incmd/compute/instance/instance_find.gothat wrapsFindListInstancesResponseInstancesand enriches the not-found error with the zone that was searched and a hint to use-z:Changes:
findInstancehelper incmd/compute/instance/instance_find.go, wrappingFindListInstancesResponseInstanceswith zone-aware error enrichment.show,reboot,start,stop,scale,update,reset,reset-password,reveal-password,resize-disk,scp,ssh,snapshot create,snapshot revert,security-group add/remove,private-network attach/detach/update-ip,elastic-ip attach/detach,enable-tpm,console-url,delete) to use the new helper.tests/e2e/scenarios/with-api/compute/instance_not_found_error.txtar, an API-driven e2e scenario verifying the enriched error message onshow,rebootandstop. Uses the testscript runner from tests/e2e: add API testscript runner and compute instance reboot scenario #804.Checklist
(For exoscale contributors)
CHANGELOG.md)Testing
Covered by the e2e scenario above (requires API credentials, runs under
-tags=api).