Skip to content

Conversation

cd-bitwarden
Copy link
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/SM-1591

📔 Objective

Create the appropriate entity, entity type configuration, and database context changes to use the SecretVersion table described above.

📸 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

@cd-bitwarden cd-bitwarden marked this pull request as ready for review October 1, 2025 16:17
@cd-bitwarden cd-bitwarden requested a review from a team as a code owner October 1, 2025 16:17
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

❌ Patch coverage is 65.95745% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.81%. Comparing base (a565fd9) to head (58b5066).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/Core/SecretsManager/Entities/SecretVersion.cs 0.00% 12 Missing ⚠️
...tyFramework/SecretsManager/Models/SecretVersion.cs 66.66% 3 Missing ⚠️
...re.EntityFramework/SecretsManager/Models/Secret.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6406       +/-   ##
===========================================
+ Coverage   13.02%   54.81%   +41.79%     
===========================================
  Files        1112     1869      +757     
  Lines       49293    82743    +33450     
  Branches     3820     7308     +3488     
===========================================
+ Hits         6420    45356    +38936     
+ Misses      42754    35712     -7042     
- Partials      119     1675     +1556     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

github-actions bot commented Oct 1, 2025

Logo
Checkmarx One – Scan Summary & Details98ae1a90-a19d-46a8-8777-2ae5a66699d4

New Issues (2)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1511
detailsMethod at line 1511 of /src/Api/Vault/Controllers/CiphersController.cs gets a parameter from a user request from id. This parameter value flows ...
ID: pN371p7oxzg66CFSL1H%2F7897Dng%3D
Attack Vector
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1392
detailsMethod at line 1392 of /src/Api/Vault/Controllers/CiphersController.cs gets a parameter from a user request from id. This parameter value flows ...
ID: xow1RlTy2gYME4GMTq55sfh%2BBY0%3D
Attack Vector
Fixed Issues (1)

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

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 299

Copy link

sonarqubecloud bot commented Oct 3, 2025

Copy link

@mkincaid-bw mkincaid-bw 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 like the EF migrations will create tables with plural names (ie: SecretVersions instead of SecretVersion. I've made comments on the util/MySqlMigrations/Migrations/20251001154948_CreateSecretVersionsTable.cs file but the same changes should be applied to the Postgres and Sqlite files as well.

Copy link

@mkincaid-bw mkincaid-bw left a comment

Choose a reason for hiding this comment

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

Couple questions

Copy link

@mkincaid-bw mkincaid-bw left a comment

Choose a reason for hiding this comment

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

Questions on some of the Sqlite files.

Choose a reason for hiding this comment

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

This file looks like a duplicate of 20251009152635_CreatingSecretVersionTables.cs?

Copy link

@mkincaid-bw mkincaid-bw left a comment

Choose a reason for hiding this comment

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

Approved with comment.

GO
CREATE NONCLUSTERED INDEX [IX_SecretVersion_EditorServiceAccountId]
ON [dbo].[SecretVersion]([EditorServiceAccountId] ASC)
WHERE [EditorServiceAccountId] IS NOT NULL;

Choose a reason for hiding this comment

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

🌱 Just wanted to point out that SQL Server is using filtered (partial) indexes while the EF migrations are using non-filtered indexes. Not really a big issue but something to keep in mind on whether we want to keep things as consistent as possible between environments. Mysql/Mariadb does not currently support filtered indexes (without a workaround) so we wouldn't be able to have all database platforms aligned 100% anyway.

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