Repository navigation
fix(tree): show missing checkout errors without stale loading - #2224
Open
nuclearcat wants to merge 2 commits into
Open
nuclearcat wants to merge 2 commits into
nuclearcat wants to merge 2 commits into
Conversation
Distinguish absent tree resources from existing checkouts without results. Stop rendering details and dependent history after a failed lookup, and preserve the requested URL with a specific not-found message. Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
Member
Author
Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Opening a nonexistent branch such as
stable/linux-5.925.ydisplayed the supplied commit hash, zero counts, comparison controls, a no-results warning, and a persistentLoading...message. The header came from the URL, while the failed summary left the history query disabled.Return a specific API 404 for a missing tree, branch, or commit/tag within the selected origin. The summary, full-details, and latest-checkout endpoints share the existence check. Existing checkouts without results remain HTTP 200, and result filters do not determine existence. Successful data lookups need no extra queries; failed lookups use up to three existence queries over the existing checkout indexes. A query parameter can no longer override the branch in a direct URL.
The frontend shows one page-level error at the original URL, with a Back to Trees link. It hides unvalidated details and dependent history, avoids retrying 404 responses, and keeps placeholder data only while filtering the same checkout. Unknown-tree shortcuts use the same error view.
Part of #1630. This PR addresses the API and frontend behavior. Returning HTTP 404 for the initial SPA document and rejecting unsupported paths in nginx remain open under that issue.
How to test
/tree/stable/linux-5.925.y/29c6cdaac04a6989a7ed4ae4275ce4244e617f58?df%7Cbs%7CFAIL=true. ExpectBranch not found, the requested branch/tree/origin, and a Back to Trees link. If the database has nostabletree, expectTree not foundinstead. There should be no zero-count tabs, comparison control, history request, or lingeringLoading..../tree/unknown/masterand the/checkout/and/c/shortcut routes. Click Back to Trees and confirm the selected origin is retained.cd dashboard && pnpm exec playwright test e2e/tree-not-found.spec.tswith Vite running. These six deterministic browser tests intercept API responses and include client-side navigation from a valid cached checkout to a missing branch.DB_HOST,DB_PORT,DB_NAME,DB_USER, andDB_PASSWORD, runcd backend && poetry run pytest kernelCI_app/tests/integrationTests/treeNotFound_test.py --ds=kernelCI.test_settings -n 0 --reruns 0. This exercises real database queries and the API views, including tags, origin scoping, filters, empty checkouts, and branch-parameter precedence.Validation
Rendered before/after evidence is attached in a PR comment. The before image uses the original frontend with the reported HTTP-200 no-results response. The after image uses the changed frontend with the real local Django API and an isolated database containing a valid
stable/linux-6.1.ycheckout. Neither image is committed.