Add confirmation name validation for application hibernation operations #6814
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.
This PR adds an additional confirmation step to hibernation and unhibernation operations to prevent accidental actions on applications and environments. Users are now required to type the application name or environment name to confirm the hibernation operation.
Changes Made
API Model Updates
confirmationName
field toHibernateRequest
model for single application operationsconfirmationName
field toBulkApplicationForEnvironmentPayload
model for bulk operationsSingle Application Validation
Enhanced hibernation handlers to validate confirmation names against actual application names:
appIdentifier.ReleaseName
)appIdentifier.AppName
)appIdentifier.AppName
)Bulk Operation Validation
Added environment name validation for bulk hibernation operations:
confirmationName
against the environment nameenvName
field or fetches it usingenvId
BulkHibernate
andBulkUnHibernate
operationsAPI Behavior
Response Codes:
200 OK
: Operation successful (with or without confirmation)400 Bad Request
: Confirmation name mismatch with clear error messageBackward Compatibility
The
confirmationName
field is optional, ensuring existing clients continue to work without any changes. This allows for gradual migration where frontend teams can implement confirmation dialogs at their own pace.Error Handling
When confirmation validation fails, the API returns descriptive error messages:
"confirmation name does not match application name"
"confirmation name does not match environment name"
This feature addresses user confusion between environments and provides an additional safety layer for critical hibernation operations while maintaining full backward compatibility.
Fixes #6632.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.