Skip to content

feat(apollo-react): mark guardrail preview chips from the definition's isPreview - #1472

Merged
andreizdrali-uipath merged 1 commit into
mainfrom
feat/guardrail-preview-from-definition
Oct 26, 2026
Merged

andreizdrali-uipath merged 1 commit into
mainfrom
feat/guardrail-preview-from-definition

Conversation

@andreizdrali-uipath

Copy link
Copy Markdown
Contributor

Summary

With previewChip on, the guardrail palette marks every entry and the list every built-in validator row, so taking a validator out of preview needs a release of both hosts. The Agents definitions endpoint now sends isPreview on each definition, from its PreviewGuardrailTypes flag (UiPath/Agents#6800), and this makes the shared components follow it.

  • isPreview?: boolean on GuardrailDefinitionWire, GuardrailDefinition, GuardrailPaletteDefinition and GuardrailListDefinition; kept by parseGuardrailDefinitions and copied by enrichGuardrailDefinitions.
  • The palette skips the chip for a definition with isPreview: false; the list does the same through the row's resolved definition.
  • Absent reads as preview, so an older backend, a host that doesn't map the field yet, or a row whose definition hasn't resolved keeps today's chip. Deploy order doesn't matter.
  • previewChip still opts a host in. README notes updated.

Agents and Flow pass the field through and bump to this release in UiPath/Agents#6800 and a Flow PR.

Tests

New cases in definitions-parse.test.ts, definitions-enrich.test.ts, guardrail-palette.test.tsx and components/guardrail-list-row.test.tsx (true, false, absent). Not run locally yet; CI will.

🤖 Generated with Claude Code

…s isPreview

With previewChip on, the palette marked every entry and the list every
built-in validator row, so taking one validator out of preview took a
release of both hosts. The Agents definitions endpoint now sends
isPreview on each definition, from its PreviewGuardrailTypes flag
(UiPath/Agents#6800), so the backend decides per validator.

isPreview is modelled on the wire type, kept by the parser and copied by
enrichment. The palette and the list (through the row's resolved
definition) skip the chip only when it is false. Absent reads as
preview: an older backend, a host that does not map the field yet, or a
row whose definition has not resolved keeps today's chip, so deploy
order does not matter. previewChip still opts a host in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 26, 2026 14:04
@github-actions
github-actions Bot temporarily deployed to preview/apollo-design October 26, 2026 14:04 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-vertex October 26, 2026 14:04 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-docs October 26, 2026 14:04 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-landing October 26, 2026 14:04 Destroyed
@github-actions github-actions Bot added the size:M 30-99 changed lines. label Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • ✅ 1957 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1721
ISC 91
Apache-2.0 57
BSD-3-Clause 28
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
CC0-1.0 4
MIT-0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The narrow change consistently propagates the optional flag, preserves backward compatibility, and includes focused regression coverage with no blocking issues identified.

No open issues 🎉

What changed in this PR

Updates Apollo React’s shared guardrail components to use each definition’s isPreview flag, allowing the backend to control preview badges without coordinated host releases.

Changes:

  • Adds optional isPreview fields and preserves them through parsing and enrichment.
  • Hides preview chips only for explicit false, preserving existing defaults and the host’s previewChip opt-in.
  • Adds regression tests and updates documentation. Tests were not executed during this review.

All paths below are relative to packages/apollo-react/src/canvas/components/Guardrails/.

File Description
README.md Documents per-definition preview behavior.
palette-types.ts Adds the optional palette preview flag.
list-types.ts Adds the optional list preview flag.
guardrail-palette.tsx Suppresses preview chips for explicit false.
guardrail-palette.test.tsx Covers true, false, and absent preview flags.
definitions-wire.ts Adds the flag to the wire contract.
definitions-parse.ts Accepts the optional boolean during parsing.
definitions-parse.test.ts Tests flag preservation and omission.
definitions-enrich.ts Copies the flag into enriched definitions.
definitions-enrich.test.ts Tests propagation through parsing and enrichment.
components/​guardrail-list-row.tsx Uses the resolved definition to gate preview chips.
components/​guardrail-list-row.test.tsx Tests explicit flags and unresolved-definition fallback.
builder-types.ts Defines and documents the shared preview flag.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Storybook visual diff

⏭️ Skipped: the apollo-design preview deployment did not succeed, so no comparison ran. Logs

Updated (PT): Oct 26, 2026, 07:11:18 AM

@andreizdrali-uipath
andreizdrali-uipath enabled auto-merge (rebase) October 26, 2026 14:24
@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core — — 42.02 MB 50.17 MB ±0
@uipath/apollo-react 58.0% 100.0% (1/1) 8.14 MB 32.18 MB +137 B
@uipath/apollo-ui-icons — — 2.86 MB 6.97 MB ±0
@uipath/apollo-vertex — — — — —
@uipath/apollo-wind — — 814.7 KB 4.70 MB −7 B
@uipath/ap-chat 85.8% — 40.42 MB 45.72 MB ±0

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@andreizdrali-uipath
andreizdrali-uipath merged commit 430e59d into main Oct 26, 2026
32 of 36 checks passed
@andreizdrali-uipath
andreizdrali-uipath deleted the feat/guardrail-preview-from-definition branch October 26, 2026 14:31

This branch was successfully deployed

No deployments
preview/apollo-docs — 0adf7fc9 Deployed Oct 26, 2026 by github-actions[bot]
preview/apollo-landing — 0adf7fc9 Deployed Oct 26, 2026 by github-actions[bot]
preview/apollo-design — 0adf7fc9 Deployed Oct 26, 2026 by github-actions[bot]
preview/apollo-vertex — 0adf7fc9 Deployed Oct 26, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:apollo-react size:M 30-99 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants