Skip to content

Commit 017f9a6

Browse files
committed
Merge remote-tracking branch 'origin/main' into poc/structurizr
2 parents d48a2b2 + ed5e427 commit 017f9a6

File tree

1,647 files changed

+112775
-10266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,647 files changed

+112775
-10266
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"swashbuckle.aspnetcore.cli": {
6-
"version": "7.3.2",
6+
"version": "9.0.4",
77
"commands": ["swagger"]
88
},
99
"dotnet-ef": {

.github/CODEOWNERS

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
.github/workflows/publish.yml @bitwarden/dept-bre
1515

1616
## These are shared workflows ##
17-
.github/workflows/_move_finalization_db_scripts.yml
17+
.github/workflows/_move_edd_db_scripts.yml
1818
.github/workflows/release.yml
1919

2020
# Database Operations for database changes
@@ -33,6 +33,9 @@ util/SqliteMigrations/** @bitwarden/dept-dbops
3333
# Shared util projects
3434
util/Setup/** @bitwarden/dept-bre @bitwarden/team-platform-dev
3535

36+
# UIF
37+
src/Core/MailTemplates/Mjml @bitwarden/team-ui-foundation # Teams are expected to own sub-directories of this project
38+
3639
# Auth team
3740
**/Auth @bitwarden/team-auth-dev
3841
bitwarden_license/src/Sso @bitwarden/team-auth-dev
@@ -50,11 +53,7 @@ docs/key_management/* @bitwarden/team-key-management-dev
5053
docs/tools/* @bitwarden/team-tools-dev
5154

5255
# Dirt (Data Insights & Reporting) team
53-
src/Api/Controllers/Dirt @bitwarden/team-data-insights-and-reporting-dev
54-
src/Core/Dirt @bitwarden/team-data-insights-and-reporting-dev
55-
src/Infrastructure.Dapper/Dirt @bitwarden/team-data-insights-and-reporting-dev
56-
test/Api.Test/Dirt @bitwarden/team-data-insights-and-reporting-dev
57-
test/Core.Test/Dirt @bitwarden/team-data-insights-and-reporting-dev
56+
**/Dirt @bitwarden/team-data-insights-and-reporting-dev
5857

5958
# Vault team
6059
**/Vault @bitwarden/team-vault-dev
@@ -99,6 +98,8 @@ docs/billing/* @bitwarden/team-billing-dev
9998
**/.dockerignore @bitwarden/team-platform-dev
10099
**/Dockerfile @bitwarden/team-platform-dev
101100
**/entrypoint.sh @bitwarden/team-platform-dev
101+
# The PushType enum is expected to be editted by anyone without need for Platform review
102+
src/Core/Platform/Push/PushType.cs
102103
docs/platform/* @bitwarden/team-platform-dev
103104

104105
# Multiple owners - DO NOT REMOVE (BRE)

.github/ISSUE_TEMPLATE/bw-unified.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
name: Bitwarden Unified Bug Report
21
name: Bitwarden Unified Deployment Bug Report
32
description: File a bug report
43
labels: [bug, bw-unified-deploy]

.github/renovate.json5

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@
99
"nuget",
1010
],
1111
packageRules: [
12-
{
13-
// Group all release-related workflows for GitHub Actions together for BRE.
14-
groupName: "github-action",
15-
matchManagers: ["github-actions"],
16-
matchFileNames: [
17-
".github/workflows/publish.yml",
18-
".github/workflows/release.yml"
19-
],
20-
commitMessagePrefix: "[deps] BRE:",
21-
reviewers: ["team:dept-bre"],
22-
addLabels: ["hold"],
23-
},
2412
{
2513
groupName: "dockerfile minor",
2614
matchManagers: ["dockerfile"],
@@ -35,6 +23,7 @@
3523
groupName: "github-action minor",
3624
matchManagers: ["github-actions"],
3725
matchUpdateTypes: ["minor"],
26+
addLabels: ["hold"],
3827
},
3928
{
4029
// For any Microsoft.Extensions.* and Microsoft.AspNetCore.* packages, we want to create PRs for patch updates.
@@ -95,7 +84,6 @@
9584
"Serilog.AspNetCore",
9685
"Serilog.Extensions.Logging",
9786
"Serilog.Extensions.Logging.File",
98-
"Serilog.Sinks.AzureCosmosDB",
9987
"Serilog.Sinks.SyslogMessages",
10088
"Stripe.net",
10189
"Swashbuckle.AspNetCore",
Lines changed: 81 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: _move_finalization_db_scripts
2-
run-name: Move finalization database scripts
1+
name: _move_edd_db_scripts
2+
run-name: Move EDD database scripts
33

44
on:
55
workflow_call:
@@ -12,14 +12,20 @@ jobs:
1212
setup:
1313
name: Setup
1414
runs-on: ubuntu-22.04
15+
permissions:
16+
contents: read
17+
id-token: write
1518
outputs:
1619
migration_filename_prefix: ${{ steps.prefix.outputs.prefix }}
17-
copy_finalization_scripts: ${{ steps.check-finalization-scripts-existence.outputs.copy_finalization_scripts }}
20+
copy_edd_scripts: ${{ steps.check-script-existence.outputs.copy_edd_scripts }}
21+
1822
steps:
1923
- name: Log in to Azure
20-
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
24+
uses: bitwarden/gh-actions/azure-login@main
2125
with:
22-
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
26+
subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
27+
tenant_id: ${{ secrets.AZURE_TENANT_ID }}
28+
client_id: ${{ secrets.AZURE_CLIENT_ID }}
2329

2430
- name: Retrieve secrets
2531
id: retrieve-secrets
@@ -28,6 +34,9 @@ jobs:
2834
keyvault: "bitwarden-ci"
2935
secrets: "github-pat-bitwarden-devops-bot-repo-scope"
3036

37+
- name: Log out from Azure
38+
uses: bitwarden/gh-actions/azure-logout@main
39+
3140
- name: Check out branch
3241
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3342
with:
@@ -37,22 +46,27 @@ jobs:
3746
id: prefix
3847
run: echo "prefix=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
3948

40-
- name: Check if any files in DB finalization directory
41-
id: check-finalization-scripts-existence
49+
- name: Check if any files in DB transition or finalization directories
50+
id: check-script-existence
4251
run: |
43-
if [ -f util/Migrator/DbScripts_finalization/* ]; then
44-
echo "copy_finalization_scripts=true" >> $GITHUB_OUTPUT
52+
if [ -f util/Migrator/DbScripts_transition/* -o -f util/Migrator/DbScripts_finalization/* ]; then
53+
echo "copy_edd_scripts=true" >> $GITHUB_OUTPUT
4554
else
46-
echo "copy_finalization_scripts=false" >> $GITHUB_OUTPUT
55+
echo "copy_edd_scripts=false" >> $GITHUB_OUTPUT
4756
fi
4857
49-
move-finalization-db-scripts:
50-
name: Move finalization database scripts
58+
move-scripts:
59+
name: Move scripts
5160
runs-on: ubuntu-22.04
5261
needs: setup
53-
if: ${{ needs.setup.outputs.copy_finalization_scripts == 'true' }}
62+
permissions:
63+
contents: write
64+
pull-requests: write
65+
id-token: write
66+
actions: read
67+
if: ${{ needs.setup.outputs.copy_edd_scripts == 'true' }}
5468
steps:
55-
- name: Checkout
69+
- name: Check out repo
5670
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5771
with:
5872
fetch-depth: 0
@@ -61,41 +75,70 @@ jobs:
6175
id: branch_name
6276
env:
6377
PREFIX: ${{ needs.setup.outputs.migration_filename_prefix }}
64-
run: echo "branch_name=move_finalization_db_scripts_$PREFIX" >> $GITHUB_OUTPUT
78+
run: echo "branch_name=move_edd_db_scripts_$PREFIX" >> $GITHUB_OUTPUT
6579

6680
- name: "Create branch"
6781
env:
6882
BRANCH: ${{ steps.branch_name.outputs.branch_name }}
6983
run: git switch -c $BRANCH
7084

71-
- name: Move DbScripts_finalization
85+
- name: Move scripts and finalization database schema
7286
id: move-files
7387
env:
7488
PREFIX: ${{ needs.setup.outputs.migration_filename_prefix }}
7589
run: |
76-
src_dir="util/Migrator/DbScripts_finalization"
90+
# scripts
91+
moved_files="Migration scripts moved:\n\n"
92+
93+
src_dirs="util/Migrator/DbScripts_transition,util/Migrator/DbScripts_finalization"
7794
dest_dir="util/Migrator/DbScripts"
7895
i=0
7996
80-
moved_files=""
81-
for file in "$src_dir"/*; do
82-
filenumber=$(printf "%02d" $i)
97+
for src_dir in ${src_dirs//,/ }; do
98+
for file in "$src_dir"/*; do
99+
filenumber=$(printf "%02d" $i)
100+
101+
filename=$(basename "$file")
102+
new_filename="${PREFIX}_${filenumber}_${filename}"
103+
dest_file="$dest_dir/$new_filename"
83104
84-
filename=$(basename "$file")
85-
new_filename="${PREFIX}_${filenumber}_${filename}"
86-
dest_file="$dest_dir/$new_filename"
105+
# Replace any finalization references due to the move
106+
sed -i -e 's/dbo_finalization/dbo/g' "$file"
87107
88-
mv "$file" "$dest_file"
89-
moved_files="$moved_files \n $filename -> $new_filename"
108+
mv "$file" "$dest_file"
109+
moved_files="$moved_files \n $filename -> $new_filename"
90110
91-
i=$((i+1))
111+
i=$((i+1))
112+
done
92113
done
114+
115+
# schema
116+
moved_files="$moved_files\n\nFinalization scripts moved:\n\n"
117+
118+
src_dir="src/Sql/dbo_finalization"
119+
dest_dir="src/Sql/dbo"
120+
121+
# sync finalization schema back to dbo, maintaining structure
122+
rsync -r "$src_dir/" "$dest_dir/"
123+
rm -rf $src_dir/*
124+
125+
# Replace any finalization references due to the move
126+
find ./src/Sql/dbo -name "*.sql" -type f -exec sed -i \
127+
-e 's/\[dbo_finalization\]/[dbo]/g' \
128+
-e 's/dbo_finalization\./dbo./g' {} +
129+
130+
for file in "$src_dir"/**/*; do
131+
moved_files="$moved_files \n $file"
132+
done
133+
93134
echo "moved_files=$moved_files" >> $GITHUB_OUTPUT
94135
95-
- name: Log in to Azure - production subscription
96-
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
136+
- name: Log in to Azure
137+
uses: bitwarden/gh-actions/azure-login@main
97138
with:
98-
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
139+
subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
140+
tenant_id: ${{ secrets.AZURE_TENANT_ID }}
141+
client_id: ${{ secrets.AZURE_CLIENT_ID }}
99142

100143
- name: Retrieve secrets
101144
id: retrieve-secrets
@@ -106,8 +149,11 @@ jobs:
106149
github-gpg-private-key-passphrase,
107150
devops-alerts-slack-webhook-url"
108151

152+
- name: Log out from Azure
153+
uses: bitwarden/gh-actions/azure-logout@main
154+
109155
- name: Import GPG keys
110-
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0
156+
uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0
111157
with:
112158
gpg_private_key: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key }}
113159
passphrase: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key-passphrase }}
@@ -121,7 +167,7 @@ jobs:
121167
git config --local user.name "bitwarden-devops-bot"
122168
if [ -n "$(git status --porcelain)" ]; then
123169
git add .
124-
git commit -m "Move DbScripts_finalization to DbScripts" -a
170+
git commit -m "Move EDD database scripts" -a
125171
git push -u origin ${{ steps.branch_name.outputs.branch_name }}
126172
echo "pr_needed=true" >> $GITHUB_OUTPUT
127173
else
@@ -137,16 +183,16 @@ jobs:
137183
BRANCH: ${{ steps.branch_name.outputs.branch_name }}
138184
GH_TOKEN: ${{ github.token }}
139185
MOVED_FILES: ${{ steps.move-files.outputs.moved_files }}
140-
TITLE: "Move finalization database scripts"
186+
TITLE: "Move EDD database scripts"
141187
run: |
142188
PR_URL=$(gh pr create --title "$TITLE" \
143189
--base "main" \
144190
--head "$BRANCH" \
145191
--label "automated pr" \
146192
--body "
147-
## Automated movement of DbScripts_finalization to DbScripts
193+
Automated movement of EDD database scripts.
148194
149-
## Files moved:
195+
Files moved:
150196
$(echo -e "$MOVED_FILES")
151197
")
152198
echo "pr_url=${PR_URL}" >> $GITHUB_OUTPUT
@@ -157,5 +203,5 @@ jobs:
157203
env:
158204
SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }}
159205
with:
160-
message: "Created PR for moving DbScripts_finalization to DbScripts: ${{ steps.create-pr.outputs.pr_url }}"
206+
message: "Created PR for moving EDD database scripts: ${{ steps.create-pr.outputs.pr_url }}"
161207
status: ${{ job.status }}

0 commit comments

Comments
 (0)