Skip to content

Commit

Permalink
chore: make actor create runtime optional & fix inconsistent snake ca…
Browse files Browse the repository at this point in the history
…se in api (#1494)

<!-- Please make sure there is an issue that this PR is correlated to. -->

## Changes

<!-- If there are frontend changes, please include screenshots. -->
  • Loading branch information
NathanFlurry committed Dec 1, 2024
1 parent b63ae81 commit f260ab5
Show file tree
Hide file tree
Showing 26 changed files with 54 additions and 67 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/api/actor/src/route/actors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pub async fn create(
// args: body.runtime.arguments.unwrap_or_default(),
args: Vec::new(),
network_mode: network.mode.unwrap_or_default().api_into(),
environment: body.runtime.environment.unwrap_or_default(),
environment: body.runtime.and_then(|r| r.environment).unwrap_or_default(),
network_ports: unwrap!(network
.ports
.unwrap_or_default()
Expand Down Expand Up @@ -331,9 +331,9 @@ pub async fn create_deprecated(
cpu: body.resources.cpu,
memory: body.resources.memory,
}),
runtime: Box::new(models::ActorCreateActorRuntimeRequest {
runtime: Some(Box::new(models::ActorCreateActorRuntimeRequest {
environment: body.runtime.environment,
}),
})),
build: Some(body.runtime.build),
build_tags: None,
tags: body.tags,
Expand Down
3 changes: 1 addition & 2 deletions packages/services/build/ops/create/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ async fn handle(
.await?;
let game = game_res.games.first();
ensure!(game.is_some(), "game not found");
}
else if let Some(env_id) = env_id {
} else if let Some(env_id) = env_id {
let env_res = op!([ctx] game_namespace_get {
namespace_ids: vec![env_id.into()],
})
Expand Down
8 changes: 4 additions & 4 deletions sdks/api/fern/definition/actor/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ types:
region: optional<string>
tags: unknown
build: optional<uuid>
buildTags: optional<unknown>
runtime: CreateActorRuntimeRequest
build_tags: optional<unknown>
runtime: optional<CreateActorRuntimeRequest>
network: optional<CreateActorNetworkRequest>
resources: commons.Resources
lifecycle: optional<commons.Lifecycle>
Expand Down Expand Up @@ -145,7 +145,7 @@ types:
UpgradeActorRequest:
properties:
build: optional<uuid>
buildTags: optional<unknown>
build_tags: optional<unknown>

UpgradeActorResponse:
properties: {}
Expand All @@ -154,7 +154,7 @@ types:
properties:
tags: unknown
build: optional<uuid>
buildTags: optional<unknown>
build_tags: optional<unknown>

UpgradeAllActorsResponse:
properties:
Expand Down
6 changes: 3 additions & 3 deletions sdks/api/full/go/actor/actor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions sdks/api/full/openapi/openapi.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions sdks/api/full/openapi_compat/openapi.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdks/api/full/rust-cli/docs/ActorCreateActorRequest.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions sdks/api/full/rust-cli/src/models/actor_create_actor_request.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdks/api/full/rust/docs/ActorCreateActorRequest.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions sdks/api/full/rust/src/models/actor_create_actor_request.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions sdks/api/runtime/go/actor/actor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions sdks/api/runtime/openapi/openapi.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f260ab5

Please sign in to comment.