Remove unused env vars from fastlane tooling#25771
Conversation
Wraps `Xcodeproj::Config` with the error handling its raw API lacks: a missing file, a missing key, and a key set to an empty value all raise rather than silently yielding `nil`. Uses `to_hash` rather than `attributes`, since the latter only sees the settings assigned in the file itself, not those it pulls in via `#include`. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`INT_EXPORT_TEAM_ID` duplicated a value the project already declares: enterprise and prototype builds use the `Release-Alpha` configuration, whose `DEVELOPMENT_TEAM` is set in `config/Common.alpha.xcconfig`. Reading it from there removes one secret from the environment the tooling needs to be handed. Note the value also lives in `project.env` in the `mobile-secrets` repository, where it now has no consumer. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Same reasoning as the internal team ID in the previous commit: `EXT_EXPORT_TEAM_ID` duplicated the `DEVELOPMENT_TEAM` that `config/Common.release.xcconfig` already declares for the App Store builds, which use the `Release` configuration. With both gone, `project.env` no longer has to carry either team ID. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Both call sites authenticate with `api_key`, and pilot only ever reads `team_id` on the username/password Spaceship path — see `pilot/lib/pilot/manager.rb:36`, the sole reader of `config[:team_id]` in the whole of `pilot/lib`, which sits in the `else` branch that an API token skips. An App Store Connect API key is issued by a single team, so there is no team left to disambiguate. `woocommerce-ios` has shipped its TestFlight uploads without the parameter for this reason. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Every key it carried is now unused: the two export team IDs come from `xcconfig`, `FASTLANE_ITC_TEAM_ID` was inert alongside an `api_key`, the Sentry slugs are hardcoded constants in `build.rb`, and the two HockeyApp IDs outlived the service. With nothing reading the file, the `before_all` guard demanding it had no purpose either — which is what the three CI scripts were copying the example file to satisfy. `configure_apply` creates its destination directory itself, so nothing else needed that block. The file still exists in `mobile-secrets`, where it can now be deleted. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Generated by 🚫 Danger |
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 33099 | |
| Version | PR #25771 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | e1b296d | |
| Installation URL | 6icfask3920pg |
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 33099 | |
| Version | PR #25771 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | e1b296d | |
| Installation URL | 5inshnp23873g |
|
|
||
| upload_to_testflight( | ||
| team_id: get_required_env('FASTLANE_ITC_TEAM_ID'), | ||
| api_key: app_store_connect_api_key, |
There was a problem hiding this comment.
Team id is unnecessary thanks to the API key.
See it validated in WooCommerce https://github.com/woocommerce/woocommerce-ios/blob/9b84ea2e77e91cecf8f0ee6d0021f49f75390d24/fastlane/Fastfile#L919-L928
| output_name: APP_STORE_CONNECT_BUILD_NAME_WORDPRESS, | ||
| derived_data_path: DERIVED_DATA_PATH, | ||
| export_team_id: get_required_env('EXT_EXPORT_TEAM_ID'), | ||
| export_team_id: EXTERNAL_TEAM_ID, |
There was a problem hiding this comment.
Might want to follow up with a PR that audits the code and docs and aligns names such as external/app-store/production/release and internal/alpha/prototype/enterprise. Of course, before being able to do that it would be good to have a naming preference to adopt. cc @jkmassel on that.
There was a problem hiding this comment.
Pull request overview
This PR removes the previously-encrypted project.env secret file and eliminates Fastlane’s dependency on several env vars that are either unused or can be derived from the repo’s existing Xcode configuration, as prep work for migrating secrets management to a8c-secrets.
Changes:
- Introduces an
XcconfigHelperto read build settings from.xcconfigfiles and uses it to derive internal/externalDEVELOPMENT_TEAMIDs. - Removes
project.envusage from Fastlane bootstrapping and deletes theproject.env-example. - Cleans up Buildkite scripts and
.configureto stop copying/installing the removed env file, and removes now-unnecessaryteam_idusage in TestFlight uploads.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| fastlane/lanes/xcconfig_helper.rb | Adds a helper for reading .xcconfig build settings (resolving #includes) so Fastlane can reuse Xcode-declared values. |
| fastlane/Fastfile | Removes project.env loading/checks and derives INTERNAL_TEAM_ID / EXTERNAL_TEAM_ID from Common.alpha.xcconfig and Common.release.xcconfig. |
| fastlane/lanes/build.rb | Replaces export team env vars with INTERNAL_TEAM_ID / EXTERNAL_TEAM_ID constants and removes TestFlight team_id usage. |
| fastlane/lanes/codesign.rb | Switches match/code signing team IDs from env vars to the new constants. |
| fastlane/lanes/promote.rb | Removes TestFlight team_id usage for promotion flow. |
| fastlane/env/project.env-example | Deletes the obsolete example env file that mirrored the removed secret env file. |
| .configure | Stops copying/encrypting iOS/WPiOS/project.env into the secrets directory. |
| .buildkite/commands/verify-strings-catalog.sh | Removes CI steps that created/copied project.env solely to satisfy Fastlane prechecks. |
| .buildkite/commands/lint-localized-strings-format.sh | Removes CI steps that created/copied project.env solely to satisfy Fastlane prechecks. |
| .buildkite/commands/build-for-testing.sh | Removes the project.env copy step before running configure_apply. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AliSoftware
left a comment
There was a problem hiding this comment.
LGTM except for the forgotten .enc file cleanup
| { | ||
| "file": "iOS/WPiOS/project.env", | ||
| "destination": "~/.configure/wordpress-ios/secrets/project.env", | ||
| "encrypt": true | ||
| }, |
There was a problem hiding this comment.
We should also remove the project.env.enc file from this repo's .configure-files/


Prep work for migrating to https://github.com/Automattic/a8c-secrets. Removes the encrypted
project.envwhich contained unused env vars and env vars that did not need to be secret.