Skip to content

Commit a4cd40e

Browse files
committed
Merge remote-tracking branch 'origin/main' into cursor/implement-required-checks-for-lint-dprint-c1d3
2 parents c94ab28 + 3067c23 commit a4cd40e

40 files changed

+498
-248
lines changed

.github/file-filters.yml

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,74 @@ run_api_stability_for_prs: &run_api_stability_for_prs # API-related code
6565
- "sdk_api.json"
6666
- "sdk_api_v9.json"
6767

68-
run_lint_dprint_for_prs: &run_lint_dprint_for_prs
68+
run_lint_cocoapods_specs_for_prs: &run_lint_cocoapods_specs_for_prs # CocoaPods specs linting
69+
- "Sources/**"
70+
- "Tests/**"
71+
- "test-server/**"
72+
- "Samples/**"
73+
74+
# GH Actions
75+
- ".github/workflows/lint-cocoapods-specs.yml"
76+
- ".github/file-filters.yml"
77+
78+
# Scripts
79+
- "scripts/ci-select-xcode.sh"
80+
- "scripts/ci-diagnostics.sh"
81+
82+
# Project files
83+
- "Sentry.xcodeproj/**"
84+
- "*.podspec"
85+
- "Gemfile.lock"
86+
87+
# Other
88+
- "Makefile" # Make commands used for linting setup
89+
- "Brewfile*" # Tools installation affects linting environment
90+
- ".swiftlint.yml"
91+
92+
run_release_for_prs: &run_release_for_prs # Release-related code
93+
- "Sources/**"
94+
95+
# Scripts
96+
- "scripts/ci-select-xcode.sh"
97+
- "scripts/ci-diagnostics.sh"
98+
- "scripts/build-xcframework-slice.sh"
99+
- "scripts/assemble-xcframework.sh"
100+
101+
# Project files
102+
- "Sentry.xcworkspace/**"
103+
- "Sentry.xcodeproj/**"
104+
- "Package*.swift"
105+
106+
# GH Actions
107+
- ".github/workflows/build-xcframework.yml"
108+
- ".github/workflows/release.yml"
109+
- ".github/workflows/build-xcframework-variant-slices.yml"
110+
- ".github/workflows/assemble-xcframework-variant.yml"
111+
- ".github/workflows/ui-tests-common.yml"
112+
- ".github/file-filters.yml"
113+
114+
# Samples
115+
- "Samples/macOS-SPM-CommandLine/**"
116+
- "Samples/SPM-Dynamic/**"
117+
118+
run_lint_swift_formatting_for_prs: &run_lint_swift_formatting_for_prs # Swift formatting
119+
- "**/*.swift"
120+
121+
# GH Actions
122+
- ".github/workflows/lint-swift-formatting.yml"
123+
- ".github/file-filters.yml"
124+
125+
# Formatting
126+
- ".swiftlint.yml"
127+
128+
# Other
129+
- "Makefile" # Make commands used for formatting setup
130+
- "Brewfile*" # Tools installation affects formatting environment
131+
132+
# Scripts
133+
- "scripts/ci-diagnostics.sh"
134+
135+
run_lint_dprint_for_prs: &run_lint_dprint_for_prs # dprint formatting
69136
- "**/*.yml"
70137
- "**/*.yaml"
71138
- "**/*.json"

.github/workflows/lint-cocoapods-specs.yml

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,6 @@ on:
1717
- ".swiftlint.yml"
1818

1919
pull_request:
20-
paths:
21-
- "Sources/**"
22-
- "Tests/**"
23-
- "test-server/**"
24-
- "Samples/**"
25-
- ".github/workflows/lint-cocoapods-specs.yml"
26-
- "scripts/ci-select-xcode.sh"
27-
- "scripts/ci-diagnostics.sh"
28-
- "Sentry.xcodeproj/**"
29-
- "*.podspec"
30-
- "Gemfile.lock"
31-
- "Makefile" # Make commands used for linting setup
32-
- "Brewfile*" # Tools installation affects linting environment
33-
- ".swiftlint.yml"
3420

