Skip to content

Commit eb59e2f

Browse files
authored
Merge branch 'main' into ref/cwe-676-dangerous-functions
2 parents 638f899 + d4416bc commit eb59e2f

607 files changed

Lines changed: 6930 additions & 3282 deletions

File tree

Some content is hidden

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

.claude/skills

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.agents/skills

.cursor/mcp.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"mcpServers": {
3+
"XcodeBuildMCP": {
4+
"command": "npx",
5+
"args": [
6+
"-y",
7+
"xcodebuildmcp@2.0.7",
8+
"mcp"
9+
]
10+
},
11+
"sentry": {
12+
"url": "https://mcp.sentry.dev/mcp/sentry-sdks/sentry-cocoa"
13+
}
14+
}
15+
}

.github/AGENTS.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# .github
2+
3+
> Instructions for LLM agents. Keep edits minimal (headers + bullets). Use `/agents-md` skill when editing.
4+
5+
## Workflow Naming
6+
7+
**Workflow names** — concise, action-oriented: `[Action] [Subject]`
8+
9+
- `Release`, `UI Tests`, `Benchmarking`, `Lint SwiftLint`, `Test CocoaPods`
10+
11+
**Job names** — no redundant prefixes, use action verbs, max 3-4 words, no tool versions:
12+
13+
| Category | Examples |
14+
| -------- | ----------------------------------------------------------------------- |
15+
| Build | `Build XCFramework Slice`, `${{matrix.sdk}}` |
16+
| Test | `Test ${{matrix.name}} V3 # Up the version...`, `Unit ${{matrix.name}}` |
17+
| Validate | `Validate XCFramework`, `Check API Stability` |
18+
| Lint | `Lint` (when workflow name already specifies tool) |
19+
| Utility | `Collect App Metrics`, `Detect File Changes` |
20+
21+
### Flaky Test Tracking
22+
23+
Version number in BOTH job name AND comment (monitoring captures names, ignores comments):
24+
25+
```yaml
26+
name: Test iOS Swift V5 # Up the version with every change to keep track of flaky tests
27+
```
28+
29+
## Concurrency
30+
31+
### Pattern 1: Conditional (most common)
32+
33+
```yaml
34+
concurrency:
35+
group: ${{ github.workflow }}-${{ github.ref }}
36+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
37+
```
38+
39+
Cancels PR runs on new push. Never cancels main/release/schedule.
40+
41+
### Pattern 2: Always Cancel (PR-only workflows)
42+
43+
```yaml
44+
concurrency:
45+
group: ${{ github.workflow }}-${{ github.ref }}
46+
cancel-in-progress: true
47+
```
48+
49+
### Pattern 3: Fixed Group (special cases)
50+
51+
```yaml
52+
concurrency:
53+
group: "auto-update-tools"
54+
cancel-in-progress: true
55+
```
56+
57+
Each concurrency block must include comments explaining purpose, resource considerations, and branch protection logic.
58+
59+
## File Filters (`file-filters.yml`)
60+
61+
- Every directory with code/tests/config must appear in at least one filter
62+
- Use `**` for recursive matching (`Sources/**`, not `Sources/*`)
63+
- Include related workflow and config files in each filter group
64+
65+
### Templates
66+
67+
```yaml
68+
# Unit tests
69+
run_unit_tests_for_prs:
70+
- "Sources/**"
71+
- "Tests/**"
72+
- "SentryTestUtils/**"
73+
- "SentryTestUtilsDynamic/**"
74+
- "SentryTestUtilsTests/**"
75+
- ".github/workflows/test.yml"
76+
- ".github/file-filters.yml"
77+
- "scripts/ci-*.sh"
78+
- "test-server/**"
79+
- "**/*.xctestplan"
80+
- "Plans/**"
81+
- "Sentry.xcodeproj/**"
82+
```
83+
84+
```yaml
85+
# Lint
86+
run_lint_swift_formatting_for_prs:
87+
- "**/*.swift"
88+
- ".github/workflows/lint-swift-formatting.yml"
89+
- ".github/file-filters.yml"
90+
- ".swiftlint.yml"
91+
```
92+
93+
```yaml
94+
# Build
95+
run_build_for_prs:
96+
- "Sources/**"
97+
- "Samples/**"
98+
- ".github/workflows/build.yml"
99+
- ".github/file-filters.yml"
100+
- "Sentry.xcodeproj/**"
101+
- "Package*.swift"
102+
```
103+
104+
### When changing project structure
105+
106+
1. List all new/renamed directories
107+
2. Check each against `file-filters.yml`
108+
3. Add missing patterns to appropriate filter groups

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ body:
4444
validations:
4545
required: true
4646

47+
- type: dropdown
48+
id: other_error_monitoring
49+
attributes:
50+
description: Are you using any other error monitoring solution alongside Sentry?
51+
label: Other Error Monitoring Solution
52+
options:
53+
- "Yes"
54+
- "No"
55+
validations:
56+
required: true
57+
58+
- type: input
59+
id: other_error_monitoring_name
60+
attributes:
61+
label: Other Error Monitoring Solution Name
62+
description: If you're using another error monitoring solution side-by-side, please enter the name of the other solution.
63+
validations:
64+
required: false
65+
4766
- type: input
4867
id: version
4968
attributes:

.github/file-filters.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ run_unit_tests_for_prs: &run_unit_tests_for_prs
4040
- "scripts/tests-with-thread-sanitizer.sh"
4141
- "scripts/ci-boot-simulator.sh"
4242
- "scripts/ci-ensure-runtime-loaded.sh"
43+
- "scripts/prepare-package.sh"
4344

4445
# Test infrastructure
4546
- "test-server/**"
@@ -105,33 +106,25 @@ run_integration_test_for_prs: &run_integration_test_for_prs
105106
- "fastlane/**"
106107
- "Gemfile.lock"
107108

108-
run_benchmarking_for_prs: &run_benchmarking_for_prs
109-
- "Sources/**"
110-
111-
# GH Actions
109+
# Benchmarks always run on main, but on PRs they only run when benchmarking-related files change.
110+
# We intentionally exclude Sources/**, Tests/**, and other broad patterns here because benchmarks
111+
# are expensive (SauceLabs devices) and slow down PR CI. SDK source changes are covered by the
112+
# benchmarks running on every push to main.
113+
run_benchmarking_for_prs: &run_benchmarking_for_prs # GH Actions
112114
- ".github/workflows/benchmarking.yml"
113115
- ".github/file-filters.yml"
114116

115-
# Benchmarking implementation
116-
- "Samples/iOS-Swift/**"
117+
# Benchmarking test target and implementation
118+
- "Samples/iOS-Swift/iOS-Benchmarking/**"
119+
- "Samples/iOS-Swift/iOS-Benchmarking.xcconfig"
120+
- "Samples/iOS-Swift/iOS-Swift/Profiling/BenchmarkingViewController.swift"
121+
- "Samples/iOS-Swift/iOS-Swift/Tools/SentryBenchmarking.h"
122+
- "Samples/iOS-Swift/iOS-Swift/Tools/SentryBenchmarking.mm"
123+
- "Samples/iOS-Swift/iOS-Swift.yml"
124+
- "Samples/SentrySampleShared/SentrySampleUITestShared/**"
117125
- ".sauce/benchmarking-config.yml"
118126
- "Plans/iOS-Benchmarking_Base.xctestplan"
119127

120-
# Scripts
121-
- "scripts/ci-select-xcode.sh"
122-
- "scripts/ci-diagnostics.sh"
123-
- "scripts/ci-utils.sh"
124-
125-
# Project files
126-
- "Samples/iOS-Swift/iOS-Swift.yml"
127-
- "Samples/iOS-Swift/iOS-Swift.xcconfig"
128-
- "Samples/iOS-Swift/iOS-SwiftClip.xcconfig"
129-
- "Samples/iOS-Swift/iOS-Benchmarking.xcconfig"
130-
- "Package*.swift"
131-
132-
# Build configuration
133-
- "fastlane/**"
134-
135128
run_test_cross_platform_for_prs: &run_test_cross_platform_for_prs
136129
- "Sources/**"
137130

@@ -257,6 +250,7 @@ run_release_for_prs: &run_release_for_prs
257250
- "scripts/assemble-xcframework.sh"
258251
- "scripts/generate_release_matrix.sh"
259252
- "scripts/xcframework-generated-run.sh"
253+
- "scripts/prepare-package.sh"
260254

