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

PM-10560: Adding Cascades back to Notification Center #4769

Merged
merged 10 commits into from
Sep 20, 2024

Conversation

mzieniukbw
Copy link
Contributor

@mzieniukbw mzieniukbw commented Sep 12, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-10560

📔 Objective

📸 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

@mzieniukbw mzieniukbw requested a review from a team as a code owner September 12, 2024 09:13
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 41.78%. Comparing base (a19fc6a) to head (feca45a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...dminConsole/Repositories/OrganizationRepository.cs 0.00% 4 Missing ⚠️
...ure.EntityFramework/Repositories/UserRepository.cs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4769      +/-   ##
==========================================
- Coverage   41.78%   41.78%   -0.01%     
==========================================
  Files        1308     1308              
  Lines       62055    62061       +6     
  Branches     5716     5716              
==========================================
  Hits        25930    25930              
- Misses      34931    34937       +6     
  Partials     1194     1194              

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

@mzieniukbw mzieniukbw changed the title PM-10560: Adding Cascades back PM-10560: Adding Cascades back to Notification Center Sep 12, 2024
Copy link
Contributor

github-actions bot commented Sep 12, 2024

Logo
Checkmarx One – Scan Summary & Detailsef4776c2-b7fb-469c-9d8f-4332ad5f7448

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationsController.cs: 478 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationsController.cs: 176 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationsController.cs: 503 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 554 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 540 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationsController.cs: 478 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 272 Attack Vector
MEDIUM CSRF /src/Api/Billing/Public/Controllers/OrganizationController.cs: 47 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationsController.cs: 445 Attack Vector
LOW Missing_CSP_Header /src/Core/MailTemplates/Handlebars/TrialInitiation.html.hbs: 47 Attack Vector

Fixed Issues

Severity Issue Source File / Package
MEDIUM CSRF /src/Identity/Controllers/AccountsController.cs: 75
MEDIUM CSRF /src/Api/Vault/Controllers/FoldersController.cs: 64
MEDIUM CSRF /src/Api/Vault/Controllers/FoldersController.cs: 45
MEDIUM CSRF /src/Api/Vault/Controllers/FoldersController.cs: 45
MEDIUM CSRF /src/Identity/Controllers/AccountsController.cs: 75
MEDIUM CSRF /src/Api/Vault/Controllers/FoldersController.cs: 64
MEDIUM CSRF /src/Api/Vault/Controllers/FoldersController.cs: 64

@mzieniukbw mzieniukbw requested a review from a team as a code owner September 16, 2024 19:34
@mzieniukbw
Copy link
Contributor Author

I have changed the Primary key columns order to be consistent with what we have in SQL Server, by changing EF src/Infrastructure.EntityFramework/NotificationCenter/Configurations/NotificationStatusEntityTypeConfiguration.cs
But now MySql migration does not work correctly, due to:

Applying migration '20240909133252_NotificationCenter'.
Applying migration '20240916193337_UpdateNotificationCenterOnDeleteCascade'.
Failed executing DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
CALL POMELO_BEFORE_DROP_PRIMARY_KEY(NULL, 'NotificationStatus');
ALTER TABLE `NotificationStatus` DROP PRIMARY KEY;
MySqlConnector.MySqlException (0x80004005): Cannot drop index 'PRIMARY': needed in a foreign key constraint

Should i revert it ? But then we have inconsistencies between Sql Server and EF ?
Or maybe we need some manual migration for EF MySQL ?
Or maybe i change the order for Sql server ?
Any idea ?

@withinfocus
Copy link
Contributor

There shouldn't be cascades at all now, since your procs for MSSQL and EF logic elsewhere handles it.

Copy link
Contributor

@Thomas-Avery Thomas-Avery left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@rkac-bw rkac-bw left a comment

Choose a reason for hiding this comment

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

lgtm

@mzieniukbw mzieniukbw merged commit 8a515a3 into main Sep 20, 2024
52 checks passed
@mzieniukbw mzieniukbw deleted the km/pm-10560-cascades-fix branch September 20, 2024 12:20
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.

5 participants