Skip to content
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

Allow users to delete AppNamespace #4499

Merged
merged 68 commits into from
Aug 13, 2022

Conversation

klboke
Copy link
Contributor

@klboke klboke commented Aug 3, 2022

What's the purpose of this PR

Consistent with user deletion of Namespace and administrator deletion of AppNamespace

klboke and others added 30 commits May 16, 2019 11:07
@klboke klboke requested a review from nobodyiam August 3, 2022 10:35
@codecov-commenter
Copy link

codecov-commenter commented Aug 3, 2022

Codecov Report

Merging #4499 (4696f13) into master (4ca9739) will decrease coverage by 0.01%.
The diff coverage is 65.00%.

@@             Coverage Diff              @@
##             master    #4499      +/-   ##
============================================
- Coverage     53.46%   53.45%   -0.02%     
- Complexity     2703     2704       +1     
============================================
  Files           490      491       +1     
  Lines         15347    15395      +48     
  Branches       1598     1599       +1     
============================================
+ Hits           8205     8229      +24     
- Misses         6585     6607      +22     
- Partials        557      559       +2     
Impacted Files Coverage Δ
.../apollo/portal/controller/NamespaceController.java 11.82% <0.00%> (-0.40%) ⬇️
...ork/apollo/portal/service/AppNamespaceService.java 66.00% <ø> (ø)
...mework/apollo/portal/entity/vo/NamespaceUsage.java 51.72% <51.72%> (ø)
...mework/apollo/portal/service/NamespaceService.java 72.39% <85.71%> (+0.80%) ⬆️
...work/apollo/biz/message/DatabaseMessageSender.java 56.25% <0.00%> (-8.34%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

apollo-portal/src/main/resources/static/i18n/en.json Outdated Show resolved Hide resolved
apollo-portal/src/main/resources/static/i18n/zh-CN.json Outdated Show resolved Hide resolved
apollo-portal/src/main/resources/static/i18n/zh-CN.json Outdated Show resolved Hide resolved
if (!checkBranchInstance(toDeleteNamespace)) {
return;
}
if(toDeleteNamespace.isLinkedNamespace){
Copy link
Member

Choose a reason for hiding this comment

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

For public and private namespaces, I think we still need to check the instances bycheckMasterInstance and checkBranchInstance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • Here it is considered that the user delete action is expected.
  • Only the current environment and the usage of the current cluster can be checked here, and deleting the AppNamespace will affect all clusters, so the logic here remains consistent with the administrator's deletion
  • Or, is there a need to check the usage of all clusters in all environments?

Copy link
Member

Choose a reason for hiding this comment

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

In this case, there is a detailed message indicating that this operation will cause the instances unable to get the configuration, so I think it's ok to not checkMasterInstance and checkBranchInstance.
If we don't check for public and private namespaces, I suppose we don't need to check for linked namespaces?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we don't check for public and private namespaces, I suppose we don't need to check for linked namespaces?

Yes, I think they are the same type of problem

Copy link
Member

Choose a reason for hiding this comment

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

So maybe we could simplify the logic as the following?

                //1. check operator has master permission
                checkPermission(toDeleteNamespace).then(function () {

                    if (!toDeleteNamespace.isPublic || toDeleteNamespace.isLinkedNamespace) {
                        showDeleteNamespaceConfirmDialog();
                    } else {
                        //2. check public namespace has not associated namespace
                        checkPublicNamespace(toDeleteNamespace).then(function () {
                            showDeleteNamespaceConfirmDialog();
                        });
                    }
                })

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The logic for deleting different types of Namespace on the user side has been unified, and a uniform instance usage prompt message is added before deletion, e.g.

  • Delete private Namespace

image

image

  • Delete public Namespace

image

image

  • Delete linked Namespace

image

image

klboke and others added 3 commits August 4, 2022 09:34
Co-authored-by: Jason Song <nobodyiam@gmail.com>
Co-authored-by: Jason Song <nobodyiam@gmail.com>
Co-authored-by: Jason Song <nobodyiam@gmail.com>
@klboke klboke requested a review from nobodyiam August 4, 2022 01:57
Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

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

It looks great! Please find some comments below.

klboke and others added 11 commits August 12, 2022 13:14
Co-authored-by: Jason Song <nobodyiam@gmail.com>
Co-authored-by: Jason Song <nobodyiam@gmail.com>
…te-namespace-modal-directive.js

Co-authored-by: Jason Song <nobodyiam@gmail.com>
…te-namespace-modal-directive.js

Co-authored-by: Jason Song <nobodyiam@gmail.com>
…te-namespace-modal-directive.js

Co-authored-by: Jason Song <nobodyiam@gmail.com>
…te-namespace-modal-directive.js

Co-authored-by: Jason Song <nobodyiam@gmail.com>
…te-namespace-modal-directive.js

Co-authored-by: Jason Song <nobodyiam@gmail.com>
…controller/NamespaceController.java

Co-authored-by: Jason Song <nobodyiam@gmail.com>
…controller/NamespaceController.java

Co-authored-by: Jason Song <nobodyiam@gmail.com>
@klboke klboke requested a review from nobodyiam August 12, 2022 08:01
Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

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

LGTM

@nobodyiam nobodyiam merged commit 93e557e into apolloconfig:master Aug 13, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2022
@nobodyiam nobodyiam added this to the 2.1.0 milestone Feb 5, 2023
@klboke klboke deleted the deleted-namespace branch March 21, 2023 03:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants