Skip to content

fix: Updated projects-list.json in order to display newly added projects - #6657

Open
AdityaPatil22 wants to merge 4 commits into
feast-dev:masterfrom
AdityaPatil22:fix/new-project-display-SQL-reg
Open

fix: Updated projects-list.json in order to display newly added projects#6657
AdityaPatil22 wants to merge 4 commits into
feast-dev:masterfrom
AdityaPatil22:fix/new-project-display-SQL-reg

Conversation

@AdityaPatil22

Copy link
Copy Markdown

What this PR does / why we need it:

projects-list.json was written as a static file once at server startup and never refreshed. When a user ran feast apply to create a new project while the UI was running, the new project never appeared in the UI's project list.

This PR replaces the static file write with a dynamic FastAPI route (GET /projects-list.json) that queries the registry on each request, so newly created projects appear immediately on page refresh.

Which issue(s) this PR fixes:

Fixes #6650

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests
  • Manual tests
  • Testing is not required for this change

Misc

Existing test_projects_list_* tests updated to hit the dynamic endpoint via TestClient instead of reading the static file from disk. New test test_projects_list_dynamic_refresh verifies that mutating the registry after get_app is reflected in subsequent requests — the core assertion for #6650.

@AdityaPatil22
AdityaPatil22 requested a review from a team as a code owner July 29, 2026 11:37

@franciscojavierarceo franciscojavierarceo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Moving projects-list.json behind a route avoids freezing the response at startup, but _build_projects_list() still calls list_projects(allow_cache=True). With the default registry cache TTL of 600 seconds, a newly added project can remain absent for up to ten minutes—the exact startup-empty case this is intended to fix. Please consider an uncached read (or explicit refresh) for this low-frequency UI endpoint and add the regression test described in the PR body; the current diff changes only ui_server.py and contains no test update.

@AdityaPatil22

Copy link
Copy Markdown
Author

@franciscojavierarceo - Updated _build_projects_list to use allow_cache=False so new projects are visible immediately. Also added the regression test (test_projects_list_dynamic_refresh) and updated the existing tests to hit the dynamic endpoint via TestClient instead of reading the static file from disk.

@codecov-commenter

codecov-commenter commented Jul 30, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.46%. Comparing base (c8628eb) to head (43193f2).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6657   +/-   ##
=======================================
  Coverage   46.45%   46.46%           
=======================================
  Files         414      414           
  Lines       50138    50145    +7     
  Branches     7173     7173           
=======================================
+ Hits        23294    23301    +7     
  Misses      25204    25204           
  Partials     1640     1640           
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 47.77% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/ui_server.py 25.56% <100.00%> (+0.92%) ⬆️

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 c8628eb...43193f2. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ntkathole

Copy link
Copy Markdown
Member

@AdityaPatil22 This turns every browser refresh into a full database round-trip, completely bypassing the caching layer that Feast deliberately built.

The fix should keep allow_cache=True and let the existing TTL handle staleness. Users who need faster UI refresh can already set cache_ttl_seconds: 10 (or whatever suits them) in their config.

I think we can :

  • Document that users can lower cache_ttl_seconds for faster UI refresh.
  • Add a Refresh button in the UI that calls store.registry.refresh() (via a new POST /api/registry/refresh endpoint). This lets users explicitly invalidate the cache on demand without adding hidden performance costs on every page load.

@AdityaPatil22
AdityaPatil22 force-pushed the fix/new-project-display-SQL-reg branch from 767f7f8 to aa3e43a Compare July 30, 2026 10:06
@AdityaPatil22

Copy link
Copy Markdown
Author

@ntkathole - I have added a refresh button in the UI which lets the users invalidate the cache on demand. Please let me know if there needs to be any change in the UI for the button.

Screenshot 2026-07-30 at 3 31 41 PM

| Production (frequent schema changes) | `thread` | 60 |

### UI refresh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think better place to add these docs is at docs/reference/alpha-web-ui.md

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Moved the docs to docs/reference/alpha-web-ui.md file


ui_dir_ref = importlib_resources.files(__spec__.parent) / "ui/build/" # type: ignore[name-defined, arg-type]
with importlib_resources.as_file(ui_dir_ref) as ui_dir:
projects_dict = _build_projects_list(store, project_id, root_path)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this change is not required and can be kept same as original

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Reverted the changes to original state

Comment thread sdk/python/feast/ui_server.py Outdated
def get_projects_list():
return _build_projects_list(store, project_id, root_path)

@app.post("/api/registry/refresh")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this endpoint should be on REST API server

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Moved the endpoint from the main app to rest_app inside _setup_rest_mode, so it's now served at /api/v1/registry/refresh on the REST API server.

</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This refresh button should be accessible from any page, also you can use a proper labeled button for refresh

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Moved the refresh button to header bar for it to be accessible from every page.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Screenshot 2026-07-30 at 9 58 55 PM

Aditya Patil added 4 commits July 30, 2026 22:02
Signed-off-by: Aditya Patil <adpatil@redhat.com>
Signed-off-by: Aditya Patil <adpatil@redhat.com>
Signed-off-by: Aditya Patil <adpatil@redhat.com>
Signed-off-by: Aditya Patil <adpatil@redhat.com>
@AdityaPatil22
AdityaPatil22 force-pushed the fix/new-project-display-SQL-reg branch from 35cdf51 to 43193f2 Compare July 30, 2026 16:32
@AdityaPatil22
AdityaPatil22 requested a review from ntkathole July 30, 2026 16:40
Comment thread ui/src/pages/Layout.tsx
isLoading={refreshing}
size="s"
>
Refresh Registry

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just Refresh would work, "Refresh Registry" - too technical for end user

Comment thread ui/src/pages/Layout.tsx
const parsed = ProjectsListSchema.parse(json);
queryClient.setQueryData("feast-projects-list", parsed);
} finally {
setRefreshing(false);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No user feedback on success or failure, Add EuiToast / EuiGlobalToastList with message like "Refresh successful/failed"

Comment thread ui/src/pages/Layout.tsx
{!data && <EuiFlexItem />}

<EuiFlexItem grow={false}>
<EuiButton

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use EuiButtonEmpty or EuiButtonIcon with a tooltip instead of a filled button
Or use color="text" to make it less prominent than default primary


Examples of custom tabs can be found in the `ui/custom-tabs` folder.

## Refreshing the project list

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it's not just refreshing project list, it's refreshing complete registry

Comment thread ui/src/pages/Layout.tsx
@@ -1,6 +1,7 @@
import React, { useState, useRef, useEffect } from "react";
import React, { useState, useRef, useEffect, useContext } from "react";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If a user lands on the project selection page and doesn't see their project, the Refresh button in the Layout header isn't visible - they have to first pick a project, then refresh.

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.

Feast UI fails to display newly created project after feast apply when using SQL registry

4 participants