Skip to content

ci: gate main on type-check, lint and tests and repair the type error it caught - #70

Closed
polylane[bot] wants to merge 2 commits into
mainfrom
polylane/autofix/l7un4lvgj43a
Closed

polylane[bot] wants to merge 2 commits into
mainfrom
polylane/autofix/l7un4lvgj43a

Conversation

@polylane

@polylane polylane Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Fixes: cache-app main deploys to production with no CI gate and no automated Prisma migration step

The gate this pull request adds failed on its first run because the repository did not type-check: the note renderer referenced a rich-text node type that the Lexical upgrade no longer declares with a type parameter, and four type errors stopped the workflow. No product behavior was affected, but the new check could not pass. With the type corrected the gate is green, and the Node setup step now uses the current action major instead of a runtime the runner marks deprecated.

What caused this

Affected: acc_0b563dc42001x121b0ek7bgc

Why this fix

A cold checkout showed the defect is pre-existing on main. The repository upgraded Lexical to 0.51.0, which removed the type parameter from SerializedElementNode; the notes renderer still passed one, so the local alias resolved to an error type and the renderer's narrowing collapsed. The library's own declaration says that parameter promised a narrowing nothing enforced, so using the type as declared is the honest model rather than a cast or a suppression. Re-running the workflow's commands with the local incremental cache removed reproduced exactly the four errors the check reported, and both sides carry the same source line, so the gate was red on main's content and not on anything this pull request introduces.

The failing run also flagged the Node setup action as running on a deprecated runtime. The current major declares the Node 24 action runtime and keeps the same version-file input, read from the action's own metadata published at that tag.

Outstanding and recorded on the incident timeline: main still has no branch protection, so this job reports a result without blocking a merge until an admin marks it required, and applying Prisma migrations remains a manual step. This pull request makes the gate work and pass; it does not yet enforce it.

Out of scope
  • Branch protection and marking this job required: repository admin settings, recorded on the incident timeline
  • Automating Prisma migration application: main is unprotected and previews share the production database, so it belongs after the gate exists
2 files changed (+64/-1)
  • .github/workflows/ci.yml: added, +63/-0
  • lib/integrations/notes/utils.ts: modified, +1/-1

View thread View autofix


Generated by Polylane. You can ask follow-ups by mentioning @polylane in a comment.

Co-authored-by: polylane[bot] <277585245+polylane[bot]@users.noreply.github.com>
@polylane polylane Bot added polylane severity:medium Polylane autofix severity: medium labels Sep 21, 2026
@vercel

vercel Bot commented Sep 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cache-app Ready Ready Preview Sep 21, 2026 4:53pm UTC

@polylane
polylane Bot requested a review from gilsmt September 21, 2026 16:46
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e402e3f9-5d20-4665-88f8-5d568c60ae34

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

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.

… removed

Co-authored-by: polylane[bot] <277585245+polylane[bot]@users.noreply.github.com>
@polylane polylane Bot changed the title chore(ci): run type-check, lint and tests on main and pull requests ci: gate main on type-check, lint and tests and repair the type error it caught Sep 21, 2026
@polylane

polylane Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

Both edits are pushed to gilsmt/cache-app#70 (commit 97879c2b), which updates the pull request in place.

What was failing

The Type-check, lint and test job failed at its Type-check step (exit 1) with four errors, all in lib/integrations/notes/utils.ts:

lib/integrations/notes/utils.ts(20,34):  error TS2315: Type 'SerializedElementNode' is not generic.
lib/integrations/notes/utils.ts(182,44): error TS2339: Property 'children' does not exist on type 'SerializedLexicalNode'.
lib/integrations/notes/utils.ts(189,40): error TS2339: Property 'children' does not exist on type 'SerializedLexicalNode'.
lib/integrations/notes/utils.ts(192,32): error TS2339: Property 'type' does not exist on type 'never'.

Line 20 was the cause of the other three: the repo upgraded Lexical to 0.51.0, which removed the type parameter from SerializedElementNode, and its own declaration now says that parameter "promised a narrowing nothing enforces". The code still passed SerializedLexicalNode, so the local alias resolved to an error type and the renderer's narrowing collapsed into never.

This is a pre-existing defect on main, not something the pull request introduced — git show b66cfbd3:lib/integrations/notes/utils.ts carries the same line, introduced before the dependency bump. The new gate is simply the first thing to check it.

What I changed

  • lib/integrations/notes/utils.ts — dropped the type argument, so the alias matches the library's current declaration.
  • .github/workflows/ci.ymlactions/setup-node v4 → v7, to clear the run's Node 20 deprecation warning. Verified from the action's own manifest at that tag: runs.using: node24 and the node-version-file input is unchanged.

Validation

  • bun run type-check with tsconfig.tsbuildinfo removed (cold, as CI runs it): exit 0, no diagnostics. Without that removal the run reproduced all four CI errors verbatim, which is what confirmed the diagnosis; with a warm local incremental cache the same command had returned a false green earlier.
  • bun run lint: 357 files, no fixes. bun run test: 144 pass, 0 fail.
  • Reproducer: a temporary script importing the notes module rendered a nested Lexical state to <p><strong>Hello &lt;world&gt;</strong></p><h2></h2><br>tail, with escaping intact and javascript: hrefs stripped — runtime behavior unchanged.
  • Workflow YAML parses; actionlint was not available, and the hosted job itself can only be confirmed by the next run on this branch.

One thing this does not settle: main is still unprotected, so the job reports a result without blocking a merge until an admin marks it required. That, and automated Prisma migration application, stay on the incident timeline.

Pushed in 97879c2.

@polylane

polylane Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

Gilberto closed this pull request from Polylane:

Planned

@polylane polylane Bot closed this Sep 21, 2026

This branch was successfully deployed

1 active deployment
Preview 97879c2b Deployed Sep 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

polylane severity:medium Polylane autofix severity: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant