Skip to content

Wire @rdi-ui/pipeline into the standalone v2 pipeline management page - #6506

Merged
ArtemHoruzhenko merged 7 commits into
mainfrom
feature/rdi-ui/pipeline-package
Sep 29, 2026
Merged

ArtemHoruzhenko merged 7 commits into
mainfrom
feature/rdi-ui/pipeline-package

Conversation

@ArtemHoruzhenko

@ArtemHoruzhenko ArtemHoruzhenko commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Renders the shared @rdi-ui/pipeline PipelineManagement component inside the standalone pipeline-management-v2 page (from #6502), pointed at the RDI proxy endpoint (rdi/:id/proxy, from #6504).

  • RdiPipeline wraps the package in its own styled-components ThemeProvider, overriding just this subtree's theme shape (via an aliased @redis-ui/styles 21 install) since the bundled components read a styles-21 theme shape RedisInsight's own styles-15 theme doesn't have yet.
  • useRdiPipelineNavigation adapts react-router's history to the package's NavigationService contract.
  • targetDatabase/sourceSecrets/multiSource/pipelineSecrets/configTranslate are wired to the minimum viable config for now; config-translation and secret-mounting are stubbed pending their own follow-up work.
  • Adds a TS 4.9 parse-failure workaround (zod-v4-stub.d.ts + tsconfig.json paths remap) for zod's TS5-only syntax, reached transitively via @rdi-ui/sdk - see the stub file for the full explanation. tsc-only; doesn't affect Vite or Jest.
  • Mocks @rdi-ui/pipeline wholesale for Jest (its UMD bundle doesn't interop with styled-components under Jest) and adds min-release-age-exclude for @rdi-ui/* (our own org's scope) to .npmrc, so we can pick up fixes immediately instead of waiting out the supply-chain cooldown that applies to third-party packages.
  • Bumps @rdi-ui/pipeline to the latest available release (0.1.28).

Test plan

  • Manually verified against a live RDI v1.19.1 instance - the create-pipeline wizard renders correctly inside the standalone page
  • npx jest on pages/rdi, components/main-router - 61/61 suites passing
  • eslint --fix on all touched files - 0 errors
  • tsc --noEmit - no new errors introduced (zod workaround verified to produce 0 zod-related errors)

🤖 Generated with Claude Code


Note

Medium Risk
New third-party UI stack and dependency tree affect RDI pipeline flows and routing; incorrect v1/v2 gating or proxy wiring could send users to the wrong experience or break pipeline API calls.

Overview
Replaces the v2 pipeline management placeholder with the shared @rdi-ui/pipeline experience, backed by new dependencies (@rdi-ui/pipeline, @tanstack/react-query, react-hook-form, yup, and an aliased @redis-ui/styles-rdi for RDI-specific styling).

useRdiPipelineUi centralizes when the app should use v1 vs v2 (dev flag, connected instance version, load/error/context state). InstancePage and PipelineManagementV2Page both use it: they show a loader while resolving, redirect to the correct pipeline URL (including v2 → v1 when the flag is off or the version is unsupported), and avoid flashing the legacy v1 shell before redirect. The v2 route drops exact: true so nested wizard paths can match.

RdiPipeline (with useRdiPipelineNavigation) hosts the package behind a per-instance React Query client and RDI proxy base URL. Jest maps @rdi-ui/pipeline to a mock; tsconfig adds temporary zod v4 path stubs for older TypeScript.

Reviewed by Cursor Bugbot for commit 90e4a9e. Bugbot is set up for automated code reviews on this repo. Configure here.

Renders the shared @rdi-ui/pipeline PipelineManagement component
inside the standalone pipeline-management-v2 page, pointed at the RDI
proxy endpoint (rdi/:id/proxy) added earlier.

- RdiPipeline wraps the package in its own styled-components
  ThemeProvider, overriding just this subtree's theme shape (via an
  aliased @redis-ui/styles 21 install) since the bundled components
  read a styles-21 theme shape RedisInsight's own styles-15 theme
  doesn't have yet.