261255
# Project files
262256
- "Sentry.xcworkspace/**"
@@ -354,6 +348,7 @@ run_build_for_prs: &run_build_for_prs
354348
- "scripts/sentry-xcodebuild.sh"
355349
- "scripts/check-ui-framework-linkage.sh"
356350
- "scripts/ci-utils.sh"
351+
- "scripts/prepare-package.sh"
357352

358353
# Build configuration
359354
- "fastlane/**"

.github/last-release-runid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22398130588
1+
22957182287

.github/workflows/analyze-language-trends.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: sudo apt-get update && sudo apt-get install -y cmake pkg-config libicu-dev
3838

3939
- name: Setup Ruby
40-
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
40+
uses: ruby/setup-ruby@6ca151fd1bfcfd6fe0c4eb6837eb0584d0134a0c # v1.290.0
4141
with:
4242
bundler-cache: true
4343

.github/workflows/assemble-xcframework-variant.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
steps:
7272
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
7373
- name: Setup Ruby
74-
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
74+
uses: ruby/setup-ruby@6ca151fd1bfcfd6fe0c4eb6837eb0584d0134a0c # v1.290.0
7575
if: ${{ inputs.signed }}
7676
with:
7777
bundler-cache: true
@@ -111,7 +111,7 @@ jobs:
111111
fi
112112
113113
- name: Download ${{inputs.variant-id}} Slices
114-
uses: actions/download-artifact@v7
114+
uses: actions/download-artifact@v8
115115
with:
116116
pattern: xcframework-${{inputs.variant-id}}-slice-*
117117
path: xcframework-slices
@@ -169,7 +169,7 @@ jobs:
169169
shell: bash
170170

171171
- name: Upload XCFramework
172-
uses: actions/upload-artifact@v6
172+
uses: actions/upload-artifact@v7
173173
env:
174174
XCFRAMEWORK_NAME: ${{ env.XCFRAMEWORK_NAME }}
175175
with:

.github/workflows/auto-update-tools.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,17 @@ jobs:
6161
needs: files-changed
6262
runs-on: macos-15
6363
steps:
64+
- name: Generate GitHub App Token
65+
id: app_token
66+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
67+
with:
68+
app-id: ${{ vars.SENTRY_DEPENDENCY_UPDATER_GITHUB_APP_ID }}
69+
private-key: ${{ secrets.SENTRY_DEPENDENCY_UPDATER_GITHUB_APP_PRIVATE_KEY }}
70+
owner: ${{ github.repository_owner }}
6471
- name: Checkout Repository
6572
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
73+
with:
74+
token: ${{ steps.app_token.outputs.token }}
6675
- name: Update Homebrew
6776
run: brew update
6877

@@ -84,6 +93,7 @@ jobs:
8493
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
8594
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
8695
with:
96+
token: ${{ steps.app_token.outputs.token }}
8797
add-paths: scripts/.clang-format-version
8898
branch: github-actions/auto-update-tools-clang-format
8999
commit-message: "chore(deps): Update clang-format version"
@@ -96,6 +106,7 @@ jobs:
96106
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
97107
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
98108
with:
109+
token: ${{ steps.app_token.outputs.token }}
99110
add-paths: scripts/.swiftlint-version
100111
branch: github-actions/auto-update-tools-swiftlint
101112
commit-message: "chore(deps): Update swiftlint version"

.github/workflows/benchmarking.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
6565
- run: ./scripts/ci-select-xcode.sh 26.1.1
6666
- name: Setup Ruby
67-
uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
67+
uses: ruby/setup-ruby@6ca151fd1bfcfd6fe0c4eb6837eb0584d0134a0c # v1.290.0
6868
with:
6969
bundler-cache: true
7070
- run: make init-ci-build
@@ -106,7 +106,7 @@ jobs:
106106
107107
- name: Upload Built Apps for SauceLabs
108108
if: needs.files-changed.outputs.is_dependabot != 'true'
109-
uses: actions/upload-artifact@v6
109+
uses: actions/upload-artifact@v7
110110
with:
111111
name: benchmark-apps
112112
path: |
@@ -133,7 +133,7 @@ jobs:
133133
suite: ["High-end device", "Mid-range device", "Low-end device"]
134134
steps:
135135
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
136-
- uses: actions/download-artifact@v7
136+
- uses: actions/download-artifact@v8
137137
with:
138138
name: benchmark-apps
139139
- run: npm install -g saucectl@0.197.2

0 commit comments

Comments
 (0)