Repository navigation
Add release process guardrails - #8773
Conversation
|
@codex review |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
5 issues found across 16 files
Confidence score: 3/5
- The biggest risk is in
desktop/macos/scripts/test-tool-surfaces.sh:select_node22can accept Node 22 versions below 22.6, so runs may pass the guard but fail when--experimental-strip-typesis used, causing avoidable CI/test breakage — tighten the check to require>=22.6.0before merging. - Also in
desktop/macos/scripts/test-tool-surfaces.sh, Node discovery skips Intel Homebrew (/usr/local/opt/node@22/bin/node), which can make Intel macOS setups fail to find a valid Node 22 and produce inconsistent local/CI behavior — add the Intel path to de-risk cross-machine execution. - In
scripts/scan-public-artifact-secrets.py,looks_like_tar()over-matches generic suffixes (.gz,.bz2,.xz) as tar archives, so valid compressed non-tar files can trigger scan errors and noisy failures — restrict tar detection to true tar patterns (for example.tar.*) or add a safe probe before opening. - In
scripts/scan-public-artifact-secrets.pyandscripts/create-public-client-env.sh,.asarhandling and rawemit()output can create false scan failures and malformed.client.envfiles when values contain newlines, risking broken automation and incorrect env parsing — fix ASAR type handling and sanitize/quote env values before merge.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8af611354
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| SECRET_VALUE_PATTERNS = ( | ||
| (re.compile(rb"\bsk-(?:proj-|svcacct-)?[A-Za-z0-9_-]{16,}\b"), "OpenAI-shaped secret"), | ||
| (re.compile(rb"\bsk-ant-[A-Za-z0-9_-]{16,}\b"), "Anthropic-shaped secret"), | ||
| (re.compile(rb"\bAIza[0-9A-Za-z_-]{20,}\b"), "Google API key-shaped secret"), |
There was a problem hiding this comment.
Allow public Google client keys in artifact scans
When the new Codemagic IPA/AAB steps run this scanner on normal Flutter releases, this pattern matches Firebase/Maps API keys (AIza...) that are expected to ship in public clients; the iOS project copies GoogleService-Info.plist into the app resources, and Android's google-services plugin similarly packages the Firebase API key. Because this pattern is applied unconditionally to every bundled file, releases containing standard Google config are rejected before publishing; restrict this to server-only Google keys or allowlist known public client config values.
Useful? React with 👍 / 👎.
| @@ -1,4 +1,7 @@ | |||
| { | |||
| "scripts": { | |||
| "build": "mkdir -p build && cp -R api-reference assets doc images logo memory onboarding operational rollout runbooks superpowers docs.json favicon.ico getstartedwithomi.mdx quickstart.mdx build/" | |||
There was a problem hiding this comment.
Copy referenced root docs assets in the build
In the Pages workflow this is the entire npm run build, but it omits top-level files/directories that current docs reference, e.g. onboarding pages use /omi-glass.png, /omi-without-rope.png, and /omi-devkit-without-rope.png, and backend/memory docs link into epics/. A manual docs deploy from this build will therefore publish broken images/links even though the build command succeeds; include those referenced assets/directories or copy the docs tree more comprehensively.
Useful? React with 👍 / 👎.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
b8af611 to
928d1e5
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 928d1e5d9c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for token in set(re.findall(r"\b[A-Z][A-Z0-9_]{2,}\b", text)): | ||
| if token not in allowed and name_is_denied(token, denied, patterns): | ||
| errors.append(f"{path}: server-only variable-like token {token} appears in {rel}") |
There was a problem hiding this comment.
Exempt Firebase plist keys before gating IPA scans
When the new Codemagic IPA scan runs, the iOS app bundle includes GoogleService-Info.plist as a resource (app/ios/Runner.xcodeproj/project.pbxproj copies it into Runner/GoogleService-Info.plist). A normal Firebase plist contains a public <key>API_KEY</key> entry, but this loop treats the generic API_KEY token as server-only in every non-framework file, so the newly added build/ios/ipa/*.ipa scan will fail valid iOS releases before they can publish. Add explicit allowances for known public Firebase plist keys or skip env-token scanning for those plist files.
Useful? React with 👍 / 👎.
| if value | ||
| and len(value) >= 8 | ||
| and not name.startswith(("PUBLIC_", "NEXT_PUBLIC_")) | ||
| and name_is_denied(name, denied, patterns) |
There was a problem hiding this comment.
Do not scan public SDK keys as CI secrets
In the Android release workflows, INTERCOM_ANDROID_API_KEY is intentionally written into .env and then embedded into BuildConfig for the public Intercom SDK (app/android/app/build.gradle lines 100-101). This comprehension records every non-PUBLIC_ env var matching *_API_KEY as a secret value, ignoring the policy's public-token exceptions, so the new AAB scan will reject the release as soon as that intended public key appears in the bundle. Exclude allowlisted public client tokens from secret_values before using this as a release gate.
Useful? React with 👍 / 👎.
928d1e5 to
e595a97
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e595a97d1f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if token not in allowed and name_is_denied(token, denied, patterns): | ||
| errors.append(f"{path}: server-only variable-like token {token} appears in {rel}") |
There was a problem hiding this comment.
Honor allowed public tokens in artifact token scan
When the Android release scan runs on a real AAB, classes.dex includes the BuildConfig field name INTERCOM_ANDROID_API_KEY from app/android/app/build.gradle:101. Although the policy explicitly allowlists that public SDK token via allowed_public_client_tokens, this token-name scan only checks allowed, so it reports server-only variable-like token INTERCOM_ANDROID_API_KEY and blocks every Android release artifact that contains the existing BuildConfig field. Include allowed_public_tokens in this check, as is already done for raw env values.
Useful? React with 👍 / 👎.
| run: | | ||
| npm ci | ||
| npm run build |
There was a problem hiding this comment.
Provide dummy Firebase env for web app build
For PRs that touch web/app, this new step runs npm run build without any NEXT_PUBLIC_FIREBASE_* values. The web app build script first runs scripts/generate-firebase-sw.js, which exits when those Firebase env vars are missing, so otherwise valid web/app changes will fail lint CI before Next builds. Add dummy env values here like the admin build step does below.
Useful? React with 👍 / 👎.
e595a97 to
0c9c24b
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c9c24b40c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for token in set(re.findall(r"\b[A-Z][A-Z0-9_]{2,}\b", text)): | ||
| if token not in allowed_public_tokens and name_is_denied(token, denied, patterns): | ||
| errors.append(f"{path}: server-only variable-like token {token} appears in {rel}") |
There was a problem hiding this comment.
Allow public API-key placeholders in artifact scans
When an Android AAB contains user-facing placeholder strings such as YOUR_API_KEY (already present in app/lib/models/stt_provider.dart:406 for custom STT templates), this generic token loop treats the placeholder as a denied API_KEY and fails the new Codemagic AAB scan even though no secret leaked. This can block otherwise valid Android release/patch builds; allowlist documented placeholders or restrict this pass to exact server env names/actual secret values.
Useful? React with 👍 / 👎.
0c9c24b to
cf67008
Compare
…8908) ## Summary Removes the six `scan-public-artifact-secrets.py` invocations (and the `AAB_ARTIFACTS` find lines that existed only to feed them) from the iOS/Android prod and shorebird-patch workflows in `codemagic.yaml`. The scanner script, its tests, `client_env_policy.yaml`, and the desktop release guard are untouched. ## Why Every prod mobile build is currently failing on false positives. The variable-like-token heuristic greps ALL-CAPS tokens out of compiled artifacts and matches them against `denied_name_patterns` — and the flagged tokens are all Firebase Auth SDK error constants baked into the statically linked `Runner` executable, plus `P12` in the dSYM `Symbols/*.symbols` files: - `ERROR_INVALID_CREDENTIAL`, `MISSING_APP_CREDENTIAL`, `INVALID_LOGIN_CREDENTIALS`, `MISSING_MFA_PENDING_CREDENTIAL`, `INVALID_MFA_PENDING_CREDENTIAL` → `(^|_)CREDENTIALS?($|_)` - `ERROR_CUSTOM_TOKEN_MISMATCH`, `ERROR_INVALID_CUSTOM_TOKEN`, `MISSING_IOS_APP_TOKEN` → `(^|_)TOKEN($|_)` - `INVALID_PASSWORD` → `(^|_)PASSWORD($|_)`, `API_KEY` → `(^|_)API_KEY($|_)`, `P12` → `(^|_)P12($|_)` The `.framework`/`.xcframework` carve-out from #8741 never covered the main binary or the top-level `Symbols/` directory. This is the second time this scan has broken the mobile release on SDK constant strings (first: `BatteryWidget.appex`, reverted in 7123930; re-landed hours later by #8773). The mobile build steps inject no server env values into the bundle, so scanning compiled Mach-O output for env-var-shaped names is noise by construction — the scanner's real protection (the check for actual CI secret *values*) never fired. cc @Git-on-my-level — if this scan is re-landed a third time, it needs to exclude compiled executables and symbol files from the name-pattern heuristic first (the exact-name and secret-value checks can safely keep running on binaries). ## Validation - `python3 .github/scripts/check-release-process-guards.py` passes (the guard requires `scripts/scan-public-artifact-secrets.py` to exist; it still does) - `codemagic.yaml` parses as valid YAML; zero remaining scanner references; no dangling `AAB_ARTIFACTS` uses 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/8908?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
The variable-like-token heuristic in scan-public-artifact-secrets.py false-positives on every mobile build: Firebase Auth SDK error constants (ERROR_INVALID_CREDENTIAL, INVALID_LOGIN_CREDENTIALS, MISSING_IOS_APP_TOKEN, INVALID_PASSWORD, API_KEY) compiled into the statically linked Runner executable and P12 in the dSYM Symbols/*.symbols files all match the denied_name_patterns in client_env_policy.yaml. The .framework/.xcframework carve-out from BasedHardware#8741 never covered the main binary or top-level Symbols/. This is the second time the scanner has broken the Codemagic mobile release on SDK constant strings (see revert 7123930); PR BasedHardware#8773 re-landed the wiring hours after that revert. The mobile build injects no server env values, so scanning compiled Mach-O output for ALL-CAPS env-var-shaped names yields only noise. Removes the six scan invocations (and the AAB_ARTIFACTS find lines that existed only to feed them) from the iOS/Android prod and shorebird-patch workflows. The scanner script, its tests, and the desktop release guard (which only requires the file to exist) are untouched.
Summary
Validation