Repository navigation
test(desktop): command registry covers the forge wrappers (#258) - #268
Merged
Merged
Conversation
The registry test scanned backend.ts, backend-core.ts and backend-ai.ts by name, so the 138 commands only backend-pr.ts, backend-gitlab.ts, backend-gitea.ts and backend-bitbucket.ts invoke had no entry. The test now lists every src/utils/backend*.ts. findDevServerRoutes also reads case labels: the Gitea read routes live in the /api/gitea- prefix dispatcher as case "/api/gitea-..." and were invisible to the url.pathname === scan. New entries: 37 with a route (4 marked cliPathOnly), 4 desktop-only (keychain credentials, open_url), 97 GAPs.
…reach it (#258) findDevServerRoutes accepted any case "/api/..." label as a served route. It now collects the url.pathname.startsWith("/api/...") dispatchers and accepts a label only inside that dispatcher's block and under its prefix. ROADMAP: follow-ups from #258 (gh-pr-comment on forks under dev:web, the 97 forge GAPs, git_file_diff missing from Rust).
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.
Fixes #258.
What
commandRegistry.test.tsscans everysrc/utils/backend*.ts(directory listing, not a fixed list) and fails if one of the 7 known wrapper files is missing from the scan. The stale-entry check now runs on all 305 invoked commands.findDevServerRoutesalso readscase "/api/…"labels, but only inside aurl.pathname.startsWith("/api/…")dispatcher block and only when the label starts with that prefix (brace counting; limit documented in the code). This is what lets it see the 8 Gitea read routes; against the currentdev-server.mjsit finds main's 186 routes plus exactly those 8.commandRegistry.ts: 138 new entries.GAP:Each route was taken from the wrapper's web branch and checked against the dev-server handler.
cliPathOnlymarksgh_merge_pr,gh_enable_auto_merge,gh_disable_auto_mergeandpr_files: the route always runsgh, while Rust uses REST when a token is set. Desktop-only: the three keychain commands andopen_url. The GitHub device-flow/token routes are mocks, noted in the file.No new dev-server routes in this PR: the 97
GAP:entries (Azure, Bitbucket PRs, most GitLab MRs, Gitea beyond reads, some GitHub PR actions/reactions/auth) are now listed and measurable.Found on the way (not fixed here, listed in ROADMAP › Later)
backend.tsinvokesgit_file_diff(getGitFileDiff, used byFileHistoryViewer.vue), but no Rust command by that name exists — that diff likely fails in the desktop app while working under dev:web. The registry can't catch it: it checks dev-server routes, not Rust registration./api/gh-pr-comment(create/update/delete) targets origin, and the update/delete web wrappers send no PR number, so dev:web QA of comment edits on forks isn't representative.Tests
Registry tests 23/23, full desktop vitest green,
vue-tscclean.