syntax = "proto3"; package gitks; import "repository.proto"; // HookService provides gRPC callback hooks for git operations. // External services can implement this interface to receive hook callbacks. service HookService { // Pre-receive hook callback: validate push before it happens. rpc PreReceiveHook(PreReceiveHookRequest) returns (PreReceiveHookResponse); // Update hook callback: validate each ref update individually. rpc UpdateHook(UpdateHookRequest) returns (UpdateHookResponse); // Post-receive hook callback: notify after push has completed. rpc PostReceiveHook(PostReceiveHookRequest) returns (PostReceiveHookResponse); } message PreReceiveHookRequest { RepositoryHeader repository = 1; repeated RefUpdate ref_updates = 2; string push_options = 3; } message PreReceiveHookResponse { bool accept = 1; string rejection_message = 2; } message UpdateHookRequest { RepositoryHeader repository = 1; string ref_name = 2; string old_oid = 3; string new_oid = 4; } message UpdateHookResponse { bool accept = 1; string rejection_message = 2; } message PostReceiveHookRequest { RepositoryHeader repository = 1; repeated RefUpdate ref_updates = 2; } message PostReceiveHookResponse { repeated HookAction actions = 1; } message RefUpdate { string old_oid = 1; string new_oid = 2; string ref_name = 3; } message HookAction { string action_type = 1; // "trigger_ci", "update_index", etc. string payload = 2; }