3521
# Concurrency configuration:
3622
# - We use workflow-specific concurrency groups to prevent multiple lint runs on the same code,
@@ -44,8 +30,25 @@ concurrency:
4430
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
4531

4632
jobs:
33+
files-changed:
34+
name: Detect File Changes
35+
runs-on: ubuntu-latest
36+
outputs:
37+
run_lint_cocoapods_specs_for_prs: ${{ steps.changes.outputs.run_lint_cocoapods_specs_for_prs }}
38+
steps:
39+
- uses: actions/checkout@v5
40+
- name: Get changed files
41+
id: changes
42+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
43+
with:
44+
token: ${{ github.token }}
45+
filters: .github/file-filters.yml
46+
4747
lint-podspec:
4848
name: ${{ matrix.podspec}} ${{ matrix.library_type }} ${{ matrix.platform}}
49+
# Run the job only for PRs with related changes or non-PR events.
50+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_lint_cocoapods_specs_for_prs == 'true'
51+
needs: files-changed
4952
runs-on: macos-14
5053
strategy:
5154
fail-fast: false
@@ -67,6 +70,9 @@ jobs:
6770

6871
lint-hybrid-sdk-podspec:
6972
name: Sentry/HybridSDK
73+
# Run the job only for PRs with related changes or non-PR events.
74+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_lint_cocoapods_specs_for_prs == 'true'
75+
needs: files-changed
7076
runs-on: macos-14
7177

7278
steps:
@@ -78,3 +84,22 @@ jobs:
7884
- name: Run CI Diagnostics
7985
if: failure()
8086
run: ./scripts/ci-diagnostics.sh
87+
88+
lint_cocoapods_Specs-required-check:
89+
needs:
90+
[
91+
files-changed,
92+
lint-podspec,
93+
lint-hybrid-sdk-podspec,
94+
]
95+
name: Lint CocoaPods Specs
96+
# This is necessary since a failed/skipped dependent job would cause this job to be skipped
97+
if: always()
98+
runs-on: ubuntu-latest
99+
steps:
100+
# If any jobs we depend on fails gets cancelled or times out, this job will fail.
101+
# Skipped jobs are not considered failures.
102+
- name: Check for failures
103+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
104+
run: |
105+
echo "One of the CocoaPods specs linting jobs has failed." && exit 1

.github/workflows/lint-swift-formatting.yml

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,7 @@ on:
44
push:
55
branches:
66
- main
7-
paths:
8-
- "**/*.swift"
9-
- ".github/workflows/lint-swift-formatting.yml"
10-
- ".swiftlint.yml"
11-
- "Makefile" # Make commands used for formatting setup
12-
- "Brewfile*" # Tools installation affects formatting environment
13-
- "scripts/ci-diagnostics.sh"
14-
157
pull_request:
16-
paths:
17-
- "**/*.swift"
18-
- ".github/workflows/lint-swift-formatting.yml"
19-
- ".swiftlint.yml"
20-
- "Makefile" # Make commands used for formatting setup
21-
- "Brewfile*" # Tools installation affects formatting environment
22-
- "scripts/ci-diagnostics.sh"
238

249
# Concurrency configuration:
2510
# - We use workflow-specific concurrency groups to prevent multiple lint runs on the same code,
@@ -33,8 +18,25 @@ concurrency:
3318
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
3419

