-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add creating actor by build tags, upgrading actors (#1388)
<!-- Please make sure there is an issue that this PR is correlated to. --> Fixes RVT-4130 ## Changes <!-- If there are frontend changes, please include screenshots. -->
- Loading branch information
1 parent
76089bb
commit b1fc1aa
Showing
82 changed files
with
1,833 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,4 +48,3 @@ | |
<shard>01</shard> | ||
</macros> | ||
</clickhouse> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/common/formatted-error/errors/builds/build-not-found-with-tags.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
name = "BUILDS_BUILD_NOT_FOUND_WITH_TAGS" | ||
description = "Build not found with the given tags." | ||
http_status = 400 | ||
--- | ||
|
||
# Build Not Found With Tags | ||
|
||
Build not found for given tags. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod get; | ||
pub mod patch_tags; | ||
pub mod prewarm_ats; | ||
pub mod resolve_for_tags; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
use std::{collections::HashMap, convert::TryInto}; | ||
|
||
use chirp_workflow::prelude::*; | ||
|
||
use super::get::BuildRow; | ||
use crate::types; | ||
|
||
#[derive(Debug)] | ||
pub struct Input { | ||
pub game_id: Option<Uuid>, | ||
pub tags: HashMap<String, String>, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Output { | ||
pub builds: Vec<types::Build>, | ||
} | ||
|
||
#[operation] | ||
pub async fn get(ctx: &OperationCtx, input: &Input) -> GlobalResult<Output> { | ||
let builds = sql_fetch_all!( | ||
[ctx, BuildRow] | ||
" | ||
SELECT | ||
build_id, | ||
game_id, | ||
env_id, | ||
upload_id, | ||
display_name, | ||
image_tag, | ||
create_ts, | ||
kind, | ||
compression, | ||
tags | ||
FROM db_build.builds | ||
WHERE | ||
($2 IS NULL OR game_id = $2) AND | ||
tags @> $1 | ||
", | ||
input.game_id, | ||
serde_json::to_string(&input.tags)?, | ||
) | ||
.await? | ||
.into_iter() | ||
.map(|build| build.try_into()) | ||
.collect::<GlobalResult<Vec<_>>>()?; | ||
|
||
Ok(Output { builds }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.