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-14590] Modify Notification database table #5361

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

gbubemismith
Copy link
Member

@gbubemismith gbubemismith commented Feb 3, 2025

🎟️ Tracking

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

📔 Objective

We need to modify the Notification entity to have an optional TaskId column.

📸 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

@gbubemismith gbubemismith requested a review from a team as a code owner February 3, 2025 20:03
Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 44.30%. Comparing base (1adc535) to head (679286f).
Report is 34 commits behind head on main.

Files with missing lines Patch % Lines
...ramework/NotificationCenter/Models/Notification.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5361      +/-   ##
==========================================
- Coverage   44.37%   44.30%   -0.07%     
==========================================
  Files        1487     1497      +10     
  Lines       68595    69212     +617     
  Branches     6179     6241      +62     
==========================================
+ Hits        30438    30665     +227     
- Misses      36838    37224     +386     
- Partials     1319     1323       +4     

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

Copy link
Contributor

github-actions bot commented Feb 3, 2025

Logo
Checkmarx One – Scan Summary & Details7a329000-11e6-4357-974d-e3748a6b8da1

New Issues (25)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
LOW Heap_Inspection /src/Core/AdminConsole/Services/Implementations/RabbitMqEventListenerBase.cs: 29
detailsMethod RabbitMqEventListenerBase at line 29 of /src/Core/AdminConsole/Services/Implementations/RabbitMqEventListenerBase.cs defines Password, which...
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 238
detailsMethod UpdateTaxInformationAsync at line 238 of /src/Api/Billing/Controllers/OrganizationBillingController.cs gets user input from element requestB...
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 238
detailsMethod UpdateTaxInformationAsync at line 238 of /src/Api/Billing/Controllers/OrganizationBillingController.cs gets user input from element requestB...
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 238
detailsMethod UpdateTaxInformationAsync at line 238 of /src/Api/Billing/Controllers/OrganizationBillingController.cs gets user input from element requestB...
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/ProviderBillingController.cs: 104
detailsMethod UpdateTaxInformationAsync at line 104 of /src/Api/Billing/Controllers/ProviderBillingController.cs gets user input from element requestBody....
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/ProviderBillingController.cs: 104
detailsMethod UpdateTaxInformationAsync at line 104 of /src/Api/Billing/Controllers/ProviderBillingController.cs gets user input from element requestBody....
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 163
detailsMethod UpdatePaymentMethodAsync at line 163 of /src/Api/Billing/Controllers/OrganizationBillingController.cs gets user input from element requestBo...
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 163
detailsMethod UpdatePaymentMethodAsync at line 163 of /src/Api/Billing/Controllers/OrganizationBillingController.cs gets user input from element requestBo...
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/ProviderBillingController.cs: 104
detailsMethod UpdateTaxInformationAsync at line 104 of /src/Api/Billing/Controllers/ProviderBillingController.cs gets user input from element requestBody....
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 163
detailsMethod UpdatePaymentMethodAsync at line 163 of /src/Api/Billing/Controllers/OrganizationBillingController.cs gets user input from element requestBo...
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 163
detailsMethod UpdatePaymentMethodAsync at line 163 of /src/Api/Billing/Controllers/OrganizationBillingController.cs gets user input from element requestBo...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 186
detailsUsing at line 186 of /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 185
detailsUsing at line 185 of /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 184
detailsUsing at line 184 of /src/Core/MailTemplates/Handlebars/Layouts...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 183
detailsUsing at line 183 of /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs, witho...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 182
detailsUsing at line 182 of /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs, w...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 181
detailsUsing at line 181 of /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 180
detailsUsing at line 180 of /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs, with...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 157
detailsUsing at line 157 of /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs, witho...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 156
detailsUsing at line 156 of /src/Core/MailTemplates/Handlebars/Layouts/Full.html.h...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 155
detailsUsing at line 155 of /src/Core/MailTemplates/Handlebars/Layouts...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 154
detailsUsing at line 154 of /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs, without corr...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 153
detailsUsing at line 153 of /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs, without ...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 152
detailsUsing at line 152 of /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs, witho...
Attack Vector
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 151
detailsUsing at line 151 of /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs, without cor...
Attack Vector
Fixed Issues (26)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
MEDIUM SSRF /src/Billing/Controllers/FreshdeskController.cs: 149
MEDIUM SSRF /src/Billing/Controllers/FreshdeskController.cs: 149
LOW Heap_Inspection /src/Core/Services/Implementations/RabbitMqEventListenerService.cs: 29
LOW Log_Forging /src/Billing/Controllers/FreshdeskController.cs: 149
LOW Log_Forging /src/Billing/Controllers/FreshdeskController.cs: 149
LOW Log_Forging /src/Billing/Controllers/FreshdeskController.cs: 149
LOW Log_Forging /src/Billing/Controllers/StripeController.cs: 164
LOW Log_Forging /src/Billing/Controllers/RecoveryController.cs: 38
LOW Log_Forging /src/Billing/Controllers/StripeController.cs: 164
LOW Log_Forging /src/Billing/Controllers/RecoveryController.cs: 38
LOW Log_Forging /src/Billing/Controllers/StripeController.cs: 164
LOW Log_Forging /src/Billing/Controllers/RecoveryController.cs: 38
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 186
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 185
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 184
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 183
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 182
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 181
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/FullUpdated.html.hbs: 180
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 157
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 156
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 155
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 154
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 153
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 152
LOW Unsafe_Use_Of_Target_blank /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 151

Copy link
Contributor

@withinfocus withinfocus left a comment

Choose a reason for hiding this comment

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

Have the new field / parameter at the end everywhere too.

@@ -7,6 +7,7 @@ CREATE PROCEDURE [dbo].[Notification_Create]
@OrganizationId UNIQUEIDENTIFIER,
@Title NVARCHAR(256),
@Body NVARCHAR(MAX),
@TaskId UNIQUEIDENTIFIER = NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

❌ All parameters should get added to the end. We parameterize our invocations, but if that weren't happening this would cause execution issues.

@@ -8,6 +8,7 @@ CREATE TABLE [dbo].[Notification]
[OrganizationId] UNIQUEIDENTIFIER NULL,
[Title] NVARCHAR (256) NULL,
[Body] NVARCHAR (MAX) NULL,
[TaskId] UNIQUEIDENTIFIER NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

❌ This should have a foreign key.

@@ -18,6 +18,7 @@ public class Notification : ITableObject<Guid>
[MaxLength(256)]
public string? Title { get; set; }
public string? Body { get; set; }
public Guid? TaskId { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

⛏️ I like these to be in order too.

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