mirror of
https://codeberg.org/Toasterson/solstice-ci.git
synced 2026-04-10 21:30:41 +00:00
Simplify variable initialization and remove unused imports across multiple crates
This commit is contained in:
parent
1b7b2dd91b
commit
374dff5c04
6 changed files with 7 additions and 10 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use clap::{Parser, Subcommand};
|
||||
use miette::{IntoDiagnostic, Result};
|
||||
use tracing::{info, warn};
|
||||
use miette::Result;
|
||||
use tracing::info;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(name = "ciadm", version, about = "Solstice CI Admin CLI")]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
use clap::{Parser, Subcommand};
|
||||
use miette::Result;
|
||||
use tracing::info;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(name = "cidev", version, about = "Solstice CI Dev CLI — validate and inspect KDL workflows")]
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ async fn enqueue_job(state: &Arc<AppState>, repo_url: String, commit_sha: String
|
|||
if repo_url.is_empty() {
|
||||
miette::bail!("missing repo_url in webhook payload");
|
||||
}
|
||||
let mut jr = common::JobRequest::new(common::SourceSystem::Forgejo, repo_url, commit_sha);
|
||||
let jr = common::JobRequest::new(common::SourceSystem::Forgejo, repo_url, commit_sha);
|
||||
// TODO: infer runs_on from repo defaults or labels
|
||||
common::publish_job(&state.mq_cfg, &jr).await?;
|
||||
info!(request_id = %jr.request_id, repo = %jr.repo_url, sha = %jr.commit_sha, "enqueued job from webhook");
|
||||
|
|
|
|||
|
|
@ -2,9 +2,7 @@ use std::{path::PathBuf, time::Duration};
|
|||
|
||||
use async_trait::async_trait;
|
||||
use miette::{Result, IntoDiagnostic as _};
|
||||
use tracing::{info, warn};
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
use tracing::info;
|
||||
|
||||
// Backend tag is used internally to remember which backend handled this VM.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ async fn main() -> Result<()> {
|
|||
let tx_for_consumer = sched_tx.clone();
|
||||
let persist_for_consumer = persist.clone();
|
||||
// Start consumer that can be shut down cooperatively on ctrl-c
|
||||
let (shutdown_tx, mut shutdown_rx) = tokio::sync::oneshot::channel::<()>();
|
||||
let (shutdown_tx, shutdown_rx) = tokio::sync::oneshot::channel::<()>();
|
||||
let consumer_task = tokio::spawn(async move {
|
||||
common::consume_jobs_until(&mq_cfg_clone, async move {
|
||||
let _ = shutdown_rx.await;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ impl VmPersistState {
|
|||
|
||||
mod jobs {
|
||||
use super::*;
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
|
||||
#[sea_orm(table_name = "jobs")]
|
||||
|
|
@ -59,7 +59,7 @@ mod jobs {
|
|||
|
||||
mod vms {
|
||||
use super::*;
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
|
||||
#[sea_orm(table_name = "vms")]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue