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

Split Organization.LimitCollectionCreationDeletion into two separate business rules #11223

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

addisonbeck
Copy link
Contributor

@addisonbeck addisonbeck commented Sep 24, 2024

🎟️ Tracking

🧵 Jira Ticket: PM-10863

📚 Stacked PRs

  1. server: Split LimitCollectionCreationDeletion into two database columns server#4709
  2. server: Split Organization.LimitCollectionCreationDeletion into two separate business rules server#4730
  3. clients: Split Organization.LimitCollectionCreationDeletion into two separate business rules #11223
    ⬆️ YOU ARE HERE
  4. server: Turn on LimitCollectionCreationDeletionSplit for self host server#4808
  5. server: Remove LimitCollectionCreationDeletionSplit feature flag server#4809
  6. clients: Remove LimitCollectionCreationDeletionSplit feature flag #11258
  7. server: Drop LimitCollectionCreationDeletion from the database server#4810

📔 Objective

🤳 The Bigger Picture

There is an option in the Admin Console that removes collection creation and
deletion controls from all organization members that are not in the Owner and
Admin roles. This PR stack splits this conjoined option into two separate
controls: one to block create operations and one to block delete
operations. This is a part of an effort to make these settings better align
with what customers expect it to do.

👉 This Pull Request 👍

In the previous PR we implemented the new functionality requested from this
effort in server. On this PR we apply those new rules to clients. This
involves adding the feature toggle to clients and implementing two new
boolean settings in the admin console behind that feature toggle.

This PR, its predecessor in server, and the next PR in the stack encompass
all of the functional changes to the system implemented by this PR stack. The
first pull request and the last two in the stack are for maintenance to
support evolutionary database design and feature toggling.

🧮 Side Effects

  • Because this work included removing LimitCollectionCreationDeletion and
    AllowAdminsAccessToAllCollections from the license file used for self
    hosted: the new controls are not disabled for self hosted organizations.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 24.13793% with 22 lines in your changes missing coverage. Please review.

Project coverage is 33.29%. Comparing base (bdf91e2) to head (c712b07).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...onsole/organizations/settings/account.component.ts 0.00% 18 Missing ⚠️
...n-console/models/response/organization.response.ts 0.00% 2 Missing ⚠️
...on/src/admin-console/models/domain/organization.ts 66.66% 1 Missing ⚠️
...bs/common/src/vault/models/view/collection.view.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11223   +/-   ##
=======================================
  Coverage   33.29%   33.29%           
=======================================
  Files        2731     2731           
  Lines       85549    85569   +20     
  Branches    16318    16322    +4     
=======================================
+ Hits        28480    28487    +7     
- Misses      54811    54824   +13     
  Partials     2258     2258           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Sep 24, 2024

Logo
Checkmarx One – Scan Summary & Details867c1ae7-119e-4c24-993e-827b6d5bef77

No New Or Fixed Issues Found

@@ -61,6 +66,15 @@ export class AccountComponent implements OnInit, OnDestroy {
}),
});

protected collectionManagementFormGroup_VNext = this.formBuilder.group({
Copy link
Member

Choose a reason for hiding this comment

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

I can see the vNext formgroup is used in the TS code, but it doesn't appear to be referenced in the template.

Comment on lines +101 to +104
this.configService
.getFeatureFlag$(FeatureFlag.LimitCollectionCreationDeletionSplit)
.pipe(takeUntil(this.destroy$))
.subscribe((x) => (this.limitCollectionCreationDeletionSplitFeatureFlagIsEnabled = x));
Copy link
Member

Choose a reason for hiding this comment

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

I recommend against subscribing, then you can just do a 1-liner: this.limitCollectionCreationDeletionSplitFeatureFlagIsEnabled = this.configService.getFeatureFlag$(FeatureFlag.LimitCollectionCreationDeletionSplit);.

Although I admit using await firstValueFrom is a bit awkward, that may come down to personal preference.

@addisonbeck addisonbeck force-pushed the ac/addison/pm-10863/limit-collection-creation-deletion-split branch 2 times, most recently from 222faf6 to e78c97b Compare October 4, 2024 23:14
@addisonbeck addisonbeck force-pushed the ac/addison/pm-10863/limit-collection-creation-deletion-split branch from e78c97b to c712b07 Compare October 4, 2024 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants