Skip to content

[build-tools] handle custom Gymfile err in xcactivitylog#3790

Merged
hSATAC merged 1 commit into
mainfrom
ash/eng-21383-fix-custom-gymfile-error
May 26, 2026
Merged

[build-tools] handle custom Gymfile err in xcactivitylog#3790
hSATAC merged 1 commit into
mainfrom
ash/eng-21383-fix-custom-gymfile-error

Conversation

@hSATAC
Copy link
Copy Markdown
Contributor

@hSATAC hSATAC commented May 25, 2026

Why

Fix Sentry TURTLE-V2-WORKER-1WT (ENG-21383) — 48 events of xclogparser failing during the PARSE_XCACTIVITYLOG phase with stderr:

Error: The file "Build" couldn't be opened because there is no such file.

runFastlaneGym always returns derivedDataPath = <ios>/build, but projects with a custom ios/Gymfile can set a different derived_data_path (or omit it entirely, in which case Xcode uses its default DerivedData location). xclogparser then runs against a directory that has no .xcactivitylog files and fails.

How

Added a pre-flight check in parseAndReportXcactivitylog that lists <derivedDataPath>/Logs/Build/:

  • If no .xcactivitylog files are present, log actionable guidance pointing users at the Gymfile lines they need and skip the analysis (no Sentry — this is user config, not an engineering bug).
  • If readdir fails with anything other than ENOENT (e.g. EACCES, EMFILE), rethrow so it still lands in Sentry under a new checking_xcactivitylog_existence phase tag — real infra problems are not masked by the swallow.

Return type changed from Promise<void> to Promise<{ skipped: boolean }> so the caller in builders/ios.ts can call ctx.markBuildPhaseSkipped() and reflect the correct phase status in the build summary.

Test Plan

Unit tests in xcactivitylog.test.ts cover the four pre-check branches:

  • Logs/Build exists but has no .xcactivitylog files → skipped + actionable Gymfile log, no Sentry
  • Logs/Build does not exist (ENOENT) → skipped, no Sentry
  • Logs/Build has only non-.xcactivitylog entries (e.g. LogStoreManifest.plist) → skipped
  • readdir fails with EACCES → Sentry captured with checking_xcactivitylog_existence phase tag, no misleading Gymfile message logged

Existing tests updated to assert the new { skipped } return shape. 41/41 tests pass; typecheck/lint/fmt clean.

Signed-off-by: Ash Wu <hsatac@gmail.com>
@hSATAC hSATAC added the no changelog PR that doesn't require a changelog entry label May 25, 2026
@linear
Copy link
Copy Markdown

linear Bot commented May 25, 2026

ENG-21383

@github-actions
Copy link
Copy Markdown

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.22%. Comparing base (149f5d8) to head (f9eb7f4).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3790      +/-   ##
==========================================
+ Coverage   57.21%   57.22%   +0.02%     
==========================================
  Files         905      905              
  Lines       39290    39303      +13     
  Branches     8235     8237       +2     
==========================================
+ Hits        22475    22488      +13     
  Misses      15345    15345              
  Partials     1470     1470              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hSATAC hSATAC requested a review from sjchmiela May 25, 2026 14:36
@hSATAC hSATAC marked this pull request as ready for review May 25, 2026 14:36
@github-actions
Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
**/* @douglowder

Generated by CodeMention

Comment thread packages/build-tools/src/steps/utils/ios/xcactivitylog.ts
Comment thread packages/build-tools/src/steps/utils/ios/xcactivitylog.ts
@hSATAC hSATAC merged commit 5f26518 into main May 26, 2026
11 of 12 checks passed
@hSATAC hSATAC deleted the ash/eng-21383-fix-custom-gymfile-error branch May 26, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PR that doesn't require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants