Skip to content

Harden workflow warning cleanup#770

Merged
blove merged 1 commit into
mainfrom
blove/threadplane-followup-hardening
Jul 7, 2026
Merged

Harden workflow warning cleanup#770
blove merged 1 commit into
mainfrom
blove/threadplane-followup-hardening

Conversation

@blove

@blove blove commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Wrap website e2e so Next typed-route generation restores the tracked next-env file after dev-server runs.
  • Remove recurring middleware and telemetry lint warnings from specs.
  • Update the deterministic LLM mock dev dependency to a release that supports the current Node runtime.

Verification

  • npm ci
  • npx nx lint telemetry --skip-nx-cache
  • npx nx lint middleware --skip-nx-cache
  • npx nx e2e website --skip-nx-cache
  • npx nx run-many -t test,build -p middleware,telemetry --skip-nx-cache
  • npx nx run-many -t lint,build -p website --skip-nx-cache
  • npx nx lint e2e-harness --skip-nx-cache
  • npx nx test e2e-harness --skip-nx-cache
  • npx vitest run examples/chat/angular/e2e/aimock-runner.spec.ts
  • git diff --cached --check

@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment Jul 7, 2026 5:36am

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 2m 31s —— View job


PR Review: Harden workflow warning cleanup

  • Gather context
  • Read changed files
  • Analyze diff
  • Post review findings

Overall this is a clean, focused PR. The three goals (Next.js next-env.d.ts restore, lint warning cleanup, aimock version bump) are all addressed correctly. No blocking issues found.

Specific observations (see inline comments):

  1. run-e2e-with-next-env-restore.ts — hardcoded restore content (minor): CANONICAL_NEXT_ENV hard-codes the expected file content including the build-output-relative routes import path. If Next.js is upgraded and regenerates this file with a different format, the script will silently restore stale content and no-one will notice until a type error surfaces. A snapshot-then-restore pattern (readFile before running, writeFile in finally) would be more resilient at the cost of one extra I/O call.

  2. void messages in integration.spec.ts (nit): Using void expr as a statement to suppress unused-var warnings is valid but unusual. The conventional TypeScript idiom is the _ prefix (_messages). If the project's linter rejects _-prefixed params, an explicit // eslint-disable-next-line comment would be clearer to future readers.

Rest of the changes look good:

  • write: () => undefined in the postinstall specs is cleaner and type-safe (return type is inferred from the interface).
  • @copilotkit/aimock bump from 1.23.0 → 1.35.1 correctly drops the node >=24 engine constraint to >=20.15.0, solving the CI runtime mismatch.
  • The e2ee2e-playwright rename in project.json is a clean wrapper delegation; no caching or dependsOn config needed since nx:run-commands results are uncached by default.

Comment on lines +5 to +14
const CANONICAL_NEXT_ENV = `/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./../../dist/apps/website/.next/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
`;

async function restoreNextEnv(): Promise<void> {
await writeFile(new URL('../next-env.d.ts', import.meta.url), CANONICAL_NEXT_ENV);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The hardcoded constant works today, but will silently restore stale content if next-env.d.ts is legitimately updated (e.g., a Next.js upgrade regenerates the routes import path). A snapshot-then-restore pattern is more resilient:

Suggested change
const CANONICAL_NEXT_ENV = `/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./../../dist/apps/website/.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
`;
async function restoreNextEnv(): Promise<void> {
await writeFile(new URL('../next-env.d.ts', import.meta.url), CANONICAL_NEXT_ENV);
async function restoreNextEnv(): Promise<void> {
await writeFile(new URL('../next-env.d.ts', import.meta.url), CANONICAL_NEXT_ENV);
}

Suggested alternative for the full file — read then restore:

import { readFile, writeFile } from 'node:fs/promises';

async function main(): Promise<void> {
  const nextEnvUrl = new URL('../next-env.d.ts', import.meta.url);
  const originalContent = await readFile(nextEnvUrl, 'utf8');
  // ... run ...
  try {
    exitCode = await run(command, args);
  } finally {
    await writeFile(nextEnvUrl, originalContent);
  }
}

This would automatically track whatever git-committed content the file had at test start. Minor maintainability note, not a blocker.

bindTools(tools: unknown[]) { this.bound = tools; return this; }
async invoke(_messages: unknown[]) {
async invoke(messages: unknown[]) {
void messages;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unconventional suppression: void messages evaluates the expression and discards the result to satisfy the linter, but it's surprising to readers. The idiomatic TypeScript convention is the _ prefix:

Suggested change
void messages;
async invoke(_messages: unknown[]) {

If the project's ESLint rule triggers on _-prefixed params specifically, adding // eslint-disable-next-line @typescript-eslint/no-unused-vars would be more explicit. Using void as a statement may also conflict with a no-void rule in other files. Nit only.

@blove blove merged commit 6ea776f into main Jul 7, 2026
63 checks passed
@blove blove deleted the blove/threadplane-followup-hardening branch July 7, 2026 05:59
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