Skip to content

fix: Make feature server URL configurable#6020

Open
kchawlani19 wants to merge 1 commit intofeast-dev:masterfrom
kchawlani19:fix/feature-server-url
Open

fix: Make feature server URL configurable#6020
kchawlani19 wants to merge 1 commit intofeast-dev:masterfrom
kchawlani19:fix/feature-server-url

Conversation

@kchawlani19
Copy link

@kchawlani19 kchawlani19 commented Feb 25, 2026

Summary

  • Default curl generator URL can be set with REACT_APP_FEAST_FEATURE_SERVER_URL
  • Falls back to http://localhost:6566
  • Keeps existing localStorage behavior

Test plan

  • Open UI and verify Curl Generator default URL

Open with Devin

@kchawlani19 kchawlani19 requested a review from a team as a code owner February 25, 2026 09:51
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@kchawlani19 kchawlani19 changed the title Make feature server URL configurable in UI fix(ui): make feature server URL configurable Feb 25, 2026
@kchawlani19 kchawlani19 force-pushed the fix/feature-server-url branch from 3082026 to b641677 Compare February 25, 2026 10:10
@ntkathole ntkathole changed the title fix(ui): make feature server URL configurable fix: Make feature server URL configurable Feb 25, 2026
@ntkathole ntkathole force-pushed the fix/feature-server-url branch from b641677 to c3ea607 Compare February 25, 2026 13:16
Copy link
Member

Choose a reason for hiding this comment

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

need to change placeholder as well

feastObjectQuery,
}: RegularFeatureViewCustomTabProps) => {
const data = feastObjectQuery.data as any;
const defaultServerUrl =
Copy link
Member

Choose a reason for hiding this comment

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

I think it could be a module-level constant, declaring it inside the component means it gets re-evaluated on every render

@ntkathole
Copy link
Member

Can we also add the documentation ?

Signed-off-by: kchawlani19 <kchawlan@redhat.com>
Made-with: Cursor
@kchawlani19 kchawlani19 force-pushed the fix/feature-server-url branch from c3ea607 to 0000261 Compare March 5, 2026 19:44
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

Copy link
Contributor

Choose a reason for hiding this comment

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

🟡 useEffect unconditionally persists default URL to localStorage, preventing env var updates from taking effect for returning users

The useEffect on line 35-37 saves serverUrl to localStorage on every change, including the initial render. When a user first visits the page, the defaultServerUrl (from the env var) is immediately persisted to localStorage. If an admin later changes REACT_APP_FEAST_FEATURE_SERVER_URL and rebuilds the app, returning users will still see the old URL because localStorage (containing the old default) takes precedence over the new env var value in the useState initializer at line 26-28. This undermines the stated purpose of this PR — making the default URL configurable — since the configuration change only affects brand-new users who have never visited the page.

A fix would be to only write to localStorage when the user explicitly edits the URL (e.g., in the onChange handler), or to store a flag distinguishing user-edited values from auto-persisted defaults.

(Refers to lines 35-37)

Prompt for agents
In ui/src/pages/feature-views/CurlGeneratorTab.tsx, the useEffect at lines 35-37 unconditionally persists serverUrl to localStorage on every change including the initial default value. This means if the admin changes REACT_APP_FEAST_FEATURE_SERVER_URL and rebuilds, returning users will still see the old default.

To fix this, persist the URL to localStorage only when the user explicitly edits it. One approach:

1. Remove the useEffect that auto-saves serverUrl to localStorage (lines 35-37).
2. In the onChange handler for the EuiFieldText (around line 112), save to localStorage there:
   onChange={(e) => {
     setServerUrl(e.target.value);
     localStorage.setItem("feast-feature-server-url", e.target.value);
   }}

This way, localStorage only contains a value if the user explicitly typed one, and the env var default will always be respected for users who haven't customized the URL.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Member

Choose a reason for hiding this comment

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

@kchawlani19 this needs to be handled, move localStorage.setItem into the onChange handler and drop the useEffect

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