DRY secrets paths via xcconfig - #4858
Conversation
The three secrets paths were spelled out in full 16 times across the project's build configurations, so every relocation of the secrets directory meant 16 edits and a `pbxproj` diff. Defining them once in `config/PocketCasts.base.xcconfig`, on top of a `SECRETS_DIR` variable, reduces that to a single line. This mirrors a19da50 on the a8c-secrets adoption branch, applied here against the current secrets directory. Resolved build settings for the two consuming targets, `podcasts` and `PreBuildActions`, are byte-identical to before across all four build configurations. --- 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 4m 39s —— View job PR Review: DRY secrets paths via xcconfig
Verdict: LGTM — this is a safe, well-scoped DRY refactor. ✅ I traced each removed setting to confirm nothing breaks. The key mechanism is that Per-setting confirmation:
Notably, the Extra nits (all optional, non-blocking):
|
|
|
||
| SECRETS_DIR = $(HOME)/.configure/pocketcasts-ios/secrets | ||
| FIREBASE_SECRETS_PATH = $(SECRETS_DIR)/GoogleService-Info.plist | ||
| SECRETS_PATH = $(SECRETS_DIR)/pocket_casts_credentials.json |
There was a problem hiding this comment.
This SECRETS_PATH is quite a generic variable name for something specific to pocket_casts_credentials.json, and makes it not clear to distinguish from this SECRET_PATH not meaning "the path to the secrets folder" (which is what SECRET_DIR is for) or from this being any other secret file (like GoogleService-Info.plist or any other).
I'd thus recommend to rename the variable to something more explicit, like PC_CREDENTIALS_JSON_PATH or something.
(Maybe that's something you only had in mind for a separate, follow-up PR, though? 🤷 )
There was a problem hiding this comment.
Whoops I didn't realize auto-merge was on. I guess follow-up PR it will be, then 🙃
There was a problem hiding this comment.
We'll touch this file again when changing to a8c-secrets. I'll try to remember.
There was a problem hiding this comment.
I'll try to remember.
Actually, that's a recipe for failure. Handed it over to an agent...
`SECRETS_PATH` reads as "the path to the secrets folder" — which is what `SECRETS_DIR` is — or as the path to any one of the secret files. It points at `pocket_casts_credentials.json` specifically, so name it after that. Follow-up to the review of Automattic#4858: Automattic#4858 (comment) --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Code Opus 5 <noreply@anthropic.com>
See AINFRA-2775, 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 the build settings configuration to the paths of the secret files used at build time