Skip to content

fix(ci): run npm lifecycle hooks in selected host lanes - #15086

Closed
ShuaixinHuang wants to merge 1 commit into
morluto:mainfrom
ShuaixinHuang:fix/ci-npm-lifecycle-host-checks
Closed

ShuaixinHuang wants to merge 1 commit into
morluto:mainfrom
ShuaixinHuang:fix/ci-npm-lifecycle-host-checks

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #15070 at the same commit bb3a1bf65f06497c52da1bc462912ecdaefb3b9a. The prior PR records the review history and validation for this commit.

Replaces #15007 at the same commit bb3a1bf65f06497c52da1bc462912ecdaefb3b9a. The prior PR records the review history and validation for this commit.

Replaces #14988 at the same commit bb3a1bf65f06497c52da1bc462912ecdaefb3b9a. The prior PR records the review history and validation for this commit.

Replaces #14968 at the same commit bb3a1bf65f06497c52da1bc462912ecdaefb3b9a. The prior PR records the review history and validation for this commit.

Summary

Replaces #14871 on current main. A package.json-only change to a pretest or posttest hook currently misses the dedicated SQLite, Python or reverse-tools lane that owns the command. Even after selecting the proper lane, SQLite and mutation preflight use narrower commands that bypass the outer lifecycle hooks. This change routes hook edits through their npm target and explicitly runs the outer hooks around those narrower commands.

Scope

The SQLite job keeps using the downloaded runtime. Reverse-tools retains main's separate mutation-target guard ahead of coverage, along with both mutation dry runs. Python and reverse-tools coverage continue to get their hooks through npm. This addresses the earlier workflow-entry-point feedback in #14353.

Validation

  • Ten hook-only planner cases, covering both prefixes for all five targets, failed on main c24ec44c and pass with this change.
  • All 525 tests passed in the change-scope, CI feedback, and required-lanes suites. Formatting and diff checks passed.
  • Ran the actual SQLite workflow shell snippet with real npm and a temporary package. The observed order was outer pre-hook, inner pre-hook, test, inner post-hook, outer post-hook. The smoke used fixture scripts; the hosted matrix is pending.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T07:30:56.490384Z bb3a1bf PR opened
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

security Security Review

This PR appears safe to merge from a security standpoint.

What was checked
  • The newly run pretest/posttest hooks are package.json scripts the PR author already controls, and these CI jobs already run that author's test scripts, so no new code class executes.
  • The touched CI jobs (reverse-tools-quality and the SQLite runtime job) hold only contents: read and no secrets; TURBO_TOKEN is explicitly empty for pull requests.
  • The classifier change only routes hook-only edits to their owning lane, and the hook now actually runs there; dependency or metadata changes still trigger the full tier, and prefix edge cases like prepretest:x cannot misroute to a narrow lane.
  • The added workflow commands are fixed literals with no pull-request-controlled interpolation, and --if-present skips cleanly when a hook is absent.
  • The reviewed diff matches head commit bb3a1bf exactly as described, consistent with it superseding the prior PRs; GitHub PR states could not be verified from here.

@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The changes appear safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The changes appear safe to merge.

Summary

Routes edits to npm lifecycle hooks into the Python, SQLite, or reverse-tools lane that runs them.

  • Hook-only package script edits now pick their matching CI lane.
  • Direct SQLite and mutation checks now run their outer npm hooks.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["package.json hook edit"] --> B["Strip pre or post prefix"]
  B --> C["Python lane"]
  B --> D["Reverse-tools lane"]
  B --> E["SQLite lane"]
  C --> F["npm runs target and hooks"]
  D --> G["Coverage through npm"]
  D --> H["Outer hooks around both mutation dry runs"]
  E --> I["Outer hooks around npm test:sqlite:run"]
  I --> J["npm runs inner hooks"]
Loading

Reviews (1) · Last reviewed commit: "fix(ci): run npm lifecycle hooks in sele..." · Reviewed by Greptile

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