[PM-28531] Remove old proc and use new one#7110
[PM-28531] Remove old proc and use new one#7110voommen-livefront wants to merge 11 commits intomainfrom
Conversation
|
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7110 +/- ##
==========================================
- Coverage 56.70% 56.45% -0.25%
==========================================
Files 2013 2014 +1
Lines 88191 88151 -40
Branches 7861 7863 +2
==========================================
- Hits 50009 49770 -239
- Misses 36362 36565 +203
+ Partials 1820 1816 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| SELECT | ||
| [OrganizationId], | ||
| [ContentEncryptionKey], | ||
| [SummaryData], | ||
| [RevisionDate] | ||
| FROM [dbo].[OrganizationReportView] | ||
| WHERE [OrganizationId] = @OrganizationId | ||
| AND [RevisionDate] >= @StartDate | ||
| AND [RevisionDate] <= @EndDate | ||
| ORDER BY [RevisionDate] DESC |
There was a problem hiding this comment.
The entire SELECT statement should be indented 4 spaces, and SQL keywords should be on their own line
https://contributing.bitwarden.com/contributing/code-style/sql#select-statements
| SELECT | |
| [OrganizationId], | |
| [ContentEncryptionKey], | |
| [SummaryData], | |
| [RevisionDate] | |
| FROM [dbo].[OrganizationReportView] | |
| WHERE [OrganizationId] = @OrganizationId | |
| AND [RevisionDate] >= @StartDate | |
| AND [RevisionDate] <= @EndDate | |
| ORDER BY [RevisionDate] DESC | |
| SELECT | |
| [OrganizationId], | |
| [ContentEncryptionKey], | |
| [SummaryData], | |
| [RevisionDate] | |
| FROM | |
| [dbo].[OrganizationReportView] | |
| WHERE | |
| [OrganizationId] = @OrganizationId | |
| AND [RevisionDate] >= @StartDate | |
| AND [RevisionDate] <= @EndDate | |
| ORDER BY | |
| [RevisionDate] DESC |
There was a problem hiding this comment.
I didn't commit this suggestion because I renamed the file, but I have updated the formatting in the new file,
| @@ -0,0 +1,23 @@ | |||
| DROP PROC IF EXISTS [dbo].[OrganizationReport_GetSummariesByDateRange] | |||
There was a problem hiding this comment.
This does not follow our EDD pattern.
https://contributing.bitwarden.com/contributing/database-migrations/edd/
Database changes must be deployable independently of code changes, and must support both the current and next release. Dropping this proc should happen later in another PR once the server code has been deployed and hardened a bit.
There was a problem hiding this comment.
@mkincaid-bw The procedure and the endpoint weren't used this far.
It is safe to drop the proc in this PR as it is being replaced by a new one.
There was a problem hiding this comment.
Also, my apologies for this PR being so large - I should have made two PR's one with the DB changes and another with the code changes. I came in this morning thinking of what else I got to do next and didn't think about making another PR.
| BEGIN | ||
| SET NOCOUNT ON | ||
|
|
||
| SELECT |
There was a problem hiding this comment.
Same comment as above re: formatting.
There was a problem hiding this comment.
The file name is OrganizationReport_ReadyByOrganizationIdAndRevisionDate.sql (_ReadyBy...) but should be OrganizationReport_ReadByOrganizationIdAndRevisionDate.sql (_ReadBy...) to match the stored proc name.
There was a problem hiding this comment.
I am so sorry about this - I should have fixed this before this was made available to you.
| public string? SummaryData { get; set; } | ||
| public required Guid OrganizationId { get; set; } | ||
| [JsonPropertyName("encryptedData")] | ||
| public required string SummaryData { get; set; } |
There was a problem hiding this comment.
The SummaryData and RevisionDate (below) properties are required here, but both columns in the DB allow nulls. Not sure if it's an issue or not but I just wanted to point it out.
There was a problem hiding this comment.
@mkincaid-bw you are right - the procedures are required - if there is no summary data, than this object is not relevant. And I tested it in the database
|




🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-28531
📔 Objective
📸 Screenshots