Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions vicky/src/bin/vicky/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ fn run_migrations(connection: &mut impl MigrationHarness<diesel::pg::Pg>) -> Res
}
}

// Note: We cannot do anything about this return type, since it is passed to Rocket directly.
#[allow(clippy::result_large_err)]
async fn run_rocket_migrations(rocket: Rocket<Build>) -> Result<Rocket<Build>, Rocket<Build>> {
info!("Running database migrations");

Expand Down
4 changes: 2 additions & 2 deletions vicky/src/bin/vicky/task_templates.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use crate::auth::AnyAuthGuard;
use crate::errors::AppError;
use crate::events::GlobalEvent;
use diesel::result::DatabaseErrorKind;
use diesel::result::Error::DatabaseError;
use rocket::http::Status;
use rocket::serde::json::Json;
use rocket::{State, get, post};
use serde::{Deserialize, Serialize};
use vickylib::vicky::events::GlobalEvent;
use std::collections::HashMap;
use tokio::sync::broadcast;
use uuid::Uuid;
Expand Down Expand Up @@ -77,7 +77,7 @@ pub async fn task_templates_add(
display_name_template: task_template.display_name_template,
flake_ref: task_template.flake_ref,
locks: task_template.locks,
features: task_template.features,
features: task_template.features.into_iter().collect(),
group: task_template.group,
variables: task_template.variables,
created_at: chrono::Utc::now(),
Expand Down
8 changes: 4 additions & 4 deletions vicky/src/lib/database/entities/task_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub struct TaskTemplate {
pub display_name_template: String,
pub flake_ref: FlakeRef,
pub locks: Vec<TaskTemplateLock>,
pub features: Vec<String>,
pub features: HashSet<String>,
pub group: Option<String>,
pub variables: Vec<TaskTemplateVariable>,

Expand Down Expand Up @@ -326,7 +326,7 @@ impl
args: template.flake_ref_args_template,
},
locks: locks.into_iter().map(TaskTemplateLock::from).collect(),
features: template.features,
features: template.features.into_iter().collect(),
group: template.group,
variables: variables
.into_iter()
Expand Down Expand Up @@ -413,7 +413,7 @@ pub mod db_impl {
display_name_template: template.display_name_template.clone(),
flake_ref_uri_template: template.flake_ref.flake.clone(),
flake_ref_args_template: template.flake_ref.args.clone(),
features: template.features.clone(),
features: template.features.clone().into_iter().collect(),
group: template.group.clone(),
created_at: template.created_at,
}
Expand Down Expand Up @@ -589,7 +589,7 @@ mod tests {
name: "build/{{project}}".to_string(),
kind: LockKind::Write,
}],
features: vec!["ijustbuildthings".to_string()],
features: vec!["ijustbuildthings".to_string()].into_iter().collect(),
group: Some("{{env}}".to_string()),
variables: vec![
TaskTemplateVariable {
Expand Down
Loading