Skip to content

Conversation

@hodanoori
Copy link
Contributor

@hodanoori hodanoori commented Feb 9, 2026

Summary

Route search validation no longer relies on Zod’s ctx.path in z.preprocess (removed in Zod v4). A small helper filters URL search params by known keys and allowed prefixes before parsing with Zod, so the same behavior works with Zod v3 and v4.

Changes Made

  • Added filterSearchParamsByPrefix(raw, knownKeys, allowedPrefixes) helper in heureka (utils.ts), supernova (lib/validateSearch.ts), and doop (lib/validateSearch.ts).
  • Updated heureka /services and /vulnerabilities routes to validate search via the helper + schema (no preprocess using ctx.path).
  • Updated supernova /alerts route to use the helper with ACTIVE_FILTERS_PREFIX and PAUSED_FILTERS_PREFIX.
  • Updated doop /violations route to use the helper with ACTIVE_FILTERS_PREFIX.
  • Typed supernova getFiltersForUrl as Record<string, string | string[]> and adjusted implementation so search param types align with the route schema.
  • Removed unnecessary type assertions in carbon ErrorFallback (error already typed as Error) and in doop/supernova validate-search return values.

Related Issues

Screenshots (if applicable)

none

Testing Instructions

  1. pnpm i
  2. pnpm TASK

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.
  • I have created a changeset for my changes.

PR Manifesto

Review the PR Manifesto for best practises.

@hodanoori hodanoori requested a review from a team as a code owner February 9, 2026 16:01
@changeset-bot
Copy link

changeset-bot bot commented Feb 9, 2026

⚠️ No Changeset found

Latest commit: 2f97767

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hodanoori hodanoori self-assigned this Feb 9, 2026
@hodanoori hodanoori changed the title Hoda upgrade zod v4 chore(greenhouse): makes route search validation Zod v4–ready (filter by prefix before parse) Feb 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

PR Preview Action v1.6.3

🚀 View preview at
https://cloudoperators.github.io/juno/pr-preview/pr-1446/

Built to branch gh-pages at 2026-02-09 16:21 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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