Skip to content

refactor: fix types in deploy command and its utils - #8599

Merged
serhalp merged 2 commits into
mainfrom
serhalp/build/fix-deploy-types
Oct 9, 2026
Merged

serhalp merged 2 commits into
mainfrom
serhalp/build/fix-deploy-types

Conversation

@serhalp

@serhalp serhalp commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Replace the $TSFixMe/any parameters and @ts-expect-error markers in the deploy command and src/utils/deploy/ with real types.

Remaining gaps in upstream package types are marked with specific FIXME casts or suppressions.

Runtime behaviour is aggressively unchanged in an effort to keep this PR entirely about fixing/adding types.

Weak type pattern Removed Added Net
any 24 0 -24
$TSFixMe (any) 32 0 -32
@ts-expect-error 45 6 -39
type assertion (as) 14 19 +5
eslint suppressions 273 4 -269

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: f4101271-d52c-476f-98e9-ffa4a3016ffa
📥 Commits

Reviewing files that changed from the base of the PR and between 74f1ee5 and 7ef3169.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 7b5493b5-f1e9-4dcf-9441-d05465f32b28
📥 Commits

Reviewing files that changed from the base of the PR and between e137887 and 74f1ee5.

📒 Files selected for processing (18)
  • eslint-suppressions.json
  • src/commands/deploy/deploy.ts
  • src/lib/spinner.ts
  • src/utils/deploy/deploy-site.ts
  • src/utils/deploy/drop-api.ts
  • src/utils/deploy/file.ts
  • src/utils/deploy/hash-config.ts
  • src/utils/deploy/hash-files.ts
  • src/utils/deploy/hash-fns.ts
  • src/utils/deploy/hasher-segments.ts
  • src/utils/deploy/process-files.ts
  • src/utils/deploy/types.ts
  • src/utils/deploy/upload-files.ts
  • src/utils/deploy/upload-source-zip.ts
  • src/utils/deploy/util.ts
  • tests/unit/utils/deploy/hash-files.test.ts
  • tests/unit/utils/deploy/hash-fns.test.ts
  • tests/unit/utils/deploy/upload-files.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

💤 Files with no reviewable changes (1)
  • tests/unit/utils/deploy/hash-files.test.ts

Included review availability: This review used your included allowance. 9 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour. Your free on-demand review promotion remains active until October 9, 2026 at 6:00 PM UTC.


📝 Summary

Summary by CodeRabbit

  • Improvements
    • Deployment workflows now use clearer, more precise handling of deploy details, files, and upload data.
    • Uploads support in-memory file content alongside files from disk.
    • Deploy progress can be stopped safely when no spinner is available.

Walkthrough

The deploy pipeline now uses more explicit types for configuration, files, API responses, and deploy results. The changes add support for inline upload content, type deploy polling results, and update deploy command handling. ESLint suppression counts are also revised, and related test casts and suppression comments are removed.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Suggested reviewers: ndhoule

Merge Risk: ⚪ Minimal · up to 74f1e

The deploy typing changes appear ready to merge after normal checks; no concrete deployment regression remains identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
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 1…
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 and concisely describes the main change: replacing weak types in the deploy command and related utilities.
Description check ✅ Passed The description directly explains the typing refactor, removed weak-type patterns, remaining suppressions, and intended unchanged runtime behavior.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

📊 Benchmark results

Comparing with 7c3b5c2

  • Dependency count: 1,019 (no change)
  • Package size: 380 MB (no change)
  • Number of ts-expect-error directives: 280 ⬇️ 13.93% decrease vs. 7c3b5c2

@pkg-pr-new

pkg-pr-new Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/netlify-cli@8599

commit: 7ef3169

@serhalp
serhalp force-pushed the serhalp/build/fix-deploy-types branch from 84e611d to fa00059 Compare October 8, 2026 18:34
Comment thread src/utils/deploy/util.ts
case 'ready': {
deploy = siteDeploy
return true
return pWaitFor.resolveWith(siteDeploy)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Technically this is an exception to the "no changes to runtime code" rule for this PR, but this is really the same behaviour and it unlocks typing this properly.

Replace the `$TSFixMe`/`any` parameters and `@ts-expect-error` markers in the deploy command and
`src/utils/deploy/` with real types:

Remaining gaps in upstream typings are marked with specific FIXME casts or suppressions. Runtime
behaviour is unchanged.
@serhalp
serhalp force-pushed the serhalp/build/fix-deploy-types branch from fa00059 to 74f1ee5 Compare October 8, 2026 18:39
@serhalp
serhalp marked this pull request as ready for review October 8, 2026 19:17
@serhalp
serhalp requested a review from a team as a code owner October 8, 2026 19:17
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@akardet
akardet self-requested a review October 8, 2026 22:52
@serhalp
serhalp merged commit 31ed36f into main Oct 9, 2026
37 checks passed
@serhalp
serhalp deleted the serhalp/build/fix-deploy-types branch October 9, 2026 12:36
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