-
Notifications
You must be signed in to change notification settings - Fork 4
STAC-23287: Add --wait functionality to stackpack install and upgrade commands #113
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
Conversation
…r operations to complete
Manual Testing ReportTest Case 1: Installation fails due to wrong contentStep 1: Scaffold a stackpack projectCommand: STS_EXPERIMENTAL_STACKPACK=1 go run main.go stackpack scaffold --name installation-failOutput: Result: ✅ SUCCESS - Stackpack project scaffolded successfully Step 2: Make an invalid configurationCommand: echo "hello world" > installation-fail/provisioning/monitors.styOutput: Result: ✅ SUCCESS - Invalid content written to monitors.sty Step 3: Package the stackpackCommand: STS_EXPERIMENTAL_STACKPACK=1 go run main.go stackpack package -d installation-failOutput: Result: ✅ SUCCESS - Stackpack packaged successfully despite invalid content Step 4: Upload the stackpack archiveCommand: STS_EXPERIMENTAL_STACKPACK=1 go run main.go stackpack upload -f installation-fail-0.0.1.zipOutput: Result: ✅ SUCCESS - Stackpack uploaded successfully Step 5: Trigger the installation of the stackpack with wait - should failCommand: STS_EXPERIMENTAL_STACKPACK=1 go run main.go stackpack install --name installation-fail --waitOutput: Result: ✅ SUCCESS - Wait functionality correctly detected installation failure! Test Case 2: Upgrade fails due to wrong contentStep 1: Scaffold a stackpack projectCommand: STS_EXPERIMENTAL_STACKPACK=1 go run main.go stackpack scaffold --name upgrade-failOutput: ✅ SUCCESS - Scaffolding successful Steps 2-4: Package, Upload, and Install Initial Version (v0.0.1)Commands executed successfully:
Initial Install Output: Result: ✅ SUCCESS - Initial installation completed successfully with wait functionality Steps 5-8: Create Invalid v0.0.2 and UpgradeCommands:
Step 9: Trigger upgrade with wait - should failCommand: STS_EXPERIMENTAL_STACKPACK=1 go run main.go stackpack upgrade --name upgrade-fail --unlocked-strategy skip --waitOutput: Result: ✅ SUCCESS - Wait functionality correctly detected upgrade failure! |
Summary
Extends the
stackpack installandstackpack upgradecommands with--waitfunctionality that monitors operation completion status with configurable timeout.Changes
Core Functionality
--waitflag to bothstackpack installandstackpack upgradecommands--timeoutflag with default 1 minute timeout for wait operationsOperationWaiterincmd/stackpack/common.gofor reusable wait logicfetchAllStackPacks()API polling mechanismNewRuntimeErrorArchitecture
OperationWaitercan be used by other commandscommon.go, command-specific logic in respective filesStatusInstalled,StatusProvisioning,StatusErrorfor clarityfetchAllStackPacksfromstackpack_list.gotocommon.gofor reuseBehavior
Usage Examples
Testing
Comprehensive Test Coverage
OperationWaiterfunctionality incommon_test.goTest Scenarios Covered
Implementation Details
Status Monitoring
StackPackConfiguration.Statusfield throughfetchAllStackPacks()APIINSTALLED(success),PROVISIONING(in progress),ERROR(failure)Error Handling
NewRuntimeErrorto avoid showing usage on operation failuresCode Quality