← Back to Pull requests

fix(deps): clear the high advisories and type the generated clients #1840

Merged
DefeatMan merged 13 files (440 lines) on Oct 08, 2026 15:34 UTC
View on GitHub
DefeatMan DefeatMan commented on Oct 08, 2026 10:38 UTC
Author

TL;DR

Clear the October high advisories that make every image build fail its pre-build audit, and type the generated API clients so the dashboard build survives axios 1.20.

Design doc: https://linear.app/polygala/issue/POL-820/design-upgrade-axios-sharp-shell-quote-and-astrojsnode-past-high

Details

| Package | main | This PR | Advisory |
|---|---|---|---|
| axios | 1.16.1, 1.18.1 | 1.20.0 | GHSA-c29m-xwm3-cm6r and six more |
| sharp | 0.35.4 | 0.35.5 | GHSA-wq5f-xc86-pv6w |
| shell-quote | 1.10.0 | 1.11.0 | GHSA-pqg4-j6r4-53mv, critical |
| @astrojs/node | 11.0.2 | 11.1.6 | GHSA-qh8j-hqjv-7m4x |
| node-forge | 1.4.0 | removed | GHSA-86w9-cpqp-85rv, no fix and no importer |

  • axios 1.19 made an unexported unique symbol the default response type of request(), so createRequestFunction in all three generated TS clients fails declaration emit with TS2527.

  • apps/hack/ts-client/type-request-function.mjs runs after generation in all three clients and returns Promise<R>, the fix openapi-generator 7.25.0 ships. api-client-drift regenerates api-client and analytics-api-client through those targets; the step fails once the generator emits the type.

  • Bumping the generator instead adds about 420 generated lines, a new 503 health model in TS and Go.

  • Documentation: the api-client-drift row now says to regenerate through those targets.
  • Verification

  • corepack yarn npm audit --severity high --environment production in apps: main exit 1, this branch exit 0.

  • The three client builds and the Dockerfile production dashboard build pass; before the step all three clients failed with TS2527.

  • Regenerating with the pinned 7.23.0 reproduces the committed clients. bash apps/hack/postprocess.test.sh passes; with the production files reverted to main, its three new cases fail.
  • 🤖 Generated with Claude Code

    Diff: 440 lines (+240 / -200) across 13 files Reviewer: DorianZheng Review duration: 295m
    All Vouch review confidence checks passed
    Residual risk 0.09 = Change Risk (0.57) × (1 − Review Confidence (0.83)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.57 · 440 lines diff across 13 files
    0.57
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.78 · 3 substantive comment(s)
    0.78
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    83%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.364
    Real PR Conversation Timeline
    6 items
    coderabbitai[bot] coderabbitai[bot] commented on Oct 08, 2026 10:39 UTC
    Bot

    <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
    <!-- review_stack_entry_start -->

    <a href="https://app.coderabbit.ai/change-stack/boxlite-ai/boxlite/pull/1840?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a>

    <!-- review_stack_entry_end -->
    <!-- recent_review_start -->

    No actionable comments were generated in the recent review. 🎉

    <details>
    <summary>ℹ️ Recent review info</summary>

    <details>
    <summary>⚙️ Run configuration</summary>

  • Configuration used: Organization UI

  • Review profile: QUIET

  • Plan: Advanced

  • Run ID: ed1331e5-0ab9-486c-b32e-37c4d62e026e
  • </details>

    <details>
    <summary>📥 Commits</summary>

    Reviewing files that changed from the base of the PR and between cf196e7fec02506ac9d36b7089ac6897e40ffe6c and 414d2eaf612de631333fe678eaa109ba2215f7aa.

    </details>

    <details>
    <summary>⛔ Files ignored due to path filters (1)</summary>

    apps/yarn.lock is excluded by !/yarn.lock, !/.lock

    </details>

    <details>
    <summary>📒 Files selected for processing (12)</summary>

    .github/workflows/README.md
    apps/e2e/bootstrap.sh
    apps/hack/postprocess.test.sh
    apps/hack/ts-client/type-request-function.mjs
    apps/libs/analytics-api-client/project.json
    apps/libs/analytics-api-client/src/common.ts
    apps/libs/api-client/project.json
    apps/libs/api-client/src/common.ts
    apps/libs/runner-api-client/project.json
    apps/libs/runner-api-client/src/common.ts
    apps/nx.json
    apps/package.json

    </details>

    Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

    </details>

    ---

    <!-- recent_review_end -->
    <!-- walkthrough_start -->

    <details>
    <summary>📝 Walkthrough</summary>

    Walkthrough

    The API client generation targets now run a postprocessor that adds explicit Promise<R> return types to generated request callbacks. Three client common.ts files include the annotation and cast. The postprocessor validates its input and has tests for successful updates and already-typed input. The change also updates four dependency versions, removes node-forge and @types/node-forge, and revises related documentation and comments.

    Sequence Diagram(s)

    sequenceDiagram
      participant GenerationTarget
      participant OpenAPIGenerator
      participant TypeRequestFunction
      participant common.ts
      GenerationTarget->>OpenAPIGenerator: Generate API client source
      OpenAPIGenerator->>TypeRequestFunction: Run on generated source directory
      TypeRequestFunction->>common.ts: Add Promise<R> return type and cast
    

    Suggested reviewers: dorianzheng

    </details>

    <!-- walkthrough_end -->
    <!-- change_assessment_start -->
    Priority: ⬆️ High

    <!-- change_assessment_commit:"414d2eaf612de631333fe678eaa109ba2215f7aa" -->
    Change: Bug fix
    <!-- change_assessment_end -->
    <!-- final_review_risk_start -->
    Merge Risk: ⚪ Minimal · up to 414d2
    <!-- final_review_risk_coverage:{"sourceCommitId":"414d2eaf612de631333fe678eaa109ba2215f7aa","coveredCommitId":"414d2eaf612de631333fe678eaa109ba2215f7aa","kind":"reviewed"} -->

    No concrete merge-blocking issue is identified; the change is ready for normal checks.
    <!-- final_review_risk_end -->
    <!-- pre_merge_checks_walkthrough_start -->

    <details>
    <summary>🚥 Pre-merge checks | ✅ 5</summary>

    <details>
    <summary>✅ Passed checks (5 passed)</summary>

    | Check name | Status | Explanation |
    | :------------------------ | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 6… |
    | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
    | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
    | Title check | ✅ Passed | The title clearly summarizes both primary changes: dependency advisory remediation and explicit typing for generated API clients. |
    | Description check | ✅ Passed | The description provides a concise TL;DR, design document link, dependency details, implementation rationale, alternatives, and decisive verification results. It is complete and relevant to the change… |

    </details>

    </details>

    <!-- pre_merge_checks_walkthrough_end -->
    <!-- autopilot:start -->

  • <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autopilot</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

  • <!-- autopilot:end -->
    <!-- tips_start -->

    ---

    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.

    <details>
    <summary>❤️ Share</summary>

  • X

  • Mastodon

  • Reddit

  • LinkedIn
  • </details>

    <sub>Comment @coderabbitai help to get the list of available commands.</sub>

    <!-- tips_end -->

    github-actions[bot] github-actions[bot] commented on Oct 08, 2026 10:39 UTC
    Bot

    <!-- boxlite-agent-tooling:author-review -->

    TL;DR

    The PR author must acknowledge the current diff and description before requesting review.

    Author review acknowledgment

    The PR author acknowledged this commit.

    @DefeatMan: read the current diff and description, then check:

    Does the description accurately explain the mechanism shown in the diff?

    Use the form best suited to the change. Check drafts too, and repeat this review
    after description edits. Post this as a new PR comment:

    /reviewed 414d2eaf612de631333fe678eaa109ba2215f7aa
    

    Unacknowledged PRs are converted to draft. After this check passes, click Ready for review when you want reviews.
    Only a new, unedited comment from the PR author counts. A new commit requires a new acknowledgment.
    This records the author's acknowledgment of the commit, not an automated judgment of the description; maintainer approval is separate.

    DefeatMan DefeatMan commented on Oct 08, 2026 10:41 UTC
    Author

    /reviewed 414d2eaf612de631333fe678eaa109ba2215f7aa

    claude[bot] claude[bot] commented on Oct 08, 2026 10:41 UTC
    Reviewer

    Claude Code Review

    This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

    DorianZheng DorianZheng approved these changes on Oct 08, 2026 15:29 UTC
    Approved Reviewer

    Approved these changes.

    Reviewers
    Assignees
    DefeatMan DefeatMan
    Labels
    risk: low confidence: 83.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 57% (MEDIUM) · Higher = larger blast radius
    57%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 83.5% · Lower = rushed or shallow review
    83.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 9.4% · Safe to merge
    9.4%