-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stack.Cancel support in dotnet Automation API #6729
Conversation
CC @orionstudt |
I think we should be doing As for the 2 potential errors you mentioned, are those errors the CLI will throw? Perhaps we can just allow those to be caught by |
If we do this we'll need to remove it in the 3.0 branch since we're migrating to using the |
@komalali makes sense - is there a PR that already did that? If not I think we add |
@orionstudt yes, the PR is linked in my comment above but here it again: #6415 |
Roger. Didn't realize it was already merged. Than yea just |
FWIW that PR (6415) actually just adds |
Awesome, thank you! I will finish this up tomorrow and try to cook some tests for it especially. |
Coming back to this. The test is not entirely satisfactory, since it will accept either Destroy or Cancel task failing, but I did not want to check in something intentionally flaky, and I'm not sure how one would make it deterministic. I have verified locally that we at least sometimes hit the branch where Cancel task succeeds in preempting Destroy. @komalali ready for review 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job with the test, it's a tough one to test for sure!
* First cut at Cancel * Add a racecond-based test for Cancel * Auto-gen xml updates * Fix code formatting * Add CHANGELOG entry
Go implementation does SelectStack first, which I think mutates workspace to current stack. Should we do the same for consistency?
Do we want CancelOptions with "OnStandardOutput" etc?
In cases where the operation fails, as in, (1) there is no pending update; (2) it's unsupported on the local workspace, do we signal these with exceptions or error codes?
Testing can be a bit tricky here let me think how to test this.