Skip to content

fix(deps): patch CI audit vulnerabilities - #2420

Merged
Asherlc merged 9 commits into
mainfrom
Asherlc/ci-job-91765508011
Aug 4, 2026
Merged

Asherlc merged 9 commits into
mainfrom
Asherlc/ci-job-91765508011

Conversation

@Asherlc

@Asherlc Asherlc commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Updated the existing pnpm security overrides for brace-expansion, fast-uri, and ip-address to patched stable versions and regenerated the lockfile.
  • Documented the CI audit findings and local Docker validation evidence.

Validation

pnpm audit --prod --audit-level=high --ignore-registry-errors, pnpm lint, root/server/web TypeScript checks, frozen install, and pnpm test (1,110 files / 16,691 tests) pass.

Summary by Sourcery

Update dependency overrides and lockfile to address newly published security advisories and document the associated CI audit and local validation incidents in the production incident baseline.

Bug Fixes:

  • Resolve CI-blocking high-severity vulnerabilities in brace-expansion, fast-uri, and ip-address by updating workspace overrides and refreshing the lockfile.

Documentation:

  • Extend the production incident baseline document with detailed records of the CI dependency audit failure and local Docker/Redpanda validation issues and mitigations.

Summary by cubic

Patched newly published advisories to keep the CI dependency audit green, aligned Expo SDK 57 by bumping react-native-gesture-handler, and fixed OTA preview by requiring and passing EXPO_APP_ID. Regenerated the lockfile, updated docs and tests, and marked the OTA rollout verified in the incidents log.

  • Dependencies

    • Bumped brace-expansion to 5.0.9.
    • Scoped minimatch@3>brace-expansion to 1.1.18.
    • Bumped fast-uri to 3.1.5.
    • Bumped ip-address to 10.4.0.
    • Bumped react-native-gesture-handler to 3.1.0 (Expo SDK 57 compatibility).
  • Migration

    • Set EXPO_APP_ID in deploy secrets; OTA service requires it via deploy/stack.yml.
    • scripts/validate-deploy-env enforces it; deploy/README.md and tests updated.

Written for commit 04760f9. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • Updated dependency versions to address known security advisories and improve supply-chain safety.
    • Updated the mobile gesture-handling dependency for improved app compatibility.
    • Improved resilience against service restarts and infrastructure resource exhaustion.
    • Added validation for required OTA deployment configuration to prevent misconfigured service starts.
  • Documentation

    • Added production incident baselines documenting symptoms, impact, resolutions, validation steps, and follow-up actions.
    • Documented the required OTA application identifier for mobile deployments.

Copilot AI review requested due to automatic review settings August 4, 2026 02:36
@codereviewbot-ai

Copy link
Copy Markdown

🤖 Review skipped: Repository Owner rate limit exceeded. Free accounts are limited to 3 reviews per 4 hours across all repositories. Upgrade to a paid plan for unlimited reviews.

@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @Asherlc, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sourcery-ai

sourcery-ai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Updates pnpm workspace security overrides to patched versions for three transitive dependencies, regenerates the lockfile, and documents CI dependency-audit and local Docker/Redpanda validation incidents in the production incident baseline.

Sequence diagram for CI dependency audit with updated pnpm security overrides

sequenceDiagram
    actor Developer
    participant GitHubActionsCI as GitHubActionsCI
    participant pnpm as pnpm_audit
    participant Overrides as pnpm_overrides

    Developer->>GitHubActionsCI: push commit
    GitHubActionsCI->>pnpm: pnpm audit --prod --audit-level=high --ignore-registry-errors
    pnpm->>Overrides: apply overrides (brace-expansion, fast-uri, ip-address)

    alt before_override_update
        pnpm-->>GitHubActionsCI: fail on GHSA-rgw5-rvv9-x895 (brace-expansion)
        pnpm-->>GitHubActionsCI: fail on GHSA-7p8r-x3mc-p8w7 (fast-uri)
        pnpm-->>GitHubActionsCI: fail on GHSA-mwp4-54f8-5fhr (ip-address)
    else after_override_update
        Overrides->>Overrides: set brace-expansion 5.0.9
        Overrides->>Overrides: set fast-uri 3.1.5
        Overrides->>Overrides: set ip-address 10.4.0
        pnpm-->>GitHubActionsCI: pass high-severity audit
    end
Loading

File-Level Changes

Change Details Files
Update security overrides to patched dependency versions to satisfy high-severity pnpm audit in CI.
  • Bump brace-expansion override from 5.0.8 to 5.0.9.
  • Bump fast-uri override range to resolve to 3.1.5 instead of 3.1.4.
  • Bump ip-address override from 10.2.0 to 10.4.0.
  • Regenerate pnpm-lock.yaml to match the new override-resolved dependency graph.
pnpm-workspace.yaml
pnpm-lock.yaml
Extend production incident documentation with dependency audit, Docker networking, and Redpanda validation entries for 2026-08-03.
  • Add a dependency-audit incident documenting new brace-expansion and fast-uri advisories and their override-based remediation.
  • Add an incident documenting shared Docker network pool exhaustion impacting local lint/test validation and distinguishing CI vs local behavior.
  • Add an incident documenting a local Redpanda restart loop caused by AIO limits and its impact on Vitest, plus the mitigation used.
  • Add a dependency-audit incident documenting an additional ip-address advisory and its override-based remediation.
docs/production-incident-baseline.md

Possibly linked issues

  • #unknown: PR updates overrides for brace-expansion, shell-quote, axios, ip-address so pnpm high-severity production audit passes and blocks CI.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Patch pnpm overrides to clear CI security audit

🐞 Bug fix ⚙️ Configuration changes 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Bump pnpm security overrides to patched versions for recent high-severity advisories.
• Regenerate the frozen pnpm lockfile so production audit passes again.
• Record CI audit failure and local Docker/Redpanda validation incidents in the baseline log.
Diagram

graph TD
  A(["CI Dependency Audit blocked"]) --> B["Update pnpm overrides"] --> C["Regenerate pnpm-lock"] --> D["Patched transitive deps"] --> E(["CI audit green"]) --> F["Incident baseline entry"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Temporarily relax the audit gate (ignore/allowlist)
  • ➕ Unblocks CI immediately if no patched versions exist yet
  • ➕ Reduces churn from newly published advisories
  • ➖ Leaves known vulnerabilities in the production graph
  • ➖ Creates policy debt and potential for permanent exceptions
2. Automate advisory bumps via Renovate/Dependabot + pnpm overrides
  • ➕ Reduces time-to-fix for newly published advisories
  • ➕ Standardizes the response process with less manual lockfile work
  • ➖ More PR volume/noise
  • ➖ Still requires human review when overrides are needed for transitive chains
3. Use pnpm patching (patchedDependencies) instead of version bumps
  • ➕ Useful when upstream has no release but a small patch exists
  • ➕ Keeps dependency version stable while addressing a specific issue
  • ➖ Higher maintenance burden (patch drift)
  • ➖ Less transparent than bumping to an upstream patched release

Recommendation: The chosen approach (bump overrides to upstream patched releases and regenerate the lockfile) is the best default because it removes the vulnerabilities without weakening the CI policy. Consider adding automated dependency tooling if audit breaks from newly published advisories become frequent, but avoid allowlisting high-severity findings except as a short, time-boxed emergency measure.

Files changed (3) +125 / -22

Bug fix (1) +20 / -19
pnpm-lock.yamlRegenerate lockfile with patched override resolutions +20/-19

Regenerate lockfile with patched override resolutions

• Updates override resolutions and lockfile package entries to move brace-expansion to 5.0.9, fast-uri to 3.1.5, and ip-address to 10.4.0, including corresponding snapshot dependency edges. Also includes incidental metadata churn from lockfile regeneration (e.g., added deprecation note on cron-parser@4.9.0).

pnpm-lock.yaml

Documentation (1) +102 / -0
production-incident-baseline.mdDocument CI audit break and local Docker/Redpanda validation issues +102/-0

Document CI audit break and local Docker/Redpanda validation issues

• Appends incident entries covering the CI dependency audit failures (brace-expansion, fast-uri, ip-address) and the local validation blockers related to Docker network pool exhaustion and a Redpanda restart loop. Captures evidence links, root causes, mitigations, and follow-up actions.

docs/production-incident-baseline.md

Other (1) +3 / -3
pnpm-workspace.yamlBump security overrides for brace-expansion, fast-uri, and ip-address +3/-3

Bump security overrides for brace-expansion, fast-uri, and ip-address

• Updates workspace pnpm overrides to the patched versions required to clear high-severity advisories, including tightening the fast-uri range mapping to the fixed release. Keeps the existing override-based mitigation strategy (no audit ignores).

pnpm-workspace.yaml

@qodo-code-review

qodo-code-review Bot commented Aug 4, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 152 rules

Grey Divider


Remediation recommended

1. Uncited Docker address-pool claim ✓ Resolved 📘 Rule violation § Compliance
Description
The new incident entry states Docker exhausted its automatic address pools without an adjacent
primary-source citation. This violates the documentation requirement to cite third-party platform
behavior claims with official sources.
Code

docs/production-incident-baseline.md[R22471-22473]

+- **Root cause:** The shared Docker daemon had exhausted its automatic
+  user-defined bridge-network address pools before it could create this
+  workspace's isolated Compose network.
Relevance

●●● Strong

Team consistently enforces adjacent primary-source citations for third‑party behavior claims in
docs/ incident entries.

PR-#2326
PR-#2319
PR-#1677

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 1505719 requires added/modified third-party behavior claims in docs/ to be
accompanied by an adjacent primary-source citation. The added Root cause bullet describes Docker's
address-pool exhaustion behavior but includes no nearby official link.

Rule 1505719: Cite third-party behavior claims in docs with primary sources
docs/production-incident-baseline.md[22471-22473]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
In `docs/production-incident-baseline.md`, a newly added sentence describes Docker's behavior (exhausted automatic user-defined bridge-network address pools) without an adjacent hyperlink/reference to an official/primary source.

## Issue Context
The compliance rule requires third-party behavior claims in `docs/` files to include an adjacent citation (same paragraph or immediately following line) to an official source.

## Fix Focus Areas
- docs/production-incident-baseline.md[22471-22473]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

2. Docs include real GitHub username 📘 Rule violation ⛨ Security
Description
The updated incident baseline includes GitHub URLs with a real username (Asherlc) instead of using
placeholders or anonymized references. This can leak real identities in documentation, violating the
placeholder-only requirement for sensitive-looking values.
Code

docs/production-incident-baseline.md[22431]

+- **Symptoms:** [CI run 30837222551](https://github.com/Asherlc/dofek/actions/runs/30837222551), job [91765508011](https://github.com/Asherlc/dofek/actions/runs/30837222551/job/91765508011), failed in `Test / Dependency Audit`.
Relevance

● Weak

Docs routinely link to github.com/Asherlc/dofek; reviewers accepted these real-username URLs in
incident baseline entries.

PR-#2038
PR-#1953
PR-#1394

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 722016 requires documentation to avoid real secrets and real identities, and to use
placeholders instead. The added docs line contains GitHub URLs embedding the real username
Asherlc, which is not a placeholder.

Rule 722016: Prohibit real secrets in documentation; require placeholders
docs/production-incident-baseline.md[22431-22431]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A documentation update includes GitHub links containing a real username (`Asherlc`). The compliance rule requires placeholders/anonymized values in docs rather than real identities.

## Issue Context
The line added to `docs/production-incident-baseline.md` links to CI runs using `https://github.com/Asherlc/dofek/...`, which includes a real username.

## Fix Focus Areas
- docs/production-incident-baseline.md[22431-22431]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment thread docs/production-incident-baseline.md Outdated
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The workspace now applies updated dependency overrides, the mobile app uses react-native-gesture-handler 3.1.0, and OTA deployment requires EXPO_APP_ID. The production incident baseline records seven incidents and their remediation or validation results.

Changes

Production baseline and deployment fixes

Layer / File(s) Summary
Dependency remediation and incident records
pnpm-workspace.yaml, docs/production-incident-baseline.md
Updated brace-expansion, fast-uri, and ip-address overrides. Documented dependency audits, Docker network exhaustion, Redpanda restart loops, and upload-server test results.
Mobile gesture-handler update
packages/mobile/package.json, docs/production-incident-baseline.md
Upgraded react-native-gesture-handler from 2.32.0 to 3.1.0 and recorded compatibility validation.
OTA environment enforcement
scripts/validate-deploy-env.ts, scripts/validate-deploy-env.test.ts, deploy/stack.yml, deploy/README.md, docs/production-incident-baseline.md
Required EXPO_APP_ID in deployment validation and the OTA service. Added missing-key test coverage and deployment documentation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • Asherlc/dofek#2291: Updates the same react-native-gesture-handler dependency from 2.32.0 to 3.1.0.

Suggested labels: area/mobile, area/infra, type/bug, breaking-change

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses an imperative verb, stays under 70 characters, has no trailing punctuation, and accurately describes the dependency vulnerability fixes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Storybook previews for 4354ec89 are ready:

This comment updates automatically on each PR push.

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/production-incident-baseline.md`:
- Around line 22513-22518: Update the production incident entry before the Root
cause section to include the exact audit command used and the first fatal output
line reported for GHSA-mwp4-54f8-5fhr. Preserve the existing Symptoms and Root
cause details, and ensure the added evidence is specific enough for another
reviewer to reproduce the failure.
- Around line 22432-22433: Update the User impact statement in the incident
baseline to use “No production impact was observed,” unless traceable production
deployment or release-check evidence is added to verify that no affected
artifact reached production.

In `@pnpm-workspace.yaml`:
- Line 45: Update the pnpm override for brace-expansion so it is scoped by
compatible dependency path and major version: upgrade minimatch where possible,
while pinning lerna>minimatch to a patched brace-expansion 1.x release instead
of forcing 5.0.9 onto minimatch@3.1.4.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c4e91160-0178-482d-a712-2de3cb55f20e

📥 Commits

Reviewing files that changed from the base of the PR and between 6e0c9c6 and 9fe369d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • docs/production-incident-baseline.md
  • pnpm-workspace.yaml

Comment thread docs/production-incident-baseline.md Outdated
Comment thread docs/production-incident-baseline.md
Comment thread pnpm-workspace.yaml
@codereviewbot-ai

Copy link
Copy Markdown

🤖 Review skipped: Repository Owner rate limit exceeded. Free accounts are limited to 3 reviews per 4 hours across all repositories. Upgrade to a paid plan for unlimited reviews.

@codereviewbot-ai

Copy link
Copy Markdown

🤖 Review skipped: Repository Owner rate limit exceeded. Free accounts are limited to 3 reviews per 4 hours across all repositories. Upgrade to a paid plan for unlimited reviews.

@codereviewbot-ai

Copy link
Copy Markdown

🤖 Review skipped: Repository Owner rate limit exceeded. Free accounts are limited to 3 reviews per 4 hours across all repositories. Upgrade to a paid plan for unlimited reviews.

@codereviewbot-ai

Copy link
Copy Markdown

🤖 Review skipped: Repository Owner rate limit exceeded. Free accounts are limited to 3 reviews per 4 hours across all repositories. Upgrade to a paid plan for unlimited reviews.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Mobile Preview

Scan to open on device:

QR code for dofek://preview/pr-2420

Channel pr-2420
Deep Link dofek://preview/pr-2420
Commit 4354ec8

To test on device:

  1. Build and install the preview client: PREVIEW_CHANNEL=pr-2420 pnpm expo prebuild --clean -p ios
  2. Or tap deep link on an existing preview build: dofek://preview/pr-2420

Each PR gets its own channel. Build a preview client with PREVIEW_CHANNEL=pr-{N} to test.

@codereviewbot-ai

Copy link
Copy Markdown

🤖 Review skipped: Repository Owner rate limit exceeded. Free accounts are limited to 3 reviews per 4 hours across all repositories. Upgrade to a paid plan for unlimited reviews.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/production-incident-baseline.md`:
- Around line 22571-22572: Update the active-session impact statement in the
incident entry to cite the specific read-only checks, run identifier, or
health/metrics evidence and summarize their result; if no traceable evidence is
available, replace the definitive claim with wording that limits it to what was
verified in the available checks.

In `@scripts/validate-deploy-env.test.ts`:
- Around line 56-58: Update the missing-key fixture setup in the test using
validEnvironment so it remains type-safe under strict TypeScript: make the
fixture type allow optional environment keys, or assign undefined instead of
deleting required properties. Preserve the test’s behavior of validating a
missing EXPO_APP_ID.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9d5eb8d3-f187-4b7b-b06c-11fde6b0a7de

📥 Commits

Reviewing files that changed from the base of the PR and between 9fe369d and 2ab2264.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • deploy/README.md
  • deploy/stack.yml
  • docs/production-incident-baseline.md
  • packages/mobile/package.json
  • pnpm-workspace.yaml
  • scripts/validate-deploy-env.test.ts
  • scripts/validate-deploy-env.ts

Comment thread docs/production-incident-baseline.md Outdated
Comment thread scripts/validate-deploy-env.test.ts Outdated
@codereviewbot-ai

codereviewbot-ai Bot commented Aug 4, 2026

Copy link
Copy Markdown

LGTM! The addition of EXPO_APP_ID to validate-deploy-env.ts and the corresponding unit test in validate-deploy-env.test.ts are clean, correct, and well-tested.


🤖 Reviewed by codereviewbot.ai - Catch bugs before your team does.

@Asherlc
Asherlc enabled auto-merge (squash) August 4, 2026 04:31
@Asherlc
Asherlc merged commit f18811a into main Aug 4, 2026
105 checks passed
@Asherlc
Asherlc deleted the Asherlc/ci-job-91765508011 branch August 4, 2026 04:34
Asherlc pushed a commit that referenced this pull request Aug 4, 2026
Expo's published SDK 57 native-modules map now expects
react-native-gesture-handler ~2.32.0, reversing the ~3.1.0 requirement
that motivated yesterday's bump in PR #2420. `pnpm expo install --check`
validates against Expo's live version map rather than anything in the
repo, so it now fails on main's head too, with the exact same
dependency set that passed CI this morning.

Root cause: expo, expo-linking, expo-modules-core, expo-router, and
expo-updates patch versions and react-native-gesture-handler's expected
range all changed upstream between this morning's green run and now.

Fix: bump the five expo packages to their now-expected patch versions
and revert react-native-gesture-handler to 2.32.0, matching
https://api.expo.dev/v2/sdks/57.0.0/native-modules. Verified locally
with `pnpm expo install --check` (passes) and `pnpm test:mobile`
(176 files, 1476 tests pass).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvC38Y81GUpfMTy2a9YkCu
Asherlc added a commit that referenced this pull request Aug 4, 2026
* fix(clickhouse): repair stale canonical activity type views

ClickHouse stores the query text a view is created with, and
`standardViewHeader()` emits `CREATE VIEW IF NOT EXISTS`. Migration 0069
renamed `activity_type` to `canonical_type` on `postgres_fitness.activity`
and the analytics serving tables while PR #2416 updated the matching view
bodies, but neither view was dropped first, so the recreate was a no-op
against the existing production objects. `analytics.activity_summary` and
`analytics.v_activity` kept selecting a column that no longer exists, and
every server read of the summary view failed with UNKNOWN_IDENTIFIER.

Migration 0071 drops and recreates the three affected views from the
current builders. It then backfills the `provider_type` and `modality`
columns that 0069 added without values: the dbt models that own those
tables pick dirty keys from `_peerdb_synced_at`, which a mutation does not
advance, so historical rows would have stayed null indefinitely. The
backfill copies provenance from the replicated activity rows through a
temporary Join-engine lookup and `joinGet`, bounded to live rows that are
still missing it, and drops the lookup when it finishes.

Extracts the duplicated column-existence probe into a shared
`hasClickHouseColumn` helper and the migration test client into a local
`test-helpers.ts`.

Fixes DOFEK-SERVER-53

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MeXWX6Z7h5uWtVByYo26zd

* test(clickhouse): name the missing-replica activity fixture in words

cspell rejected "unreplicated". Rename the fixture and its assertion to
describe the same case with dictionary words rather than widening the
project dictionary for one coined term.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MeXWX6Z7h5uWtVByYo26zd

* refactor(clickhouse): validate column introspection rows with zod

Parse the system.columns response with a Zod schema instead of trusting a
TypeScript interface across the ClickHouse runtime boundary. The count comes
back as a string for 64-bit integers, so the schema admits both.

Also records why provider_type alone marks a row as un-backfilled: a null
modality is a legitimate resting state for many canonical types, so widening
the filter would rewrite correct rows on every run without converging.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MeXWX6Z7h5uWtVByYo26zd

* fix(deps): clear high advisories and align the mobile gesture peer

Both checks failed on the base branch and tripped fail-fast, cancelling the
unit, integration, and E2E jobs, so nothing in this PR was being exercised by
CI.

pnpm audit --prod --audit-level=high reported three high advisories, all in
transitive dependencies the workspace already pins. Advance those pins to the
patched releases rather than lowering the audit level: brace-expansion to
5.0.9 (GHSA-rgw5-rvv9-x895), fast-uri to 3.1.5 (GHSA-7p8r-x3mc-p8w7), and
ip-address to 10.4.0 (GHSA-mwp4-54f8-5fhr). The fast-uri selector moves with
its advisory range, and staying inside each existing major keeps the parents'
ranges satisfied.

expo install --check required react-native-gesture-handler ~3.1.0 against a
2.32.0 pin. No workspace source imports the package — it is a peer of
expo-router and react-navigation — so the major bump carries no API surface
of ours.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MeXWX6Z7h5uWtVByYo26zd

* docs(incident): record the OTA healthcheck outage as unresolved

Adds the two CI failures fixed alongside this change, including the pnpm 10+
detail that overrides live in pnpm-workspace.yaml rather than package.json,
and records the Publish Mobile Preview OTA healthcheck 404 as an unresolved
production service state rather than omitting it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MeXWX6Z7h5uWtVByYo26zd

* fix(deploy): pass EXPO_APP_ID to the OTA update service

expo-open-ota reads EXPO_APP_ID at startup and logs "EXPO_APP_ID not set"
without it, leaving dofek_ota at 0/1 so ota.dofek.asherlc.com/hc answers 404
and the preview publish workflow fails its healthcheck before reaching
eoas publish.

The variable was already present in Infisical, but the ota service in
deploy/stack.yml never referenced ${EXPO_APP_ID}, so it was never interpolated
into the container. The dotenv template renders every secret at the project
root and docker stack deploy runs with that dotenv loaded, so naming the
variable is all that was missing.

Also adds EXPO_APP_ID to REQUIRED_DEPLOY_KEYS so an absent value fails the
deploy with a named key rather than surfacing later as a healthcheck 404,
closing the fail-fast follow-up left open by the earlier staging incident.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MeXWX6Z7h5uWtVByYo26zd

* fix(mobile): align Expo SDK 57 dependency pins

Expo's published SDK 57 native-modules map now expects
react-native-gesture-handler ~2.32.0, reversing the ~3.1.0 requirement
that motivated yesterday's bump in PR #2420. `pnpm expo install --check`
validates against Expo's live version map rather than anything in the
repo, so it now fails on main's head too, with the exact same
dependency set that passed CI this morning.

Root cause: expo, expo-linking, expo-modules-core, expo-router, and
expo-updates patch versions and react-native-gesture-handler's expected
range all changed upstream between this morning's green run and now.

Fix: bump the five expo packages to their now-expected patch versions
and revert react-native-gesture-handler to 2.32.0, matching
https://api.expo.dev/v2/sdks/57.0.0/native-modules. Verified locally
with `pnpm expo install --check` (passes) and `pnpm test:mobile`
(176 files, 1476 tests pass).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvC38Y81GUpfMTy2a9YkCu

* docs(incident): disambiguate the fail-fast CI failure count

CodeRabbit flagged that "Two CI failures" read ambiguously against
the separately-described OTA workflow failure later in the same
entry. Scope the count to what it actually describes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvC38Y81GUpfMTy2a9YkCu

* fix(deploy): fail closed on the OTA JWT and signing key secrets

CodeRabbit flagged that OTA_JWT_SECRET, OTA_PRIVATE_KEY_B64, and
OTA_PUBLIC_KEY_B64 rendered as empty strings rather than failing the
deploy when absent. This was previously declined pending confirmation
that all three are actually populated in Infisical -- the repository
owner has now confirmed that.

Add :? guards to the three interpolations in deploy/stack.yml and add
them to REQUIRED_DEPLOY_KEYS in scripts/validate-deploy-env.ts, so a
missing value fails the deploy with a named key instead of starting
the OTA container misconfigured.

Validated: `docker stack config -c deploy/stack.yml` renders the ota
service correctly with all three vars set, and fails with a named
"OTA_JWT_SECRET is required" error when one is unset. Unit tests pass
(7/7 in validate-deploy-env.test.ts). tsc --noEmit clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvC38Y81GUpfMTy2a9YkCu

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants