From de51e04590d94dea3ca11b81f4f51a97e0b9da83 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 8 Sep 2026 14:09:59 +0300 Subject: [PATCH] feat: define an adapter protocol version number constant --- adapterlib/src/lib.rs | 5 +++++ src/msg.rs | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/adapterlib/src/lib.rs b/adapterlib/src/lib.rs index b78ed571..f8516c0b 100644 --- a/adapterlib/src/lib.rs +++ b/adapterlib/src/lib.rs @@ -31,6 +31,11 @@ use crate::copy_tree::{CopyTreeError, copy_tree}; mod copy_tree; +/// Version of the broker/adapter protocol used. +/// This gets put into every [`Request`] message so the adapter can +/// detect its getting a message it knows how to handle. +pub const PROTOCOL_VERSION: usize = 1; + /// The type of a run identifier. For maximum generality, this is a /// string rather than an integer. /// diff --git a/src/msg.rs b/src/msg.rs index 2f8e43f3..41f5d50d 100644 --- a/src/msg.rs +++ b/src/msg.rs @@ -31,7 +31,7 @@ pub use radicle::{ }; pub use radicle_surf::Commit; -pub use radicle_ci_adapter::{Patch, Request, Response, RunId, RunResult}; +pub use radicle_ci_adapter::{PROTOCOL_VERSION, Patch, Request, Response, RunId, RunResult}; use crate::{ ci_event::{CiEvent, CiEventV1}, @@ -39,10 +39,6 @@ use crate::{ logger, }; -// This gets put into every [`Request`] message so the adapter can -// detect its getting a message it knows how to handle. -const PROTOCOL_VERSION: usize = 1; - /// Build a [`Request`]. #[derive(Debug, Default)] pub struct RequestBuilder<'a> {