Skip to content

Add release process guardrails - #8773

Merged
Git-on-my-level merged 1 commit into
mainfrom
codex/release-process-guards
Jul 1, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
codex/release-process-guards

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add a release-process guard script and wire it into lint CI and pre-push
  • fail desktop releases on missing Sparkle EdDSA signatures and use VERSION for the Firestore bridge release record
  • add mobile public artifact secret scanning for IPA/AAB outputs, plus scanner policy/tests
  • add CI/pre-push checks for docs build scripts, Python CLI dynamic versioning, React Native podspec tags, desktop agent runtime packaging, Flutter generated output, and backend runtime workflow alignment

Validation

  • python3 .github/scripts/check-release-process-guards.py
  • python3 scripts/check-public-client-secrets.py
  • python3 scripts/test-public-secret-scanners.py
  • bash scripts/test-scan-public-artifact-secrets.sh
  • python3 -m py_compile .github/scripts/check-release-process-guards.py scripts/check-public-client-secrets.py scripts/scan-public-artifact-secrets.py
  • actionlint -shellcheck '\ .github/workflows/lint.yml
  • python3 backend/scripts/validate-backend-runtime-env.py --env dev --check-workflows
  • python3 backend/scripts/validate-backend-runtime-env.py --env prod --check-workflows
  • npm --prefix docs run build
  • desktop/macos/scripts/test-tool-surfaces.sh
  • scripts/pre-push origin main

Review in cubic

@Git-on-my-level

Copy link
Copy Markdown
Member Author

@codex review

@mintlify

mintlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
deepeninc 🟡 Building – Jul 1, 2026, 8:23 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

5 issues found across 16 files

Confidence score: 3/5

  • The biggest risk is in desktop/macos/scripts/test-tool-surfaces.sh: select_node22 can accept Node 22 versions below 22.6, so runs may pass the guard but fail when --experimental-strip-types is used, causing avoidable CI/test breakage — tighten the check to require >=22.6.0 before 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.py and scripts/create-public-client-env.sh, .asar handling and raw emit() output can create false scan failures and malformed .client.env files 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

Comment thread scripts/scan-public-artifact-secrets.py Resolved
Comment thread scripts/scan-public-artifact-secrets.py Resolved
Comment thread scripts/create-public-client-env.sh Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread scripts/scan-public-artifact-secrets.py Outdated
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"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread docs/package.json Outdated
@@ -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/"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@mintlify

mintlify Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Jul 1, 2026, 8:37 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@Git-on-my-level

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +265 to +267
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}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment on lines +193 to +196
if value
and len(value) >= 8
and not name.startswith(("PUBLIC_", "NEXT_PUBLIC_"))
and name_is_denied(name, denied, patterns)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@Git-on-my-level
Git-on-my-level force-pushed the codex/release-process-guards branch from 928d1e5 to e595a97 Compare July 1, 2026 20:53
@Git-on-my-level

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread scripts/scan-public-artifact-secrets.py Outdated
Comment on lines +272 to +273
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}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment on lines +294 to +296
run: |
npm ci
npm run build

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@Git-on-my-level
Git-on-my-level force-pushed the codex/release-process-guards branch from e595a97 to 0c9c24b Compare July 1, 2026 21:31
@Git-on-my-level

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +275 to +277
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}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@Git-on-my-level
Git-on-my-level force-pushed the codex/release-process-guards branch from 0c9c24b to cf67008 Compare July 1, 2026 22:15
@Git-on-my-level
Git-on-my-level merged commit ad3b7e3 into main Jul 1, 2026
2 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/release-process-guards branch July 1, 2026 22:21
mdmohsin7 added a commit that referenced this pull request Jul 3, 2026
…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. -->
pull Bot pushed a commit to codingwatching/omi that referenced this pull request Jul 3, 2026
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.

This branch was successfully deployed

1 active deployment
staging - docs — cf67008b Deployed Jul 1, 2026 by mintlify[bot]
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.

1 participant