fix: cope with heartwood's Id->RepoId rename

Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
Lars Wirzenius
2024-01-23 17:35:46 +02:00
parent 49f6711e22
commit 3a7c8b668d
5 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -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"],
+2 -2
View File
@@ -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<bool, EngineError> {
fn run_helper(&mut self, rid: RepoId, commit: Oid) -> Result<bool, EngineError> {
// Pick a run id and create a directory for files related to
// the run.
let (run_id, run_dir) = mkdir_run(&self.config)?;
+3 -3
View File
@@ -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<Id>,
rid: Option<RepoId>,
commit: Option<Oid>,
storage: Option<PathBuf>,
timeout: Option<usize>,
@@ -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);
}
+3 -3
View File
@@ -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<Id>,
repo: Option<RepoId>,
commit: Option<Oid>,
run_id: Option<String>,
result: Option<RunResult>,
@@ -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);
}
+3 -3
View File
@@ -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<String>,
rid: Option<Id>,
rid: Option<RepoId>,
commit: Option<Oid>,
commands: Vec<Command>,
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);
}