3520
jobs:
21+
files-changed:
22+
name: Detect File Changes
23+
runs-on: ubuntu-latest
24+
outputs:
25+
run_lint_swift_formatting_for_prs: ${{ steps.changes.outputs.run_lint_swift_formatting_for_prs }}
26+
steps:
27+
- uses: actions/checkout@v5
28+
- name: Get changed files
29+
id: changes
30+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
31+
with:
32+
token: ${{ github.token }}
33+
filters: .github/file-filters.yml
34+
3635
lint:
3736
name: Lint
37+
# Run the job only for PRs with related changes or non-PR events.
38+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_lint_swift_formatting_for_prs == 'true'
39+
needs: files-changed
3840
runs-on: macos-15
3941
steps:
4042
- uses: actions/checkout@v5
@@ -58,3 +60,21 @@ jobs:
5860
- name: Run CI Diagnostics
5961
if: failure()
6062
run: ./scripts/ci-diagnostics.sh
63+
64+
lint_swift_formatting-required-check:
65+
needs:
66+
[
67+
files-changed,
68+
lint,
69+
]
70+
name: Lint Swift Formatting
71+
# This is necessary since a failed/skipped dependent job would cause this job to be skipped
72+
if: always()
73+
runs-on: ubuntu-latest
74+
steps:
75+
# If any jobs we depend on fails gets cancelled or times out, this job will fail.
76+
# Skipped jobs are not considered failures.
77+
- name: Check for failures
78+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
79+
run: |
80+
echo "One of the Swift formatting check jobs has failed." && exit 1

.github/workflows/release.yml

Lines changed: 64 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,6 @@ on:
77
- main
88

