Skip to content

Commit a49b9d1

Browse files
committed
build: implement SDK breaking change detection
- Add dedicated detect-breaking-changes.yml workflow with matrix strategy - Implement cross-repository coordination using repository_dispatch - Add GitHub App authentication with Azure Key Vault integration - Create synchronous monitoring with gh run watch --exit-status - Add comprehensive PR comment system with status tracking - Include automatic breaking-change label management - Support workflow_call integration with build-wasm-internal.yml Provides immediate feedback on TypeScript breaking changes when SDK PRs are created, catching issues before client integration attempts. Resolves: PM-22218
1 parent 045ced5 commit a49b9d1

File tree

3 files changed

+442
-6
lines changed

3 files changed

+442
-6
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66

77
<!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. -->
88

9+
## 🚨 Breaking Changes
10+
11+
<!-- Does this PR introduce any breaking changes? If so, please describe the impact and migration path for clients.
12+
13+
If you're unsure, the automated TypeScript compatibility check will run when you open/update this PR and provide feedback.
14+
15+
For breaking changes:
16+
1. Describe what changed in the client interface
17+
2. Explain why the change was necessary
18+
3. Provide migration steps for client developers
19+
4. Link to any paired client PRs if needed
20+
21+
Otherwise, you can remove this section. -->
22+
923
## ⏰ Reminders before review
1024

1125
- Contributor guidelines followed

.github/workflows/build-wasm-internal.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ jobs:
3535
steps:
3636
- name: Checkout repo
3737
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
38+
with:
39+
persist-credentials: false
3840

3941
- name: Set version (PR)
4042
if: ${{ github.event_name == 'pull_request' }}
4143
env:
4244
PR_HEAD_REF: "${{ github.event.pull_request.head.ref }}"
4345
run: |
44-
echo REF_NAME="$PR_HEAD_REF" >> $GITHUB_ENV
46+
echo REF_NAME="${PR_HEAD_REF}" >> $GITHUB_ENV
4547
echo SHA="${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
4648
4749
- name: Set env variables (Branch/Tag)
@@ -117,24 +119,52 @@ jobs:
117119
tenant_id: ${{ secrets.AZURE_TENANT_ID }}
118120
client_id: ${{ secrets.AZURE_CLIENT_ID }}
119121

120-
- name: Retrieve github PAT secrets
121-
id: retrieve-secret-pat
122+
- name: Get Azure Key Vault secrets
123+
id: get-kv-secrets
122124
uses: bitwarden/gh-actions/get-keyvault-secrets@main
123125
with:
124-
keyvault: "bitwarden-ci"
125-
secrets: "github-pat-bitwarden-devops-bot-repo-scope"
126+
keyvault: gh-org-bitwarden
127+
secrets: "BW-GHAPP-ID,BW-GHAPP-KEY"
128+
129+
- name: Generate GH App token
130+
uses: actions/create-github-app-token@30bf6253fa41bdc8d1501d202ad15287582246b4 # v2.0.3
131+
id: app-token
132+
with:
133+
app-id: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-ID }}
134+
private-key: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-KEY }}
126135

127136
- name: Log out from Azure
128137
uses: bitwarden/gh-actions/azure-logout@main
129138

130139
- name: Trigger WASM publish
131140
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
132141
with:
133-
github-token: ${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}
142+
github-token: ${{ steps.app-token.outputs.token }}
134143
script: |
135144
await github.rest.actions.createWorkflowDispatch({
136145
owner: 'bitwarden',
137146
repo: 'sdk-internal',
138147
workflow_id: 'publish-wasm-internal.yml',
139148
ref: 'main',
140149
})
150+
151+
trigger-breaking-change-check:
152+
name: Trigger client breaking change checks
153+
if: github.event_name == 'pull_request'
154+
needs: build
155+
permissions:
156+
contents: write
157+
actions: write
158+
pull-requests: write
159+
id-token: write
160+
uses: ./.github/workflows/detect-breaking-changes.yml
161+
secrets: inherit
162+
with:
163+
pr_number: ${{ github.event.number }}
164+
pr_head_sha: ${{ github.event.pull_request.head.sha }}
165+
pr_head_ref: ${{ github.event.pull_request.head.ref }}
166+
build_run_id: ${{ github.run_id }}
167+
client_repo: "bitwarden/clients"
168+
client_event_type: "sdk-breaking-change-check"
169+
client_label: "typescript"
170+
client_workflow: "sdk-breaking-change-check.yml"

0 commit comments

Comments
 (0)