fix: Updated projects-list.json in order to display newly added projects - #6657
fix: Updated projects-list.json in order to display newly added projects#6657AdityaPatil22 wants to merge 4 commits into
Conversation
franciscojavierarceo
left a comment
There was a problem hiding this comment.
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.
|
@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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
@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 I think we can :
|
767f7f8 to
aa3e43a
Compare
|
@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.
|
| | Production (frequent schema changes) | `thread` | 60 | | ||
|
|
||
| ### UI refresh | ||
|
|
There was a problem hiding this comment.
I think better place to add these docs is at docs/reference/alpha-web-ui.md
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
this change is not required and can be kept same as original
There was a problem hiding this comment.
Reverted the changes to original state
| def get_projects_list(): | ||
| return _build_projects_list(store, project_id, root_path) | ||
|
|
||
| @app.post("/api/registry/refresh") |
There was a problem hiding this comment.
this endpoint should be on REST API server
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
This refresh button should be accessible from any page, also you can use a proper labeled button for refresh
There was a problem hiding this comment.
Moved the refresh button to header bar for it to be accessible from every page.
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>
35cdf51 to
43193f2
Compare
| isLoading={refreshing} | ||
| size="s" | ||
| > | ||
| Refresh Registry |
There was a problem hiding this comment.
just Refresh would work, "Refresh Registry" - too technical for end user
| const parsed = ProjectsListSchema.parse(json); | ||
| queryClient.setQueryData("feast-projects-list", parsed); | ||
| } finally { | ||
| setRefreshing(false); |
There was a problem hiding this comment.
No user feedback on success or failure, Add EuiToast / EuiGlobalToastList with message like "Refresh successful/failed"
| {!data && <EuiFlexItem />} | ||
|
|
||
| <EuiFlexItem grow={false}> | ||
| <EuiButton |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
it's not just refreshing project list, it's refreshing complete registry
| @@ -1,6 +1,7 @@ | |||
| import React, { useState, useRef, useEffect } from "react"; | |||
| import React, { useState, useRef, useEffect, useContext } from "react"; | |||
There was a problem hiding this comment.
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.


What this PR does / why we need it:
projects-list.jsonwas written as a static file once at server startup and never refreshed. When a user ranfeast applyto 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
git commit -s)Testing Strategy
Misc
Existing
test_projects_list_*tests updated to hit the dynamic endpoint viaTestClientinstead of reading the static file from disk. New testtest_projects_list_dynamic_refreshverifies that mutating the registry afterget_appis reflected in subsequent requests — the core assertion for #6650.