Skip to content

feat(#3832): remove KFMR client code from kserve connector#3833

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/3832-remove-kfmr-client-code
Open

feat(#3832): remove KFMR client code from kserve connector#3833
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/3832-remove-kfmr-client-code

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Remove all KubeFlow Model Registry (KFMR) REST client code from the kserve-kubeflow-connector-backend plugin per RHIDP-15200.

Shared utilities (PropertyKeys, NormalizerFormat, getTagsFromCustomProps, getStringPropVal, sanitizeName, sanitizeModelVersion) relocated from Kfmr.ts to types.ts. Model Catalog code (catalog route discovery, getModelCard, CatalogClient interface) extracted into new Catalog.ts module. KServe.ts updated to import PropertyKeys from types.ts.

InformerService.ts simplified to KServe-only reconciliation path: removed processKFMR, setupKFMR, loopOverKFMR, KFMR label constants, KubeflowNormalizer, kserveInferenceServiceMapping, and all KFMR imports. ReconcilerConfig cleaned up: kfmrClients/kfmrRoutes removed, kfmrCatalogRoute renamed to catalogRoute.

Kfmr.ts deleted. undici dependency removed (TLS-skip agent no longer needed). Catalog route discovery preserved via setupCatalogRoute for future Model Catalog API enhancements.

Assisted-by: Claude Opus 4.6


Closes #3832

Post-script verification

  • Branch is not main/master (agent/3832-remove-kfmr-client-code)
  • Secret scan passed (gitleaks — 8d3503a7a74718f7eea8b2568fcd31c0ef731c05..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

Remove all KubeFlow Model Registry (KFMR) REST client code from
the kserve-kubeflow-connector-backend plugin per RHIDP-15200.

Shared utilities (PropertyKeys, NormalizerFormat, getTagsFromCustomProps,
getStringPropVal, sanitizeName, sanitizeModelVersion) relocated from
Kfmr.ts to types.ts. Model Catalog code (catalog route discovery,
getModelCard, CatalogClient interface) extracted into new Catalog.ts
module. KServe.ts updated to import PropertyKeys from types.ts.

InformerService.ts simplified to KServe-only reconciliation path:
removed processKFMR, setupKFMR, loopOverKFMR, KFMR label constants,
KubeflowNormalizer, kserveInferenceServiceMapping, and all KFMR
imports. ReconcilerConfig cleaned up: kfmrClients/kfmrRoutes removed,
kfmrCatalogRoute renamed to catalogRoute.

Kfmr.ts deleted. undici dependency removed (TLS-skip agent no longer
needed). Catalog route discovery preserved via setupCatalogRoute for
future Model Catalog API enhancements.

Closes #3832

Assisted-by: Claude Opus 4.6
@rhdh-gh-app

rhdh-gh-app Bot commented Jul 18, 2026

Copy link
Copy Markdown

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-kserve-kubeflow-connector-backend workspaces/ai-integrations/plugins/kserve-kubeflow-connector-backend none v0.1.1

@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.26%. Comparing base (8d3503a) to head (af8489b).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3833   +/-   ##
=======================================
  Coverage   56.26%   56.26%           
=======================================
  Files        2499     2499           
  Lines       96058    96058           
  Branches    26644    26644           
=======================================
  Hits        54047    54047           
  Misses      41683    41683           
  Partials      328      328           
Flag Coverage Δ *Carryforward flag
adoption-insights 83.70% <ø> (ø) Carriedforward from 8d3503a
ai-integrations 69.00% <ø> (ø)
app-defaults 69.79% <ø> (ø) Carriedforward from 8d3503a
augment 46.39% <ø> (ø) Carriedforward from 8d3503a
boost 73.13% <ø> (ø) Carriedforward from 8d3503a
bulk-import 72.46% <ø> (ø) Carriedforward from 8d3503a
cost-management 14.10% <ø> (ø) Carriedforward from 8d3503a
dcm 61.81% <ø> (ø) Carriedforward from 8d3503a
extensions 61.53% <ø> (ø) Carriedforward from 8d3503a
global-floating-action-button 71.18% <ø> (ø) Carriedforward from 8d3503a
global-header 59.71% <ø> (ø) Carriedforward from 8d3503a
homepage 50.23% <ø> (ø) Carriedforward from 8d3503a
install-dynamic-plugins 56.77% <ø> (ø) Carriedforward from 8d3503a
intelligent-assistant 69.01% <ø> (ø) Carriedforward from 8d3503a
konflux 91.49% <ø> (ø) Carriedforward from 8d3503a
lightspeed 69.02% <ø> (ø) Carriedforward from 8d3503a
mcp-integrations 85.46% <ø> (ø) Carriedforward from 8d3503a
orchestrator 53.74% <ø> (ø) Carriedforward from 8d3503a
quickstart 65.63% <ø> (ø) Carriedforward from 8d3503a
sandbox 79.56% <ø> (ø) Carriedforward from 8d3503a
scorecard 82.96% <ø> (ø) Carriedforward from 8d3503a
theme 61.26% <ø> (ø) Carriedforward from 8d3503a
translations 7.25% <ø> (ø) Carriedforward from 8d3503a
x2a 78.68% <ø> (ø) Carriedforward from 8d3503a

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d3503a...af8489b. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@gabemontero

Copy link
Copy Markdown
Contributor

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 18, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 5:29 PM UTC · Completed 5:43 PM UTC
Commit: 8d3503a · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Review — PR #3833

Verdict: ✅ Approve

Summary

This PR cleanly removes the KubeFlow Model Registry (KFMR) REST client code from the kserve-kubeflow-connector-backend plugin, well-aligned with the openspec at openspec/changes/remove-kfmr-client-code/ and linked issue #3832. The scope is appropriate: Kfmr.ts is deleted, shared utilities are relocated to types.ts, Model Catalog code is extracted to a new Catalog.ts module, and InformerService.ts is simplified to a KServe-only reconciliation path. The undici dependency is correctly removed.

Key observations:

  • The plugin's public API surface (kserveKubeflowConnectorPlugin) is unchanged — no cross-repo contract breakage
  • No test files exist for this plugin (noted in the openspec as a separate Jira); no test regressions possible
  • All removed types (KFMRClient, LoopOverKFMRResult, etc.) are confirmed to have no consumers outside the three service files
  • The new Catalog.ts functions (createCatalogClient, fetchModelCard) are extracted but not yet called — they are scaffolding for future Model Catalog API enhancements

Findings

1. Relocated fetchModelCard uses incomplete URL encoding — Catalog.ts

Severity: low | Category: url-encoding

The fetchModelCard function encodes only spaces (.replace(/ /g, '%20')) for sourceId and modelName. Characters like /, ?, #, & are not encoded, which could produce malformed URLs if these values contain special characters. This is carried forward from the old Kfmr.ts (pre-existing) and the function is not yet called, but since the code is being written fresh in the new module, it would be a good opportunity to use encodeURIComponent() before the function gets wired into active code paths.

2. getStringPropVal signature generalized beyond spec authorization — types.ts

Severity: low | Category: scope-creep

The openspec task 1.4 says to "Move getStringPropVal function from Kfmr.ts to types.ts." The PR changes the signature from (key: string, mv: ModelVersion, rm: RegisteredModel) to (key: string, ...sources: HasCustomProperties[]) — a generalization not authorized by the spec. The function currently has zero callers (the old KFMR code that called it is deleted, and KServe.ts has its own local version with different semantics), so this causes no breakage, but it's a minor scope creep.

3. Relocated shared utilities have no current callers — types.ts

Severity: low | Category: dead-code

The functions getTagsFromCustomProps, getStringPropVal, sanitizeName, sanitizeModelVersion, and the NormalizerFormat enum were relocated from Kfmr.ts to types.ts per the spec. However, their only callers were in the deleted KFMR code. These are intentionally preserved for future Model Catalog enhancements (per openspec D6). InformerService.ts also defines its own local sanitizeName — a minor duplication with the newly exported version in types.ts.

4. fetchModelCard switches from TLS-skip to standard TLS verification — Catalog.ts

Severity: low | Category: tls-behavior-change

The old Kfmr.ts used undici with rejectUnauthorized: false. The new Catalog.ts uses standard fetch(), which enforces TLS certificate verification. This is authorized by design decision D4 and is a net security improvement. In environments with self-signed certificates (common in OpenShift development clusters), callers should use NODE_EXTRA_CA_CERTS to provide the CA bundle rather than disabling verification. Since fetchModelCard is not yet called, this is informational for future wiring.

});

if (!response.ok) {
const body = await response.text();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] url-encoding

fetchModelCard encodes only spaces (.replace(/ /g, "%20")) for sourceId and modelName. Other special characters (/, ?, #, &) are not encoded, which could produce malformed URLs. Pre-existing issue from Kfmr.ts, but opportunity to use encodeURIComponent() in the fresh module.

Suggested fix: Replace .replace(/ /g, "%20") with encodeURIComponent() for both sourceId and modelName parameters.

console.log(`fetchModelCard: GET request to ${url} returned ok`);
const data: CatalogModel = await response.json();
return data.readme;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] tls-behavior-change

fetchModelCard uses standard fetch() which enforces TLS verification, unlike the old undici-based code that skipped TLS. Authorized by design decision D4. Environments with self-signed certs should use NODE_EXTRA_CA_CERTS. Not yet called in active code paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge All reviewers approved — ready to merge ready-for-review Agent PR ready for human review workspace/ai-integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ai-integrations): RHIDP-1520: kserve-kubeflow-connector-backend — Remove KubeFlow Model Registry (KFMR) client code

1 participant