Skip to content

v2: modernize for SPM-only projects (GitHub URLs, lanes, CI templates, doctor, smoke test) - #2

Merged
iggyto merged 17 commits into
masterfrom
v2
Dec 2, 2026
Merged

iggyto merged 17 commits into
masterfrom
v2

Conversation

@iggyto

@iggyto iggyto commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What

Modernizes the repo for new SPM-only iOS projects (v2). One commit per step, best reviewed commit by commit. Full list in CHANGELOG.md.

  • GitHub, not GitLab: all URLs point to this repo over HTTPS; the generated Fastfile imports CommonFastfile with version: '~> 2.0'.
  • SPM only: no CocoaPods/workspace handling.
  • Build/test logic moved into lanes (iq_build, iq_test; generated build / test lanes); scripts/build.sh is a thin wrapper. Results are written even when tests fail. Coverage via xccov -> Cobertura, junit via fastlane trainer (no more slather / xchtmlreport).
  • CI templates: GitHub Actions (ci.yml, distribute.yml, dependabot.yml) and Jenkinsfile, offered by the generator. iq_asc_api_key reads the App Store Connect key from CI secrets.
  • xcodes replaces xcode-install; .xcode-version selects Xcode.
  • TestFlight: iq_beta -> iq_testflight (old name kept as a deprecated alias), generated lane ship_testflight (testflight clashes with a fastlane action).
  • Versions: versions.env (Ruby 4.0.10, tested) is the single source; projects own it in .ruby-version. A weekly workflow smoke-tests the newest Ruby and opens a bump PR or an issue.
  • New lanes: check_certs (expiry report, strict:true for a scheduled CI job), sync_devices (devices.txt from the portal with the API key), lint (SwiftLint / SwiftFormat), bump_version (edits MARKETING_VERSION directly: agvtool cannot read projects with a generated Info.plist).
  • scripts/doctor.sh in generated projects checks the setup and explains fixes.
  • Tests: tests/lanes.sh (fast, stubbed Spaceship and lint tools) and tests/smoke.sh (end to end: generates a sample app, runs the generator, bump_version/build/test/warnings/coverage/doctor).

Breaking

Existing projects importing from the retired GitLab host need to switch to the GitHub URL and version: '~> 2.0'. iq_beta still works but warns.

Verified

  • Lint, Lanes and Smoke test workflows pass on a hosted macos-latest runner, and the smoke test also passes locally in a clean environment (env -i). Running on a fresh machine found several assumptions that only showed up there (rbenv not initialised, stale Homebrew ruby-build, no UTF-8 locale), all fixed here.

Still to verify (needs the code on the default branch or a real project)

  • Versions workflow via "Run workflow" (needs the setting "Allow GitHub Actions to create and approve pull requests", already on)
  • Jenkinsfile and distribute.yml on one real project (Firebase token setup is the least certain part)

After merging

Tag v2.0.0 (generated Fastfiles pin ~> 2.0, which does not resolve before the tag exists).

🤖 Generated with Claude Code

iggyto and others added 14 commits November 27, 2026 10:37
…rsion, updated defaults and README

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
build.sh becomes a thin wrapper around new build/test lanes (iq_build/iq_test
helpers in CommonFastfile). Generated .gitignore now covers build artifacts
and API keys; this repo gets a .gitignore too.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… xcodes, add .xcode-version

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…a as deprecated alias

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- build.sh rejected bundler versions other than 2.x
- gym drops the test bundles when building for testing, use scan(build_for_testing)
- generator can run unattended and from a local clone

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tor, weekly freshness CI

- No Ruby/bundler/RubyGems pins in this repo; generator resolves the latest stable Ruby
  into the project's .ruby-version, setup/build read it from there
- scripts/doctor.sh checks the project setup and explains fixes
- Dependabot config for generated projects, macos-latest, current action majors
- Weekly smoke run + tests/check-actions.sh, opens a 'versions' issue on failure

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…y PR

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Found by the first hosted-runner smoke run: without rbenv initialised in the
shell, the runner's own Ruby was used, so the build number phase script was not
added and the doctor reported the wrong Ruby.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- check_certs: expiry report of certificates and match profiles, strict:true for CI
- sync_devices: devices.txt from the developer portal with the API key
- lint: SwiftLint / SwiftFormat in lint mode
- bump_version: edits MARKETING_VERSION with xcodeproj (agvtool cannot read the version of
  projects with a generated Info.plist), generated lane + commit
- before_all skips the App Store Connect key for the offline lanes (lint, bump_version)
- tests/lanes.sh: fast stubbed tests of the new lanes; smoke test runs bump_version for real

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…now the Ruby

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@iggyto
iggyto marked this pull request as ready for review November 27, 2026 14:34
@iggyto
iggyto requested a review from sergihernanz November 27, 2026 14:34

@sergihernanz sergihernanz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall: CI is green and nothing looks blocking in the design; the inline comments are small fixes or questions, hence "needs work" until they are answered.

  • CHANGELOG says fastlane_version "raised to 2.220.0" but CommonFastfile now has 2.242.0.
  • Out of scope here, to track as issues: FIREBASE_TOKEN (firebase login:ci) is being deprecated in favor of service accounts/ADC; the Jenkins template runs setup.sh on every build (some of us prefer CI that only checks the environment and never installs).
  • FMP (familymealplan-ios) uses these lanes through ios-project-setup v1.0.0 and has a few things we may upstream later (PR builds to Firebase, a promote-to-App-Review lane, UI tests failing the build with one retry). We'll open separate issues/PRs for those.

Comment thread fastlane/CommonFastfile Resolved
Comment thread fastlane/CommonFastfile Resolved
Comment thread fastlane/CommonFastfile Resolved
Comment thread fastlane/CommonFastfile Resolved
Comment thread fastlane/CommonFastfile Resolved
Comment thread fastlane/CommonFastfile Outdated
sim = iq_prepare_simulator
begin
iq_build_for_simulator(schemename: schemename, xcprojname: xcprojname, sim: sim, for_testing: false, derived_data: derived_data)
iq_touch_report(File.join(iq_root, 'coverage', 'cobertura.xml'))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question (not tested): iq_touch_report leaves a 0-byte cobertura.xml. The Jenkins Cobertura plugin may fail to parse it even with failNoReports: false.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, a 0-byte file is not valid XML. Fixed in edf7bf5: build-only runs now write empty but well-formed files (<coverage ...><packages/></coverage> and <testsuites/>) via iq_write_empty_report. tests/lanes.sh and the smoke test check them with xmllint. I could not try the Jenkins Cobertura plugin itself, so it is worth a look on a real agent.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested on a real Jenkins (FMP), with a throwaway branch whose build only wrote these empty reports:

  • junit accepts the empty <testsuites tests="0" failures="0"/>.
  • recordCoverage (Coverage plugin, parser: 'COBERTURA') fails the build: CoberturaParser ... 'coverage/cobertura.xml' does not contain data, even though the XML is well-formed.

So the empty-but-valid file is not enough for the Coverage plugin. I have not tried the classic Cobertura plugin that the Jenkinsfile template uses (cobertura ... failNoReports: false), so that one is still unknown.

Suggestion: do not write coverage/cobertura.xml in build-only runs (keep the empty junit files) and let the template's publisher tolerate a missing file. To reproduce: recordCoverage(tools: [[parser: 'COBERTURA', pattern: '**/coverage/cobertura.xml']]) over the <coverage ...><sources/><packages/></coverage> that iq_write_empty_report writes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 90d0dbc, following your suggestion: build-only runs no longer write coverage/cobertura.xml (a stale one is removed), only the empty junit files. The Jenkinsfile template uses the classic cobertura step with failNoReports: false, which should tolerate a missing file, but I could not try it. Could you check it once on FMP? I also added a note in the template about guarding recordCoverage with fileExists().

…g, coverage on failure, check_certs scope, valid empty reports

- iq_env: an empty ASC_KEY_ID / ASC_ISSUER_ID (unset CI secret) no longer wins
- build log found by whatever name fastlane gave it
- Jenkins JOB_NAME sanitized before it goes into the simulator name
- coverage written even when unit tests fail
- check_certs only looks at the project's match profiles and the certificates they use
- build-only runs write well-formed empty junit / Cobertura files
- build.sh: FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT 30s (3s timed out on a busy machine)
- CHANGELOG: fastlane_version is 2.242.0

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@iggyto

iggyto commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

He(mos) ajustado las cosas de tus comentarios, he abierto un issue para el tema Jenkins, y he dejado por si tú quieres hacer algún otro con las ideas de FMP.

Cuando apruebes avisa, no hagas el merge que tengo que cambiar las release notes. Gracias!

@sergihernanz sergihernanz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fixes: I read the new code and the five threads I resolved (empty env secrets, build log name, job name, coverage on failing tests, check_certs filter) look right.

Still needs work on the empty cobertura.xml (see the open thread): with the Coverage plugin the build fails on it, tested on a real Jenkins. Everything else is fine from my side. Please don't merge before your release-notes change, as you said.

…pty one); keep empty junit

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@iggyto
iggyto requested a review from sergihernanz December 1, 2026 10:48

@sergihernanz sergihernanz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved. I read 90d0dbc: build-only runs now write no coverage/cobertura.xml (and remove a stale one), and the tests cover it.

Open item, not blocking: how recordCoverage and the classic cobertura step behave with a missing file is still untested. We'll try it on FMP when we adopt v2 and report back on the thread.

As you asked, I'm not merging: it's yours, after the release notes change. Tag v2.0.0 after the merge.

@sergihernanz

Copy link
Copy Markdown
Contributor

Approved, ready for you: I'm not merging, as you asked. Remember the v2.0.0 tag after the merge.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@iggyto
iggyto merged commit c3e03b7 into master Dec 2, 2026
3 checks passed
@iggyto
iggyto deleted the v2 branch December 2, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants