Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add confirmation name validation for application hibernation operations#6814

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge2 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/fix-6632

Conversation

Copy link

CopilotAI commentedSep 4, 2025
edited
Loading

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

  • Added optionalconfirmationName field toHibernateRequest model for single application operations
  • Added optionalconfirmationName field toBulkApplicationForEnvironmentPayload model for bulk operations
  • Both fields include proper JSON marshaling/unmarshaling support

Single Application Validation

Enhanced hibernation handlers to validate confirmation names against actual application names:

  • Helm Applications: Validates against the release name (appIdentifier.ReleaseName)
  • Argo Applications: Validates against the application name (appIdentifier.AppName)
  • Flux Applications: Validates against the application name (appIdentifier.AppName)

Bulk Operation Validation

Added environment name validation for bulk hibernation operations:

  • ValidatesconfirmationName against the environment name
  • Resolves environment name fromenvName field or fetches it usingenvId
  • Applied to bothBulkHibernate andBulkUnHibernate operations

API Behavior

// Single app hibernation with confirmationPOST /orchestrator/api/v1/applications/hibernate?appType=1{"appId":"1|default|nginx-app","confirmationName":"nginx-app"}// Bulk hibernation with confirmationPOST /orchestrator/bulk/v1beta1/hibernate{"envId":1,"envName":"production","confirmationName":"production"}

Response Codes:

  • 200 OK: Operation successful (with or without confirmation)
  • 400 Bad Request: Confirmation name mismatch with clear error message

Backward Compatibility

TheconfirmationName 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:

  • Single apps:"confirmation name does not match application name"
  • Bulk operations:"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! Clickhere to start the survey.

@bito-code-review
Copy link

Bito Automatic Review Skipped - Draft PR

Bito didn't auto-review because this pull request is in draft status.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type/review in a comment and save.
You can change draft PR review settingshere, or contact your Bito workspace admin atshivam@devtron.ai.

Co-authored-by: prakarsh-dt <71125043+prakarsh-dt@users.noreply.github.com>
CopilotAI changed the title[WIP] Feature: Need an additional confirmation by asking the application name while hibernating the applicationAdd confirmation name validation for application hibernation operationsSep 4, 2025
Copilot finished work on behalf ofprakarsh-dtSeptember 4, 2025 11:08
@sonarqubecloud
Copy link

Quality Gate FailedQuality Gate failed

Failed conditions
42.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@bito-code-review
Copy link

Bito Automatic Review Skipped - Draft PR

Bito didn't auto-review because this pull request is in draft status.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type/review in a comment and save.
You can change draft PR review settingshere, or contact your Bito workspace admin atshivam@devtron.ai.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@prakarsh-dtprakarsh-dtAwaiting requested review from prakarsh-dtprakarsh-dt is a code owner

@vikramdevtronvikramdevtronAwaiting requested review from vikramdevtronvikramdevtron will be requested when the pull request is marked ready for reviewvikramdevtron is a code owner

@vivek-devtronvivek-devtronAwaiting requested review from vivek-devtronvivek-devtron will be requested when the pull request is marked ready for reviewvivek-devtron is a code owner

At least 1 approving review is required to merge this pull request.

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Feature: Need an additional confirmation by asking the application name while hibernating the application

2 participants

@prakarsh-dt

[8]ページ先頭

©2009-2025 Movatter.jp