Skip to content

Conversation

philprime
Copy link
Member

This pull request refactors concurrency management across all GitHub Actions workflow files to improve CI efficiency and resource usage.

  • All workflow files now use concurrency.group: ${{ github.workflow }}-${{ github.ref }} to prevent duplicate runs of the same workflow on the same branch/commit, replacing the previous fallback logic.
  • Cancellation logic is now customized per workflow: for pull requests, in-progress runs are always cancelled; for main branch pushes and scheduled runs, cancellation is disabled to ensure complete baselines and release integrity.
  • The benchmarking workflow now includes a step to forcibly cancel SauceLabs jobs if the workflow is cancelled, preventing resource leaks and unnecessary external charges.
  • Each workflow now contains explanatory comments detailing the concurrency strategy and rationale for cancellation behavior.
  • Security (codeql-analysis.yml) and release (release.yml) workflows now have logic to never cancel scheduled or main branch runs, ensuring complete security and release validation.

cursor review

#skip-changelog

@philprime philprime requested a review from Copilot August 7, 2025 15:40
@philprime philprime self-assigned this Aug 7, 2025
Copilot

This comment was marked as outdated.

Copy link

codecov bot commented Aug 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.681%. Comparing base (82f60cf) to head (8f83662).
⚠️ Report is 23 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #5838       +/-   ##
=============================================
+ Coverage   86.641%   86.681%   +0.039%     
=============================================
  Files          423       423               
  Lines        36405     36505      +100     
  Branches     17228     17278       +50     
=============================================
+ Hits         31542     31643      +101     
  Misses        4815      4815               
+ Partials        48        47        -1     

see 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 82f60cf...8f83662. Read the comment docs.

Copy link
Contributor

github-actions bot commented Aug 7, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1232.36 ms 1251.09 ms 18.72 ms
Size 23.75 KiB 919.69 KiB 895.95 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
f262e10 1226.88 ms 1250.39 ms 23.51 ms
736bcfb 1229.86 ms 1249.59 ms 19.73 ms
ad964ca 1234.73 ms 1254.88 ms 20.15 ms
55f739c 1226.06 ms 1248.78 ms 22.71 ms
186f06f 1211.33 ms 1235.41 ms 24.08 ms
438caec 1230.02 ms 1250.00 ms 19.98 ms
748df9d 1231.63 ms 1259.47 ms 27.84 ms
1b9991e 1233.45 ms 1256.61 ms 23.17 ms
53b722c 1222.33 ms 1244.90 ms 22.56 ms
65ebbdb 1233.96 ms 1255.79 ms 21.83 ms

App size

Revision Plain With Sentry Diff
f262e10 23.75 KiB 913.62 KiB 889.87 KiB
736bcfb 23.74 KiB 891.02 KiB 867.28 KiB
ad964ca 23.75 KiB 913.17 KiB 889.42 KiB
55f739c 23.75 KiB 858.73 KiB 834.98 KiB
186f06f 23.75 KiB 876.94 KiB 853.19 KiB
438caec 23.74 KiB 913.14 KiB 889.40 KiB
748df9d 23.75 KiB 902.48 KiB 878.74 KiB
1b9991e 23.75 KiB 908.01 KiB 884.26 KiB
53b722c 23.75 KiB 906.08 KiB 882.33 KiB
65ebbdb 23.75 KiB 902.33 KiB 878.59 KiB

Previous results on branch: philprime/ci-concurrency-improvements

Startup times

Revision Plain With Sentry Diff
3c803e6 1234.96 ms 1260.43 ms 25.47 ms

App size

Revision Plain With Sentry Diff
3c803e6 23.75 KiB 913.62 KiB 889.87 KiB

- Standardized concurrency settings to prevent multiple runs of the same workflow on pull requests and main branch pushes.
- Implemented cancellation of in-progress runs for pull requests to optimize CI resource usage.
- Ensured that main branch pushes do not cancel ongoing runs to maintain complete validation of critical processes.
@philprime philprime force-pushed the philprime/ci-concurrency-improvements branch from cdbbeca to 44f782d Compare August 8, 2025 07:18
@philprime philprime requested a review from Copilot August 8, 2025 07:26
@philprime
Copy link
Member Author

cursor review

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors concurrency management across all GitHub Actions workflow files to improve CI efficiency and resource usage. The changes standardize concurrency configuration patterns while optimizing cancellation behavior based on workflow context and branch type.

  • Standardized concurrency group configuration from ${{ github.head_ref || github.run_id }} to ${{ github.workflow }}-${{ github.ref }} across all workflows
  • Implemented context-aware cancellation logic that preserves main branch and scheduled runs while allowing cancellation for pull requests
  • Added comprehensive documentation comments explaining the concurrency strategy and rationale for each workflow

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

File Description
.pre-commit-config.yaml Updated regex pattern for YAML file matching
.github/workflows/*.yml (multiple files) Standardized concurrency configuration with workflow-specific groups and context-aware cancellation logic
.github/workflows/benchmarking.yml Added SauceLabs job cancellation step to prevent resource leaks when workflow is cancelled

cursor[bot]

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@philprime philprime marked this pull request as ready for review August 8, 2025 07:30
cursor[bot]

This comment was marked as outdated.

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

LGTM

@philprime
Copy link
Member Author

The saucelabs helper grew quite in size, I'll move it to a different PR.

Copy link
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • .github/workflows/changes-in-high-risk-code.yml

@philprime
Copy link
Member Author

philprime commented Aug 11, 2025

Moved SauceLabs cancelling to #5873

@philprime philprime added the Waiting for: CI 🤖 Marks PR as ready-for-merge when CI passes. To be replaced with required checks. label Aug 11, 2025
@philprime philprime merged commit 7f4bf81 into main Aug 12, 2025
141 checks passed
@philprime philprime deleted the philprime/ci-concurrency-improvements branch August 12, 2025 08:59
philipsawyerdd added a commit to justin-doordash/sentry-cocoa that referenced this pull request Sep 25, 2025
philipsawyerdd added a commit to justin-doordash/sentry-cocoa that referenced this pull request Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Waiting for: CI 🤖 Marks PR as ready-for-merge when CI passes. To be replaced with required checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants