fix(deps): clear the high advisories and type the generated clients #1840
<!-- 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&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>
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 -->
<!-- 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>
</details>
<sub>Comment @coderabbitai help to get the list of available commands.</sub>
<!-- tips_end -->
<!-- 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.
/reviewed 414d2eaf612de631333fe678eaa109ba2215f7aa
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.
Approved these changes.
DorianZheng
DefeatMan
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 |
unique symbolthe default response type ofrequest(), socreateRequestFunctionin all three generated TS clients fails declaration emit with TS2527.apps/hack/ts-client/type-request-function.mjsruns after generation in all three clients and returnsPromise<R>, the fix openapi-generator 7.25.0 ships.api-client-driftregeneratesapi-clientandanalytics-api-clientthrough those targets; the step fails once the generator emits the type.Verification
corepack yarn npm audit --severity high --environment productioninapps:mainexit 1, this branch exit 0.bash apps/hack/postprocess.test.shpasses; with the production files reverted tomain, its three new cases fail.🤖 Generated with Claude Code