Skip to content

Provide option to force delete the project#4617

Merged
nvazquez merged 2 commits into
apache:mainfrom
ravening:cleanup-project
Sep 26, 2021
Merged

Provide option to force delete the project#4617
nvazquez merged 2 commits into
apache:mainfrom
ravening:cleanup-project

Conversation

@ravening

Copy link
Copy Markdown
Member

Description

Provide a cleanup flag so that the project will
be deleted only when there are no resources left
in the project. If users click on delete project
by mistake then everything is deleted.

Ui changes ported from apache/cloudstack-primate#848

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)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

List<NetworkVO> networks = _networkDao.listByOwner(project.getProjectAccountId());
List<? extends Vpc> vpcs = _vpcMgr.getVpcsForAccount(project.getProjectAccountId());

Optional<String> message = Stream.of(userTemplates, vmSnapshots, vms, volumes, networks, vpcs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, LGTM. But would it be better, if we could inform the user about all the resources that are tied to the project as opposed to the first one that's found - by doing something like this:

 List<String> message = Stream.of(userTemplates, vmSnapshots, vms, volumes, networks, vpcs)
                    .filter(entity -> !entity.isEmpty())
                    .map(entity -> entity.size() + " " +  entity.get(0).getEntityType().getSimpleName())
                    .collect(Collectors.toList());
 ...                   
 String msg = String.join(",", message) + " to clean up";
 CloudRuntimeException e = new CloudRuntimeException("Can't delete the project yet because it has " + msg);
 ...

Such that the end error would look like:

image

Or is this too much info??

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pearl1594 I can do that

@shwstppr shwstppr added this to the 4.16.0.0 milestone Feb 8, 2021
@yadvr

yadvr commented Mar 6, 2021

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖centos7 ✖centos8 ✖debian. JID-2880

@yadvr yadvr closed this Jun 17, 2021
@yadvr yadvr reopened this Jun 17, 2021
@yadvr

yadvr commented Jun 17, 2021

Copy link
Copy Markdown
Member

@ravening can you investigate the build failure, I'll rekick as well
@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ centos7 ✔️ centos8 ✔️ debian. SL-JID 254

@sureshanaparti

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian Build Failed (tid-1092)

@davidjumani

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@davidjumani a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✖️ suse15. SL-JID 583

@davidjumani

Copy link
Copy Markdown
Contributor

@ravening Can you fix the conflicts ? Thanks

@nvazquez

Copy link
Copy Markdown
Contributor

Hi @ravening can you please fix the conflicts?

@yadvr

yadvr commented Aug 9, 2021

Copy link
Copy Markdown
Member

ping @ravening

@ravening

Copy link
Copy Markdown
Member Author

@rhtyd @nvazquez @davidjumani done

@weizhouapache weizhouapache left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 922

@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan test

@weizhouapache weizhouapache reopened this Sep 3, 2021
@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-1958)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 34884 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4617-t1958-kvm-centos7.zip
Smoke tests completed. 87 look OK, 2 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestDeployVmWithAffinityGroup>:teardown Error 138.15 test_affinity_groups_projects.py
test_07_project_resources_account_delete Error 5.43 test_projects.py
test_08_cleanup_after_project_delete Error 5.83 test_projects.py
ContextSuite context=TestProjectResources>:teardown Error 6.89 test_projects.py
ContextSuite context=TestProjectSuspendActivate>:teardown Error 65.97 test_projects.py

@yadvr yadvr closed this Sep 15, 2021
@yadvr yadvr reopened this Sep 15, 2021
@yadvr

yadvr commented Sep 15, 2021

Copy link
Copy Markdown
Member

@ravening can you review and fix the failing project related smoketests?

@yadvr

yadvr commented Sep 22, 2021

Copy link
Copy Markdown
Member

Ping @ravening

@yadvr

yadvr commented Sep 22, 2021

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖️ el7 ✔️ el8 ✖️ debian ✖️ suse15. SL-JID 1364

@ravening

Copy link
Copy Markdown
Member Author

Ping @ravening

@rhtyd will look into it

ravening and others added 2 commits September 23, 2021 09:44
be deleted only when there are no resources left
in the project. If users click on delete project
by mistake then everything is deleted.
@ravening

Copy link
Copy Markdown
Member Author

@rhtyd @nvazquez fixed travis issues.. can you trigger it again?

@weizhouapache

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1375

@sureshanaparti

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian Build Failed (tid-2191)

@sureshanaparti

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-2193)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37337 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4617-t2193-kvm-centos7.zip
Smoke tests completed. 89 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants