Repository navigation
test: Cover the strict-policy fixes and close their typing gaps - #2406
Merged
Merged
Conversation
Follow-ups from the #2266 review: - mcp-cloudflare: test that an approval cookie with an empty signature is rejected without reporting an error to Sentry, and that /api/chat answers a non-Error throw with a JSON 500 and an event ID. Both tests fail against the code before #2266. - tsconfig policy: a type check command other than tsc, astro check or a pnpm/node setup step now fails the policy test instead of silently adding no program. - apps/local: withoutUndefined accepts only plain records, matching the own-string-keys copy its cast promises. - cli: drop the null-name guard in the metric alert query filter and its test. Sentry's Detector.name is a non-null CharField, so the cast to string | null contradicted the type for a response Sentry cannot send. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
evanpurkhiser
approved these changes
Nov 18, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups from the #2266 review.
Changes
verifySignatureand went throughlogError)./api/chatanswers a non-Errorthrow with a JSON 500 and an event ID (before build: Move to TypeScript 7, pnpm 12 and a shared strict policy #2266 Hono returned plain-text "Internal Server Error" and nothing was logged). Both tests fail against the pre-build: Move to TypeScript 7, pnpm 12 and a shared strict policy #2266 code.typecheckCommandConfigsthrows for a type check command other thantsc,astro check, or apnpm/nodesetup step. Before, such a command added no program, so a package could switch checkers and drop out of the option checks unnoticed.withoutUndefined. Accepts only plain records (Record<string, unknown>), since it copies own enumerable string keys. Class instances and interface-typed values no longer type-check; a test pins that.as string | nullguard and its "null name" test. The command reads/detectors/, and Sentry'sDetector.nameis a non-nullCharFieldin every migration, so the guard covered a response Sentry cannot send. This matches how build: Move to TypeScript 7, pnpm 12 and a shared strict policy #2266 already treats issue-alert names.Not changed
state.tsempty-signature guard has no observable effect:verifyAndParseStaterejects an empty signature first, and that catch never logged.available[0] ?? chosenMetricfallback is unreachable:webVitalPagesdrops visits without metrics, so no test can drive it..d.tsoutput can differ between builds only in the order of union members in inferred types. The types are identical.omitUndefined/withoutUndefinedhelper. Merging them into toolkit-core is a separate change.Verification
pnpm run typecheck,pnpm run lint,pnpm run test:ci-projects(194 pass), mcp-cloudflare (469) and apps/local (466) suites pass. CLI alert tests pass exceptalert issues delete > dry-run, which fails locally onmaintoo becausepnpm execadds annpx -yprefix to its expected usage hint.🤖 Generated with Claude Code