Skip to content

chore(deps): upgrade backend to Fastify 5 on stable 2.x - #9247

Closed
PR3MM wants to merge 3 commits into
opendatahub-io:stable-2.xfrom
PR3MM:chore/fastify5-stable-2.x
Closed

chore(deps): upgrade backend to Fastify 5 on stable 2.x#9247
PR3MM wants to merge 3 commits into
opendatahub-io:stable-2.xfrom
PR3MM:chore/fastify5-stable-2.x

Conversation

@PR3MM

@PR3MM PR3MM commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

https://issues.redhat.com/browse/RHOAIENG-81841

Description

Ports the Fastify 5 backend migration from main (#9202) onto the stable-2.x release branch. Bumps fastify and version-coupled @fastify/* plugins in the same change set.

Dependency changes (backend/package.json):

Package Before After
fastify 4.29.1 5.11.x
fastify-plugin 4.5.1 5.1.0
@fastify/autoload 5.7.1 6.5.0
@fastify/http-proxy 9.5.0 11.6.0
@fastify/reply-from (transitive) 12.6.4 (transitive)
@fastify/static 6.10.2 10.1.3
@fastify/websocket 8.3.1 11.3.0
@fastify/sensible 5.2.0 6.0.4
@fastify/accepts 4.3.0 5.0.4
@pinojs/redact ^0.4.0 (required by Fastify 5 / pino)
undici (transitive) 7.29.0 (transitive)

Backend code changes for Fastify 5 API compatibility:

  • server.ts: loggerloggerInstance; maxParamLength moved under routerOptions
  • routes/wss/k8s/index.ts: WebSocket handler uses connection directly (Fastify 5 / @fastify/websocket v11)
  • package-lock.json: regenerated for Fastify 5 dependency tree

How Has This Been Tested?

Automated

  • npm run test (backend) — lint, type-check, jest 17/17 pass
  • npm run build (backend) — pass

Resolved lock versions:

  • fastify@5.11.3
  • @fastify/websocket@11.3.0
  • @fastify/http-proxy@11.6.0
  • @fastify/autoload@6.5.0
  • @fastify/reply-from@12.6.4
  • @pinojs/redact@0.4.0
  • undici@7.29.0

Manual

Logged in as htpasswd-cluster-admin-user via make login + npm run dev.

Area Test Result
Boot /api/health, /api/status, /api/config 200
DSC / DSCI /api/dsc/status, /api/dsci/status 200 (real component data)
K8s REST /api/k8s/... proxy 200
UI Dashboard loads Pass
WebSocket /wss/k8s/... watch in browser (confirm 101 before merge)

Test Impact

  • No new unit tests — this branch has no websocket proxy spec
  • Functional coverage via manual testing above per RHOAIENG-81841
  • No Cypress changes — backend-only dependency migration

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)
  • The code follows our Best Practices (React coding standards, PatternFly usage, performance considerations)
    If you have UI changes:
  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.
    After the PR is posted & before it merges:
  • The developer has tested their solution on a cluster by using the image produced by the PR to stable-2.x

@openshift-ci openshift-ci Bot added the needs-rebase PR needs to be rebased label Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dd5c5fcb-1378-4cb3-9ec7-4d8a00d5112b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@PR3MM: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/odh-dashboard-pr-image-mirror 039f6e0 link true /test odh-dashboard-pr-image-mirror
ci/prow/odh-mod-arch-model-registry-pr-image-mirror 039f6e0 link true /test odh-mod-arch-model-registry-pr-image-mirror
ci/prow/odh-mod-arch-gen-ai-pr-image-mirror 039f6e0 link true /test odh-mod-arch-gen-ai-pr-image-mirror
ci/prow/images 039f6e0 link true /test images
ci/prow/odh-dashboard-operator-pr-image-mirror 039f6e0 link true /test odh-dashboard-operator-pr-image-mirror

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@PR3MM

PR3MM commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@PR3MM

PR3MM commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yuliakrimerman for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@odh-dashboard-agent odh-dashboard-agent 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.

Preflight Agent Report

Verdict: ❌ NOT READY
Commit: 039f6e04

Checks
Check Status Details
Conflicts CONFLICTING — PR targets main but branch contains stable-2.x commits. PR description says it should target v2.25.0-fixes; retargeting the base branch should resolve all Prow failures.
CI (Prow) 5 image mirror jobs failed (ci/prow/images, 4 *-pr-image-mirror). Root cause: merge conflict prevents image build — not a code regression. Resolve conflicts first.
CI (GitHub Actions) ⚠️ Lint, Type-Check, Unit Tests pending (router check still running at time of evaluation).
Jira RHOAIENG-81841 — Migrate Fastify 4 → 5 (Closed).
Test Coverage No test files added; PR body explains: dep upgrade, no websocket proxy spec exists on this branch.
PR Body Follows template — Description, How Tested, Test Impact, checklist all complete.
Style N/A — no .scss/.css/.tsx files changed.
RBAC No concerns. Auth path (getDirectCallOptions + getAccessToken) unchanged.
Claude review 🟠 1 major · 🟡 2 minor Pre-existing issues in touched function — see details below.
Jira Eval ⚠️ 4/6 criteria satisfied. WebSocket functional testing flagged "confirm 101 before merge" in PR body; 3.3/3.4 branches still outstanding.
Human review ⚠️ REVIEW_REQUIRED — no approvals yet.
CodeRabbit (PR) Review skipped: 213 files exceed the limit of 100.
🟠 1 major · 🟡 2 minor — Claude review findings in backend/src/routes/wss/k8s/index.ts

These are pre-existing issues in the touched WebSocket handler — not introduced by this PR but exposed by the diff scope.


🟠 Major — fastify.server.address() null dereference (line 69)

server.address() can return null when the server is not yet fully bound. The code takes the typeof null === 'object' branch and accesses serverAddress.address, throwing TypeError. Unlikely in production but eliminable:

- const serverAddress = fastify.server.address();
+ const serverAddress = fastify.server.address() ?? { address: '127.0.0.1' };

🟡 Minor — close callback declares reason: string but 'close' event emits Buffer (line 74)

The ws library emits (code: number, reason: Buffer) on close. TypeScript strict mode will flag this. closeWebSocket already handles Buffer via .toString(), so no runtime crash — but the parameter type should be widened:

- const close = (code: number, reason: string) => {
+ const close = (code: number, reason: string | Buffer) => {

🟡 Minor — source.send(data, { binary }) with data: unknown (line 98)

WebSocket.send expects RawData (string | Buffer | ArrayBuffer | Buffer[]), not unknown. TypeScript strict mode rejects this, and a non-buffer unexpected value would be serialized as '[object Object]' and corrupt binary kubectl exec/log streams.


Automated by ODH Dashboard Agent

@andyatmiami

Copy link
Copy Markdown
Contributor

/hold

this breaks the dashboard - can't merge

@openshift-ci openshift-ci Bot added the do-not-merge/hold This PR is hold for some reason label Aug 12, 2026
@PR3MM

PR3MM commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

closing PR as it needs rework based on changes in main branch

@PR3MM PR3MM closed this Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/backend do-not-merge/hold This PR is hold for some reason

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants