Skip to content

chore(husky): refuse a push whose own packages fail check-types - #1781

Merged
mobeenabdullah merged 2 commits into
mainfrom
fix/pre-push-blocks-on-own-type-errors
Sep 11, 2026
Merged

mobeenabdullah merged 2 commits into
mainfrom
fix/pre-push-blocks-on-own-type-errors

Conversation

@mobeenabdullah

@mobeenabdullah mobeenabdullah commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

What

The pre-push hook runs the repo-wide check-types and, by design, only prints a NOTE when it fails: the whole-repo scope can be red for a package the author never touched, and a hook that refuses over someone else's breakage teaches --no-verify.

That stays. What changes: the packages the push AFFECTS are held to check-types with a re-run that replays from turbo's cache and costs seconds. "Affects" is the packages scripts/gate-scope.mjs derives from the diff (the same scope the test gate uses) plus every package that depends on them (--filter=...<pkg>), with --only so their unchanged dependencies stay out of the verdict. A type error there is refused; one outside stays a note.

Root package.json and pnpm-lock.yaml join gate-scope's graph-wide set beside pnpm-workspace.yaml and turbo.jsonc: a dependency change cannot be attributed to a package, so both the test gate and the type verdict run unfiltered for it (exit 2). Root paths only; a workspace's own manifest scopes to that workspace.

Turbo's --affected was tried first and measured: it reads any root-level change, scripts/ included, as touching all 27 packages, which would refuse a scripts-only push over a red in a package it never reached. The derived filters do not.

Why now

#1754 merged with an implicit any in a test file. The hook printed the error as a note; CI, which blocks on it, could not report because its queue cannot drain (#1778). main has been red on check-types since (#1780 fixes the line). A gate whose only enforcement was elsewhere had no enforcement that day.

Verified

The block was run directly against the real turbo task with main's current nextly error present: a push scoped to @nextlyhq/plugin-seo runs 1 package and continues with the note (its unchanged dependency's red does not block); a push scoped to @nextlyhq/blocks-engine runs 14 packages, reaches nextly as a dependent, and is refused; no package touched notes and continues; graph redefined and red refuses; types green is silent. This branch's own pushes exercised the note path live, once with .husky alone and once with scripts/ changed.

CI-only, no changeset.

The repo-wide typecheck stays advisory, since it can be red for a package
the author never touched. The packages the push changes are now held to it
with a cached filtered re-run, so a type error the push carries is refused
here rather than printed as a note and left for CI.
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 9b301bd2-04de-456b-b217-380e1375695f

📥 Commits

Reviewing files that changed from the base of the PR and between ae9e600 and 5796886.

📒 Files selected for processing (3)
  • .husky/pre-push
  • scripts/gate-scope.mjs
  • scripts/gate-scope.test.mjs

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.

@mobeenabdullah

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T11:01:59.460684Z 5796886 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 49f3e3c440

ℹ️ 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 .husky/pre-push Outdated
Comment thread .husky/pre-push Outdated
Comment thread .husky/pre-push Outdated
The blocking typecheck now runs on the packages gate-scope derives plus
every package that depends on them, with --only so an unchanged
dependency's red stays a note. The root manifest and the lockfile join
gate-scope's graph-wide set, so a dependency change is judged unfiltered
like a workspace-list change.
@mobeenabdullah

Copy link
Copy Markdown
Collaborator 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: 5796886e06

ℹ️ 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 .husky/pre-push
@mobeenabdullah

Copy link
Copy Markdown
Collaborator Author

Next revision is committed locally (turbo --affected --only; see the thread reply). Its push is refused by its own hook while main's nextly typecheck is red, so it lands right after #1780 merges.

@github-actions

Copy link
Copy Markdown
Contributor

Whole-Repository Code Hygiene Summary

Full dead-code, duplication, and complexity report for the PR branch as it stands now. Playground is excluded. Quality gate enforcement on introduced issues is performed by the Changed files job.

🌿 Fallow

Warning

Review needed

⚠️ 73 code issues · ⚠️ 694 clone groups · ⚠️ 1044 health findings

See inline review comments for per-finding details.

Code issues (73)
Category Count
Unused files 2
Unused exports 5
Unused dependencies 19
Unused devDependencies 6
Unresolved imports 2
Unlisted dependencies 1
Circular dependencies 38
Duplication (694 groups · 29077 lines · 4.1%)
Locations Lines Tokens
schemas/_dialect-bundles/mysql.relations.ts:40-134
schemas/_dialect-bundles/postgres.relations.ts:40-134
schemas/_dialect-bundles/sqlite.relations.ts:40-134
95 593
cli/commands/db-sync-demote.ts:70-75
cli/commands/db-sync-promote.ts:38-43
cli/commands/dev-build.ts:100-105
cli/commands/dev-build.ts:179-184
cli/commands/dev-build.ts:299-304
cli/commands/dev-build.ts:411-416
cli/commands/dev-build.ts:552-557
cli/commands/dev-server.ts:575-580
cli/commands/dev-server.ts:840-845
cli/commands/dev-server.ts:1143-1148
cli/commands/migrate-field-groups.ts:110-115
6 70
entries/EntryList/EntryTableSkeleton.tsx:74-98
collection/components/CollectionTableSkeleton.tsx:94-118
field-group/components/FieldGroupTableSkeleton.tsx:90-114
plugins/components/PluginsTableSkeleton.tsx:86-110
singles/components/SinglesTableSkeleton.tsx:77-101
src/components/table-skeleton.tsx:100-124
25 89
collections/config/validate-config.ts:380-433
field-groups/config/validate-field-group.ts:185-238
singles/config/validate-single.ts:190-243
54 152
dispatcher/handlers/collection-dispatcher.ts:922-964
field-groups/services/field-group-table-provisioning.ts:186-236
singles/services/reconcile-single-companion.ts:110-160
51 149

… and 689 more groups.

Across 423 files.

Complexity (1044 functions above threshold)
File Function Severity Cyclomatic Cognitive CRAP Lines
singles/services/single-mutation-service.ts:981 <arrow> critical 251 ! 324 ! 13859.2 ! 1625
collections/services/collection-mutation-service.ts:6209 <arrow> critical 174 ! 177 ! 6713.6 ! 1301
src/init/reload-config.ts:1319 applyReload critical 144 ! 228 ! 4623 ! 1433
shared/lib/entry-validation.ts:223 validateFieldValue critical 109 ! 157 ! 2675.3 ! 432
blocks-engine/src/measure-bytes.ts:646 surveyDocument critical 102 ! 250 ! 137.1 ! 658

4995 files, 76425 functions analyzed (thresholds: cyclomatic > 20, cognitive > 15, CRAP >= 30)

Codebase health

Metric Value
Maintainability 91.7 / 100
Avg complexity 1.8

Tip

Run fallow fix --dry-run to preview auto-fixes.
Add /** @public */ above exports to preserve them.

@pkg-pr-new

pkg-pr-new Bot commented Sep 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

@nextlyhq/adapter-drizzle

npm i https://pkg.pr.new/@nextlyhq/adapter-drizzle@5796886

@nextlyhq/adapter-mysql

npm i https://pkg.pr.new/@nextlyhq/adapter-mysql@5796886

@nextlyhq/adapter-postgres

npm i https://pkg.pr.new/@nextlyhq/adapter-postgres@5796886

@nextlyhq/adapter-sqlite

npm i https://pkg.pr.new/@nextlyhq/adapter-sqlite@5796886

@nextlyhq/admin

npm i https://pkg.pr.new/@nextlyhq/admin@5796886

@nextlyhq/admin-css

npm i https://pkg.pr.new/@nextlyhq/admin-css@5796886

@nextlyhq/blocks-engine

npm i https://pkg.pr.new/@nextlyhq/blocks-engine@5796886

@nextlyhq/blocks-react

npm i https://pkg.pr.new/@nextlyhq/blocks-react@5796886

@nextlyhq/builder

npm i https://pkg.pr.new/@nextlyhq/builder@5796886

create-nextly-app

npm i https://pkg.pr.new/create-nextly-app@5796886

@nextlyhq/eslint-plugin

npm i https://pkg.pr.new/@nextlyhq/eslint-plugin@5796886

nextly

npm i https://pkg.pr.new/nextly@5796886

@nextlyhq/plugin-form-builder

npm i https://pkg.pr.new/@nextlyhq/plugin-form-builder@5796886

@nextlyhq/plugin-page-builder

npm i https://pkg.pr.new/@nextlyhq/plugin-page-builder@5796886

@nextlyhq/plugin-sdk

npm i https://pkg.pr.new/@nextlyhq/plugin-sdk@5796886

@nextlyhq/plugin-seo

npm i https://pkg.pr.new/@nextlyhq/plugin-seo@5796886

@nextlyhq/storage-s3

npm i https://pkg.pr.new/@nextlyhq/storage-s3@5796886

@nextlyhq/storage-uploadthing

npm i https://pkg.pr.new/@nextlyhq/storage-uploadthing@5796886

@nextlyhq/storage-vercel-blob

npm i https://pkg.pr.new/@nextlyhq/storage-vercel-blob@5796886

@nextlyhq/ui

npm i https://pkg.pr.new/@nextlyhq/ui@5796886

commit: 5796886

@mobeenabdullah
mobeenabdullah merged commit 9d723ab into main Sep 11, 2026
23 of 25 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

PR title fails Conventional Commits check

Unknown scope "husky" found in pull request title "chore(husky): refuse a push whose own packages fail check-types". Scope must match one of: nextly, admin, admin-css, client, ui, adapter-postgres, adapter-mysql, adapter-sqlite, adapter-drizzle, storage-s3, storage-vercel-blob, storage-uploadthing, blocks-engine, blocks-react, builder, plugin-form-builder, plugin-page-builder, plugin-seo, plugin-sdk, create-nextly-app, eslint-config, eslint-plugin, module-specifiers, prettier-config, tsconfig, telemetry, playground, root, ci, docs, deps, release.

Examples of valid titles:

  • feat(admin): add role manager dialog
  • fix(adapter-postgres): handle connection pool exhaustion
  • chore(deps): bump zod to 4.2.0

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