From 3a7c8b668d054b21cd670bf0fb5aa751861adef0 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 23 Jan 2024 17:35:46 +0200 Subject: [PATCH] fix: cope with heartwood's Id->RepoId rename Signed-off-by: Lars Wirzenius --- src/bin/run_log.rs | 4 ++-- src/engine.rs | 4 ++-- src/run.rs | 6 +++--- src/runinfo.rs | 6 +++--- src/runlog.rs | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/bin/run_log.rs b/src/bin/run_log.rs index 0f226ac..a6f3d19 100644 --- a/src/bin/run_log.rs +++ b/src/bin/run_log.rs @@ -1,6 +1,6 @@ use std::path::Path; -use radicle_ci_broker::msg::{Id, Oid}; +use radicle_ci_broker::msg::{Oid, RepoId}; use radicle_native_ci::runlog::RunLog; @@ -8,7 +8,7 @@ use radicle_native_ci::runlog::RunLog; fn main() { let mut run_log = RunLog::new(Path::new("testlog.html")); run_log.title("Some Title"); - run_log.rid(Id::from_urn("rad:z3qg5TKmN83afz2fj9z3fQjU8vaYE").expect("rid")); + run_log.rid(RepoId::from_urn("rad:z3qg5TKmN83afz2fj9z3fQjU8vaYE").expect("rid")); run_log.commit(Oid::try_from("b788f7ffd38572614457adb1656c0b4575b941dd").expect("commit")); run_log.runcmd( &["git", "pull"], diff --git a/src/engine.rs b/src/engine.rs index d4b0c01..602b9ee 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -3,7 +3,7 @@ use std::path::PathBuf; use uuid::Uuid; use radicle::prelude::Profile; -use radicle_ci_broker::msg::{Id, Oid, Request, RunId, RunResult}; +use radicle_ci_broker::msg::{Oid, RepoId, Request, RunId, RunResult}; use crate::{ config::{Config, ConfigError}, @@ -140,7 +140,7 @@ impl Engine { // Execute the CI run. Log any problems to a log for this run, and // persist that. Update the run info builder as needed. - fn run_helper(&mut self, rid: Id, commit: Oid) -> Result { + fn run_helper(&mut self, rid: RepoId, commit: Oid) -> Result { // Pick a run id and create a directory for files related to // the run. let (run_id, run_dir) = mkdir_run(&self.config)?; diff --git a/src/run.rs b/src/run.rs index 3cd929b..423d143 100644 --- a/src/run.rs +++ b/src/run.rs @@ -3,7 +3,7 @@ use std::{ process::Command, }; -use radicle_ci_broker::msg::{Id, Oid}; +use radicle_ci_broker::msg::{Oid, RepoId}; use crate::{ msg::NativeMessageError, @@ -29,7 +29,7 @@ const RUNSPEC_PATH: &str = ".radicle/native.yaml"; #[derive(Debug)] pub struct Run { run_log: RunLog, - rid: Option, + rid: Option, commit: Option, storage: Option, timeout: Option, @@ -52,7 +52,7 @@ impl Run { } /// Set the git repository to use for this run. - pub fn set_repository(&mut self, rid: Id) { + pub fn set_repository(&mut self, rid: RepoId) { self.rid = Some(rid); } diff --git a/src/runinfo.rs b/src/runinfo.rs index 6d39898..f23f2b8 100644 --- a/src/runinfo.rs +++ b/src/runinfo.rs @@ -3,7 +3,7 @@ use std::path::{Path, PathBuf}; use serde::{Deserialize, Serialize}; use time::{macros::format_description, OffsetDateTime}; -use radicle_ci_broker::msg::{Id, Oid, RunId, RunResult}; +use radicle_ci_broker::msg::{Oid, RepoId, RunId, RunResult}; /// Metadata about a run. #[derive(Debug, Serialize, Deserialize)] @@ -52,7 +52,7 @@ impl RunInfo { #[derive(Debug, Default)] #[allow(dead_code)] pub struct RunInfoBuilder { - repo: Option, + repo: Option, commit: Option, run_id: Option, result: Option, @@ -61,7 +61,7 @@ pub struct RunInfoBuilder { } impl RunInfoBuilder { - pub fn repo(&mut self, repo: Id) { + pub fn repo(&mut self, repo: RepoId) { self.repo = Some(repo); } diff --git a/src/runlog.rs b/src/runlog.rs index 65ba9af..d23a098 100644 --- a/src/runlog.rs +++ b/src/runlog.rs @@ -2,7 +2,7 @@ use std::path::{Path, PathBuf}; use html_page::{Document, Element, Tag}; -use radicle_ci_broker::msg::{Id, Oid}; +use radicle_ci_broker::msg::{Oid, RepoId}; use crate::runspec::RunSpecError; @@ -10,7 +10,7 @@ use crate::runspec::RunSpecError; pub struct RunLog { filename: PathBuf, title: Option, - rid: Option, + rid: Option, commit: Option, commands: Vec, timeout: bool, @@ -29,7 +29,7 @@ impl RunLog { self.title = Some(title.into()); } - pub fn rid(&mut self, rid: Id) { + pub fn rid(&mut self, rid: RepoId) { self.rid = Some(rid); }