DRY the CI secrets install into a dedicated script - #4857
Conversation
Twelve call sites each spelled out their own secrets step, so changing how secrets are decrypted meant touching all twelve. This is groundwork for swapping `configure_apply` for `a8c-secrets` (AINFRA-1541): afterwards that swap is a one-file diff. `build.sh` is the only behaviour change — it had no explicit secrets step and leaned on `configure_apply` in fastlane's `before_all`. It now decrypts through `shared_setup.sh` like the other build scripts. Extracted from #4731 to shrink it to the parts still under discussion. --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Claude finished @mokagio's task in 1m 53s —— View job PR Review: DRY the CI secrets install into a dedicated script
This is a clean, low-risk refactor. All twelve call sites now route through Things I checked that are correct:
Minor observations (non-blocking):
Nothing here needs changing before merge. The |
| echo "--- :closed_lock_with_key: Installing Secrets" | ||
| bundle exec fastlane run configure_apply | ||
|
|
There was a problem hiding this comment.
We don't need secrets like GoogleServices-Info.plist to build the prototype build? Is it because Prototype Builds are signed and distributed with the Enterprise Apple account not App Store and we don't want to use the Firebase production credentials for those?
nvm, I see this is handled by shared_setup.sh now.
| echo "--- :closed_lock_with_key: Installing Secrets" | ||
| bundle exec fastlane run configure_apply | ||
|
|
There was a problem hiding this comment.
Don't we need some secrets like GoogleServices-Info.plist to build the tvOS app? Or is the tvOS app not using Firebase / Google Services at all and it's only used by the iOS app and that's why you didn't decrypt them here?
nvm, I see this is handled by shared_setup.sh now.
| echo "--- :closed_lock_with_key: Installing Secrets" | ||
| bundle exec fastlane run configure_apply | ||
|
|
There was a problem hiding this comment.
Don't we need e.g. GoogleServices-Info.plist secret for building the release?
nvm, I see this is handled by shared_setup.sh now.
|
|
||
| echo "--- :closed_lock_with_key: Installing Secrets" | ||
| bundle exec fastlane run configure_apply | ||
| "$(dirname "${BASH_SOURCE[0]}")/install-secrets.sh" |
There was a problem hiding this comment.
What secrets from .configure do we actually need for the upload of the release?
Now that CI secrets like the ASC API keys have been moved to Buildkite secret env vars instead of .configure-files, do we still need any remaining secret for just the upload?
There was a problem hiding this comment.
Good catch — you're right, and I've dropped it in db32838.
I traced every lane these stages invoke against the four files .configure actually manages (fastlane_match_pwd.txt, pocket_casts_credentials.json, GoogleService-Info.plist, GoogleSignIn.txt). None of them are read here:
| Stage | Lanes | Credentials |
|---|---|---|
release-upload.sh |
create_release_on_github, symbols_upload, upload_app_store_connect_build_to_testflight[_tvos], notify_release_on_slack |
GITHUB_TOKEN, SENTRY_AUTH_TOKEN, ASC API key — all Buildkite env |
prototype-upload.sh |
upload_enterprise |
FIREBASE_APP_DISTRIBUTION_ACCOUNT_KEY — Buildkite env |
code-freeze, finalize-release, finalize-hotfix-release, publish-release |
code_freeze, finalize_release, finalize_hotfix_release, publish_release |
GITHUB_TOKEN, ASC API key |
new-beta-release, new-hotfix-release |
new_beta_release, new_hotfix_release |
none — git and GlotPress only |
I removed the last two as well even though you didn't flag them, since they have the same property.
Worth noting the removal is a no-op today: Fastfile's before_all calls configure_apply for every lane regardless, so the explicit step was only ever buying a visible Buildkite step. It becomes load-bearing in #4731, where before_all goes away — at which point these stages stop decrypting secrets they never read, rather than silently keeping the dependency.
install-secrets.sh stays, now with shared_setup.sh as its only caller. That's still the seam #4731 swaps for a8c-secrets, so I'd rather not inline it back.
Posted by Claude Code (Opus 5) on behalf of @mokagio with approval.
The four files in `.configure` are build-time inputs: the `match` password, the Google Service plist, the Google Sign-In key and the credentials JSON. None of the lanes these eight stages invoke read them — the upload lanes and the release-management lanes authenticate purely through Buildkite `env` secrets (`GITHUB_TOKEN`, the ASC API key, `SENTRY_AUTH_TOKEN`, `FIREBASE_APP_DISTRIBUTION_ACCOUNT_KEY`), and the `new_*` lanes only touch git and GlotPress. Olivier raised this on #4857. Decrypting stays harmless today because `before_all` calls `configure_apply` for every lane regardless, so this only removes the redundant explicit step. It becomes load-bearing with #4731, where `before_all` goes away and these stages would otherwise pay for secrets they never read. `install-secrets.sh` is left in place with `shared_setup.sh` as its only caller: it stays the named seam that #4731 swaps for `a8c-secrets`. --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Code Opus 5 <noreply@anthropic.com>
|
Claude finished @mokagio's task in 2m 59s —— View job Re-review: secrets dropped from non-build stages
The new commit directly answers @AliSoftware's review questions ("do these upload / release-management stages actually need What the four
None of the upload lanes ( Safety net is real
Stragglers Clean. Within One thing worth carrying into #4731 Because Nothing to change here. The commit is well-scoped, the message is accurate, and it resolves the reviewer's questions. LGTM. |
|
Version |
Part of AINFRA-2774, under AINFRA-1541.
I was looking at #4731 to get it ready for a new round of review and grew overwhelmed by the various changes and the open question of how it should flow in CI vs local (when and how to call the decrypt?) and for internal vs external contributors.
As such, I've decided to extract the parts that are already good in dedicated PRs, and to rework the remainder in isolation.
This PR DRYs how CI decrypts secrets.
AI-generated Details
Twelve CI call sites each spelled out their own
bundle exec fastlane run configure_applystep, so changing how secrets are decrypted means touching all twelve.This collapses them onto
.buildkite/commands/install-secrets.sh.The mechanism is unchanged — it still calls
configure_apply.The point is that #4731, which swaps
.configurefora8c-secrets, shrinks to the parts that still need discussion once this lands.One behaviour change:
build.shhad no explicit secrets step and leaned onconfigure_applyin fastlane'sbefore_all.It now decrypts through
shared_setup.shlike the other build scripts — same net effect, one extra visible Buildkite step.To test
This PR's own build exercises the new shared path (
build.sh→shared_setup.sh→install-secrets.sh).The six release pipelines under
.buildkite/release-pipelines/and the prototype/tvOS upload scripts only run on demand, so CI here does not cover them.Their edit is the same two-line-for-one-line substitution in every file — worth an eyeball, not a manual trigger.
Checklist
CHANGELOG.mdif necessary.