You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "sudo87 (via GitHub)" <gi...@apache.org> on 2026/05/05 07:25:29 UTC
[PR] Make resource deletion safer with name confirmation [cloudstack]
sudo87 opened a new pull request, #13104:
URL: https://github.com/apache/cloudstack/pull/13104
### Description
This PR will allow enforcing user to key in resource name before proceeding with Delete.
<!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
It can be enabled by adding a param "requireNameConfirmation: true" for the delete api section
```
{
api: 'deleteProject',
........
........
requireNameConfirmation: true,
.........
}
```
<!-- For new features, provide link to FS, dev ML discussion etc. -->
<!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
<!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
<!-- Fixes: # -->
<!--- ******************************************************************************* -->
<!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
<!--- PLEASE PUT AN 'X' in only **ONE** box -->
<!--- ******************************************************************************* -->
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] Build/CI
- [ ] Test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [ ] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
<img width="448" height="408" alt="delete_project" src="https://github.com/user-attachments/assets/cd167927-9936-45ce-a8a4-ab2e8fff687f" />
### How Has This Been Tested?
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran to -->
#### How did you try to break this feature and the system with this change?
<!-- see how your change affects other areas of the code, etc. -->
<!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make resource deletion safer with name confirmation [cloudstack]
Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on code in PR #13104:
URL: https://github.com/apache/cloudstack/pull/13104#discussion_r3200593127
##########
ui/src/views/AutogenView.vue:
##########
@@ -1642,6 +1647,12 @@ export default {
},
handleSubmit (e) {
if (this.actionLoading) return
+
+ if (this.currentAction?.requireNameConfirmation && !(this.currentAction.groupAction && this.selectedRowKeys.length > 0)) {
+ if (this.actionConfirmText.trim() !== this.resource?.name?.trim()) {
Review Comment:
should we have trim here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make resource deletion safer with name confirmation [cloudstack]
Posted by "harikrishna-patnala (via GitHub)" <gi...@apache.org>.
harikrishna-patnala merged PR #13104:
URL: https://github.com/apache/cloudstack/pull/13104
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make resource deletion safer with name confirmation [cloudstack]
Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on code in PR #13104:
URL: https://github.com/apache/cloudstack/pull/13104#discussion_r3200617439
##########
ui/src/views/AutogenView.vue:
##########
@@ -195,8 +195,6 @@
:footer="null"
style="top: 20px;"
:width="modalWidth"
- :ok-button-props="getOkProps()"
- :cancel-button-props="getCancelProps()"
Review Comment:
Why is this not required?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make resource deletion safer with name confirmation [cloudstack]
Posted by "sudo87 (via GitHub)" <gi...@apache.org>.
sudo87 commented on PR #13104:
URL: https://github.com/apache/cloudstack/pull/13104#issuecomment-4378079395
@blueorangutan ui
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make resource deletion safer with name confirmation [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13104:
URL: https://github.com/apache/cloudstack/pull/13104#issuecomment-4378231038
UI build: :heavy_check_mark:
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/13104 (QA-JID-915)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make resource deletion safer with name confirmation [cloudstack]
Posted by "sudo87 (via GitHub)" <gi...@apache.org>.
sudo87 commented on code in PR #13104:
URL: https://github.com/apache/cloudstack/pull/13104#discussion_r3200766755
##########
ui/src/views/AutogenView.vue:
##########
@@ -195,8 +195,6 @@
:footer="null"
style="top: 20px;"
:width="modalWidth"
- :ok-button-props="getOkProps()"
- :cancel-button-props="getCancelProps()"
Review Comment:
This is not required as footer is set null.
https://github.com/apache/cloudstack/pull/13104#discussion_r3186726153
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make resource deletion safer with name confirmation [cloudstack]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #13104:
URL: https://github.com/apache/cloudstack/pull/13104#discussion_r3186726132
##########
ui/src/views/AutogenView.vue:
##########
@@ -1642,6 +1666,12 @@ export default {
},
handleSubmit (e) {
if (this.actionLoading) return
+
+ if (this.currentAction?.requireNameConfirmation && !(this.currentAction.groupAction && this.selectedRowKeys.length > 0)) {
+ if (this.actionConfirmText.trim() !== this.resource?.name?.trim()) {
+ return
+ }
+ }
Review Comment:
The name-confirmation guard is explicitly skipped for group actions (`currentAction.groupAction && selectedRowKeys.length > 0`), so bulk deletes still proceed without any extra confirmation. This seems to conflict with the PR description of enforcing name confirmation for deletes. Consider either disabling bulk delete when `requireNameConfirmation` is enabled, or introducing a bulk-friendly confirmation (e.g., typing a fixed keyword like "DELETE" or the number of selected items).
##########
ui/src/views/AutogenView.vue:
##########
@@ -270,8 +270,18 @@
</a-table>
</div>
<br v-if="currentAction.paramFields.length > 0" />
- </span>
- <a-form
+ </span>
+ <div v-if="currentAction.requireNameConfirmation && !(currentAction.groupAction && selectedRowKeys.length > 0)" style="margin-bottom: 5px">
+ <a-form-item>
+ <a-input v-model:value="actionConfirmText" :placeholder="resource.name" />
+ </a-form-item>
Review Comment:
`requireNameConfirmation` renders a standalone `<a-form-item>` outside of any `<a-form>`. In ant-design-vue this FormItem relies on injected form context; outside a form it can lose layout/validation behavior and may emit warnings. Consider either moving this confirmation input inside the existing `<a-form>` (as a simple `<a-form-item>` without validation rules) or replace it with plain layout components (e.g., `<div>` + `<a-input>`).
##########
ui/src/config/section/project.js:
##########
@@ -162,6 +162,7 @@ export default {
},
groupAction: true,
popup: true,
+ requireNameConfirmation: true,
groupMap: (selection, values) => { return selection.map(x => { return { id: x, cleanup: values.cleanup || null } }) },
Review Comment:
`requireNameConfirmation: true` is enabled for `deleteProject` while `groupAction: true` remains. In bulk-delete mode the UI currently bypasses the name-confirmation flow, so this config doesn't fully enforce the intended safety check. Consider either disabling `groupAction` for deletes that require name confirmation, or pairing it with a bulk confirmation mechanism.
##########
ui/src/views/AutogenView.vue:
##########
@@ -195,7 +195,7 @@
:footer="null"
style="top: 20px;"
:width="modalWidth"
- :ok-button-props="getOkProps()"
+ :ok-button-props="okButtonProps"
:cancel-button-props="getCancelProps()"
Review Comment:
`okButtonProps` is passed into `<a-modal>` but this modal sets `:footer="null"` and uses custom footer buttons, so `ok-button-props` will not affect the actual submit button state. Consider removing `okButtonProps` entirely (and rely only on `:disabled="isSubmitDisabled"`), or switching back to the built-in modal footer and wiring `@ok` so the disabled state is enforced in one place.
##########
ui/src/views/AutogenView.vue:
##########
@@ -1642,6 +1666,12 @@ export default {
},
handleSubmit (e) {
if (this.actionLoading) return
+
+ if (this.currentAction?.requireNameConfirmation && !(this.currentAction.groupAction && this.selectedRowKeys.length > 0)) {
+ if (this.actionConfirmText.trim() !== this.resource?.name?.trim()) {
+ return
+ }
+ }
Review Comment:
There are existing unit tests for `handleSubmit`, but none cover the new `requireNameConfirmation` path (blocking submit when the text doesn't match, allowing when it does, and ensuring bulk actions behave as intended). Add tests to `ui/tests/unit/views/AutogenView.spec.js` to prevent regressions in this deletion-safety feature.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make resource deletion safer with name confirmation [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #13104:
URL: https://github.com/apache/cloudstack/pull/13104#issuecomment-4377338887
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/13104?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 3.53%. Comparing base ([`1e512ab`](https://app.codecov.io/gh/apache/cloudstack/commit/1e512ab9c6505641a944db2c878514e189b9f5f6?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`60848ce`](https://app.codecov.io/gh/apache/cloudstack/commit/60848cedf2166502b124446605fe6923ad0eb9ec?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
> :exclamation: There is a different number of reports uploaded between BASE (1e512ab) and HEAD (60848ce). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (1e512ab) | HEAD (60848ce) |
>|------|------|------|
>|unittests|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #13104 +/- ##
=============================================
- Coverage 18.08% 3.53% -14.55%
=============================================
Files 6037 464 -5573
Lines 542437 40149 -502288
Branches 66420 7561 -58859
=============================================
- Hits 98088 1419 -96669
+ Misses 433333 38539 -394794
+ Partials 11016 191 -10825
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/13104/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/13104/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `3.53% <ø> (+<0.01%)` | :arrow_up: |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/13104/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/13104?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make resource deletion safer with name confirmation [cloudstack]
Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on code in PR #13104:
URL: https://github.com/apache/cloudstack/pull/13104#discussion_r3200593127
##########
ui/src/views/AutogenView.vue:
##########
@@ -1642,6 +1647,12 @@ export default {
},
handleSubmit (e) {
if (this.actionLoading) return
+
+ if (this.currentAction?.requireNameConfirmation && !(this.currentAction.groupAction && this.selectedRowKeys.length > 0)) {
+ if (this.actionConfirmText.trim() !== this.resource?.name?.trim()) {
Review Comment:
should we have trim here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make resource deletion safer with name confirmation [cloudstack]
Posted by "sudo87 (via GitHub)" <gi...@apache.org>.
sudo87 commented on code in PR #13104:
URL: https://github.com/apache/cloudstack/pull/13104#discussion_r3187195345
##########
ui/src/config/section/project.js:
##########
@@ -162,6 +162,7 @@ export default {
},
groupAction: true,
popup: true,
+ requireNameConfirmation: true,
groupMap: (selection, values) => { return selection.map(x => { return { id: x, cleanup: values.cleanup || null } }) },
Review Comment:
It is expected to bypass name confirmation in bulk-delete mode.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Make resource deletion safer with name confirmation [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #13104:
URL: https://github.com/apache/cloudstack/pull/13104#issuecomment-4378085363
@sudo87 a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org