Add remote codebase indexing stubs and proto definitions#10536
Add remote codebase indexing stubs and proto definitions#10536moirahuang wants to merge 1 commit intomasterfrom
Conversation
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds remote codebase indexing protobuf messages, client/manager request stubs, server placeholder handlers, and first-seen NotEnabled status pushes for git repos.
Concerns
ServerModelnow has a required field, but the existing server model test fixture still constructs it with a struct literal, so the app tests will fail to compile.- The new navigation status tracking can recreate per-connection state after a connection has already been deregistered, leaving stale entries behind for dead connections.
- Index/drop requests can send the current user's auth token through an arbitrary connected session for the host instead of a session whose
identity_keymatches the current auth context.
Security
- The index/drop mutation path should mirror
rotate_auth_token's identity-key filtering before retrieving and sending the current bearer token.
Verdict
Found: 1 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| /// Until the daemon has a persisted indexing manager, first-seen git repos | ||
| /// become explicit `NotEnabled` entries so the client can observe the repo | ||
| /// instead of treating an absent status as meaningful state. | ||
| codebase_index_status_sent_roots_by_connection: |
There was a problem hiding this comment.
🚨 [CRITICAL] Adding this required field breaks the test_model() struct literal in app/src/remote_server/server_model_tests.rs; update that fixture or construct through ServerModel::new so the app tests compile.
| if is_git { | ||
| let should_send_status = me | ||
| .codebase_index_status_sent_roots_by_connection | ||
| .entry(conn_id_for_response) |
There was a problem hiding this comment.
deregister_connection removed this connection, entry(...).or_default() recreates state for a dead connection and it is never cleaned up; use get_mut and skip the push when the connection entry is gone.
| + Send | ||
| + 'static, | ||
| { | ||
| let Some((session_id, client, remote_identity_key)) = |
There was a problem hiding this comment.
auth_context.remote_server_identity_key() like rotate_auth_token before selecting the client to avoid leaking tokens to stale sessions from another identity.
This change adds placeholder stubs and messages for remote codebase indexing.
ListCodebaseIndexStatuses,IndexCodebase, andDropCodebaseIndexmessages to the protobuf definitions.handle_list_codebase_index_statuses,handle_index_codebase, andhandle_drop_codebase_indexmethods inServerModel. These methods currently log placeholder messages.codebase_index_status_sent_roots_by_connectionfield toServerModelto track which git repos have had their initial status pushed to the client.ListCodebaseIndexStatusesrequests.NotEnabledstatus update to the client.