99
pull_request:
10-
paths:
11-
- "Sources/**"
12-
- "scripts/ci-select-xcode.sh"
13-
- "scripts/ci-diagnostics.sh"
14-
- Sentry.xcworkspace/**
15-
- Sentry.xcodeproj/**
16-
- "Package*.swift"
17-
- ".github/workflows/build-xcframework.yml"
18-
- "scripts/build-xcframework-slice.sh"
19-
- "scripts/assemble-xcframework.sh"
20-
- ".github/workflows/release.yml"
21-
- ".github/workflows/build-xcframework-variant-slices.yml"
22-
- ".github/workflows/assemble-xcframework-variant.yml"
23-
- ".github/workflows/ui-tests-common.yml"
24-
- Samples/macOS-SPM-CommandLine/**
25-
- Samples/SPM-Dynamic/**
2610

2711
workflow_dispatch:
2812
inputs:
@@ -48,8 +32,25 @@ concurrency:
4832
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
4933

5034
jobs:
35+
files-changed:
36+
name: Detect File Changes
37+
runs-on: ubuntu-latest
38+
outputs:
39+
run_release_for_prs: ${{ steps.changes.outputs.run_release_for_prs }}
40+
steps:
41+
- uses: actions/checkout@v5
42+
- name: Get changed files
43+
id: changes
44+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
45+
with:
46+
token: ${{ github.token }}
47+
filters: .github/file-filters.yml
48+
5149
build-xcframework-variant-slices:
5250
name: Build XCFramework Slices
51+
# Run the job only for PRs with related changes or non-PR events.
52+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_release_for_prs == 'true'
53+
needs: files-changed
5354
uses: ./.github/workflows/build-xcframework-variant-slices.yml
5455
with:
5556
name: ${{matrix.variant.name}}
@@ -78,7 +79,9 @@ jobs:
7879
id: sentry-withoutuikit-dynamic
7980

8081
assemble-xcframework-variant:
81-
needs: build-xcframework-variant-slices
82+
needs: [files-changed, build-xcframework-variant-slices]
83+
# Run the job only for PRs with related changes or non-PR events.
84+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_release_for_prs == 'true'
8285
name: Assemble XCFramework Variant
8386
uses: ./.github/workflows/assemble-xcframework-variant.yml
8487
secrets: inherit
@@ -126,7 +129,9 @@ jobs:
126129
validate-xcframework:
127130
name: Validate XCFramework
128131
runs-on: macos-14
129-
needs: assemble-xcframework-variant
132+
needs: [files-changed, assemble-xcframework-variant]
133+
# Run the job only for PRs with related changes or non-PR events.
134+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_release_for_prs == 'true'
130135
steps:
131136
- uses: actions/checkout@v5
132137
- uses: actions/download-artifact@v5
@@ -149,7 +154,9 @@ jobs:
149154
validate-spm:
150155
name: Validate SPM Static ${{matrix.package-file.name}}
151156
runs-on: macos-14
152-
needs: assemble-xcframework-variant
157+
needs: [files-changed, assemble-xcframework-variant]
158+
# Run the job only for PRs with related changes or non-PR events.
159+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_release_for_prs == 'true'
153160
steps:
154161
- uses: actions/checkout@v5
155162
- uses: actions/download-artifact@v5
@@ -180,7 +187,9 @@ jobs:
180187
validate-spm-dynamic:
181188
name: Validate SPM Dynamic ${{matrix.package-file.name}}
182189
runs-on: macos-14
183-
needs: assemble-xcframework-variant
190+
needs: [files-changed, assemble-xcframework-variant]
191+
# Run the job only for PRs with related changes or non-PR events.
192+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_release_for_prs == 'true'
184193
steps:
185194
- uses: actions/checkout@v5
186195
- uses: actions/download-artifact@v5
@@ -211,7 +220,9 @@ jobs:
211220
swift-build:
212221
name: Build Swift Static ${{matrix.package-file.name}}
213222
runs-on: macos-14
214-
needs: assemble-xcframework-variant
223+
needs: [files-changed, assemble-xcframework-variant]
224+
# Run the job only for PRs with related changes or non-PR events.
225+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_release_for_prs == 'true'
215226
steps:
216227
- uses: actions/checkout@v5
217228
- uses: actions/download-artifact@v5
@@ -241,7 +252,9 @@ jobs:
241252
duplication-tests:
242253
name: Test Sentry Duplication V4 # Up the version with every change to keep track of flaky tests
243254
uses: ./.github/workflows/ui-tests-common.yml
244-
needs: assemble-xcframework-variant
255+
needs: [files-changed, assemble-xcframework-variant]
256+
# Run the job only for PRs with related changes or non-PR events.
257+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_release_for_prs == 'true'
245258
secrets:
246259
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
247260
with:
@@ -253,7 +266,9 @@ jobs:
253266
app-metrics:
254267
name: Collect App Metrics
255268
runs-on: macos-15
256-
needs: assemble-xcframework-variant
269+
needs: [files-changed, assemble-xcframework-variant]
270+
# Run the job only for PRs with related changes or non-PR events.
271+
if: github.event_name != 'pull_request' || needs.files-changed.outputs.run_release_for_prs == 'true'
257272
timeout-minutes: 20
258273
steps:
259274
- name: Git checkout
@@ -307,6 +322,7 @@ jobs:
307322
runs-on: ubuntu-latest
308323
name: "Release New Version"
309324
needs: [
325+
files-changed,
310326
validate-xcframework,
311327
validate-spm,
312328
validate-spm-dynamic,
@@ -361,3 +377,28 @@ jobs:
361377
- name: Run CI Diagnostics
362378
if: failure()
363379
run: ./scripts/ci-diagnostics.sh
380+
381+
release-required-check:
382+
needs:
383+
[
384+
files-changed,
385+
build-xcframework-variant-slices,
386+
assemble-xcframework-variant,
387+
validate-xcframework,
388+
validate-spm,
389+
validate-spm-dynamic,
390+
swift-build,
391+
duplication-tests,
392+
app-metrics,
393+
]
394+
name: Release
395+
# This is necessary since a failed/skipped dependent job would cause this job to be skipped
396+
if: always()
397+
runs-on: ubuntu-latest
398+
steps:
399+
# If any jobs we depend on fails gets cancelled or times out, this job will fail.
400+
# Skipped jobs are not considered failures.
401+
- name: Check for failures
402+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
403+
run: |
404+
echo "One of the release check jobs has failed." && exit 1

CHANGELOG-v9.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Removes deprecated useSpan function (#5591)
99
Removes deprecated SentryDebugImageProvider class (#5598)
1010
Makes app hang tracking V2 the default and removes the option to enable/disable it (#5615)
1111
Removes segment property on SentryUser, SentryBaggage, and SentryTraceContext (#5638)
12-
Removes public SentrySerializable conformance from many public models (#5636, #5840)
12+
Removes public SentrySerializable conformance from many public models (#5636, #5840, #5982)
1313
Removes Decodable conformances from the public API of model classes (#5691)
1414
Removes enableTracing property from SentryOptions (#5694)
1515
Removes deprecated `setExtraValue` from SentrySpan (#5864)

0 commit comments

Comments
 (0)