- useRdiPipelineNavigation adapts react-router's history to the
  package's NavigationService contract.
- targetDatabase/sourceSecrets/multiSource/pipelineSecrets/
  configTranslate are wired to the minimum viable config for now;
  config-translation and secret-mounting are stubbed pending their own
  follow-up work.
- Adds a TS 4.9 parse-failure workaround (zod-v4-stub.d.ts +
  tsconfig.json paths remap) for zod's TS5-only syntax, reached
  transitively via @rdi-ui/sdk - see the stub file for the full
  explanation. tsc-only; doesn't affect Vite or Jest.
- Mocks @rdi-ui/pipeline wholesale for Jest (its UMD bundle doesn't
  interop with styled-components under Jest) and adds
  min-release-age-exclude for @rdi-ui/*, our own org's scope, so we
  can pick up fixes immediately instead of waiting out the supply-
  chain cooldown that applies to everyone else.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ArtemHoruzhenko
ArtemHoruzhenko requested a review from a team as a code owner September 16, 2026 09:43

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6c453b12d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage - Backend unit tests

St.❔
Category Percentage Covered / Total
🟢 Statements 93.29% 16884/18099
🟡 Branches 75.68% 5429/7174
🟢 Functions 87.75% 2592/2954
🟢 Lines 93.15% 16146/17334

Test suite run success

3924 tests passing in 331 suites.

Report generated by 🧪jest coverage report action from 90e4a9e

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟡 Statements 79.6% 18582/23344
🟡 Branches 62.05% 8693/14009
🟡 Functions 67.34% 2516/3736
🟡 Lines 79.19% 17496/22092

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage - Frontend unit tests

St.❔
Category Percentage Covered / Total
🟢 Statements 83.65% 29040/34718
🟡 Branches 69.78% 12370/17727
🟡 Functions 78.68% 7655/9729
🟢 Lines 84.11% 28231/33564

Test suite run success

8142 tests passing in 877 suites.

Report generated by 🧪jest coverage report action from 90e4a9e

- Drop `exact: true` from the pipeline-management-v2 route: the
  package navigates to real sub-paths under `basePath` for its
  multi-step wizard, and exact matching unmounted the whole page the
  moment it did, falling through to the v1 instance route below it in
  the Switch. Safe to drop since this route is still declared before
  that non-exact v1 route.
- Attach `x-window-id` on the rdiClient config: Electron's
  WindowAuthMiddleware guards every API route unconditionally
  (including this proxy) on that header, but this client bypasses
  apiService's own interceptor that normally attaches it.
- Stop rebuilding the whole navigation service object on every
  navigation: getPath() now reads from a ref kept fresh every render,
  so it can't go stale if the package captures the object once instead
  of re-reading the prop each render - and the object's identity no
  longer changes on route changes either, which could otherwise
  retrigger the package's own mount-effects.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5d704682ff

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

rdiClient and its siblings (targetDatabase, sourceSecrets, multiSource,
pipelineSecrets, configTranslate) were inline object/function literals,
so every render created new identities for all of them - and this
component re-renders on every wizard-step navigation, since
useRdiPipelineNavigation subscribes to location. Same
mount-effect-retriggering risk already fixed for the navigation object
itself, left unaddressed on these.

rdiClient depends on rdiInstanceId, so it's memoized; the rest have no
dependencies at all, so they're hoisted to module-level constants for
a permanently stable reference instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment thread .npmrc Outdated
Comment thread package.json Outdated
Comment thread package.json
Comment thread redisinsight/ui/src/pages/rdi/pipeline-management-v2/PipelineManagementV2Page.tsx Outdated
- Remove the non-functional min-release-age-exclude from .npmrc:
  verified against npm's own source that this was only backported to
  npm 11.17.0, but .nvmrc pins Node 24.16.0 (npm 11.13.0) - it silently
  did nothing on the toolchain this repo actually uses.
- Exact-pin @rdi-ui/pipeline instead of a caret range, given how
  rapidly it iterates pre-1.0, and bump to the latest version that
  clears the release-age cooldown.
- Simplify useRdiPipelineNavigation: read history.location.pathname
  directly instead of a ref - history.location is already always
  current, so the ref added nothing.
- Fix PipelineManagementV2Page recording the wrong PageNames value
  (rdiPipelineManagement, the v1 page) as the last-visited rdi section
  on unmount - should record its own (rdiPipelineManagementV2).
- Gate the v2 page itself on isDevRdiUiEnabled, redirecting to the v1
  pipeline management page when off: the route was only gated by
  FeatureFlags.rdi, so a direct/bookmarked visit skipped the dev-flag
  check that InstancePage's own v1->v2 redirect decision already
  applies. Verified this can't loop: InstancePage only redirects
  toward v2 from the bare instance URL, never from the v1 pipeline
  management path this redirects to.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 880d0e4875

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread redisinsight/ui/src/pages/rdi/pipeline-management-v2/PipelineManagementV2Page.tsx Outdated

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

…rovider

- Extract useRdiPipelineUi: a single hook computing whether an RDI
  instance should use the v1 or v2 pipeline UI, given the dev flag and
  RDI version, plus a loading state. Both InstancePage (v1's own
  redirect decision) and PipelineManagementV2Page (guarding direct/
  bookmarked v2 URLs) now call this instead of each having their own
  copy - which is what let them drift apart before: the v2 page's
  guard only checked the flag, missing the version check.
- Returns a discriminated union ({status:'loading'} |
  {status:'ready', target:'v1'|'v2'}) rather than separate isLoading/
  target fields, so `target` can't be read while still loading at the
  type level. Memoized internally so its identity only changes when
  the underlying instance/flag data actually does - both consumers
  depend on it (one in a useEffect dep array), and an unmemoized
  object here would retrigger on every unrelated render.
- PipelineManagementV2Page now shows a Loader while resolving instead
  of blank content, and redirects to v1 for both an unsupported
  version and a disabled flag.
- Add a QueryClientProvider around PipelineManagement: it uses
  react-query internally (confirmed directly in its bundle) but
  doesn't ship its own provider, so the first query/mutation would
  throw "No QueryClient set". Invisible in tests since the package is
  fully mocked there.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

- PipelineManagementV2Page called useConnectRdiInstance directly and
  useRdiPipelineUi, which calls that same hook again - both instances
  ran the instance-id effect, so mount dispatched
  fetchConnectedInstanceAction twice, reset RDI/database context
  twice, and could show two error notifications on failure. Now reads
  connectedInstance via a plain selector for the page title instead,
  since useRdiPipelineUi already connects the instance.
- InstancePage rendered its full v1 shell (tabs, status bar)
  unconditionally, even while still on the bare instance URL deciding
  whether to redirect to v1 or v2 - under network throttling this
  showed as v1 UI flashing before the v2 redirect. The bare URL never
  actually renders as a page (the effect always replaces it with
  something else), so render a loader there instead, regardless of
  whether the decision has resolved yet - covers both the loading
  window and the brief gap between the decision resolving and
  history.replace actually firing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 45d6fae. Configure here.

The QueryClient was a module-level singleton shared across every RDI
instance. PipelineManagement stays mounted across instance switches,
and nothing guarantees its internal query keys are namespaced by
instance, so the shared cache could serve a previous instance's
pipeline data (jobs, secrets, error state) until a refetch completes.

Scope it with useMemo keyed on rdiInstanceId instead, so switching
instances always starts from an empty cache.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ArtemHoruzhenko
ArtemHoruzhenko merged commit 43bd288 into main Sep 29, 2026
34 checks passed
@ArtemHoruzhenko
ArtemHoruzhenko deleted the feature/rdi-ui/pipeline-package branch September 29, 2026 11:21
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.

2 participants