Skip to content

Commit

Permalink
feat: add hash to bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterPtato committed Sep 25, 2024
1 parent f07b095 commit a9bee68
Show file tree
Hide file tree
Showing 45 changed files with 212 additions and 183 deletions.
1 change: 1 addition & 0 deletions fern/definition/cloud/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ types:
origins: BootstrapOrigins
captcha: BootstrapCaptcha
login_methods: BootstrapLoginMethods
deploy_hash: string

BootstrapCluster:
docs: The type of cluster that the backend is currently running.
Expand Down
61 changes: 34 additions & 27 deletions lib/bolt/core/src/context/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,33 +510,35 @@ impl ServiceContextData {
);
}

let can_depend =
if self.is_monolith_worker() {
matches!(
dep.config().kind,
ServiceKind::Database { .. }
| ServiceKind::Cache { .. } | ServiceKind::Operation { .. }
| ServiceKind::Package { .. }
| ServiceKind::Consumer { .. }
)
} else if matches!(self.config().kind, ServiceKind::Api { .. }) {
matches!(
dep.config().kind,
ServiceKind::Database { .. }
| ServiceKind::Cache { .. } | ServiceKind::Operation { .. }
| ServiceKind::Package { .. }
| ServiceKind::ApiRoutes { .. }
| ServiceKind::Consumer { .. }
)
} else {
matches!(
dep.config().kind,
ServiceKind::Database { .. }
| ServiceKind::Cache { .. } | ServiceKind::Operation { .. }
| ServiceKind::Package { .. }
| ServiceKind::Consumer { .. }
)
};
let can_depend = if self.is_monolith_worker() {
matches!(
dep.config().kind,
ServiceKind::Database { .. }
| ServiceKind::Cache { .. }
| ServiceKind::Operation { .. }
| ServiceKind::Package { .. }
| ServiceKind::Consumer { .. }
)
} else if matches!(self.config().kind, ServiceKind::Api { .. }) {
matches!(
dep.config().kind,
ServiceKind::Database { .. }
| ServiceKind::Cache { .. }
| ServiceKind::Operation { .. }
| ServiceKind::Package { .. }
| ServiceKind::ApiRoutes { .. }
| ServiceKind::Consumer { .. }
)
} else {
matches!(
dep.config().kind,
ServiceKind::Database { .. }
| ServiceKind::Cache { .. }
| ServiceKind::Operation { .. }
| ServiceKind::Package { .. }
| ServiceKind::Consumer { .. }
)
};

if !can_depend {
panic!(
Expand Down Expand Up @@ -771,6 +773,11 @@ impl ServiceContextData {
let source_hash = self.source_hash_dev(&BuildOptimization::Debug).await?;
env.insert("RIVET_SOURCE_HASH".into(), source_hash.clone());

env.insert(
"RIVET_PROJECT_SOURCE_HASH".into(),
project_ctx.source_hash(),
);

let ns_service_config = self.ns_service_config().await;
env.insert(
"TOKIO_WORKER_THREADS".into(),
Expand Down
2 changes: 1 addition & 1 deletion lib/convert/src/impls/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl ApiTryFrom<cluster::types::Datacenter> for models::AdminClustersDatacenter
.map(|p| {
Ok(models::AdminClustersPool {
desired_count: p.desired_count.try_into()?,
drain_timeout: p.drain_timeout.try_into()?,
drain_timeout_ms: p.drain_timeout.try_into()?,
hardware: p
.hardware
.iter()
Expand Down
12 changes: 6 additions & 6 deletions sdks/full/go/admin/clusters/types.go

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

1 change: 1 addition & 0 deletions sdks/full/go/cloud/cloud.go

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

8 changes: 4 additions & 4 deletions sdks/full/go/servers/builds/client.go

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

2 changes: 1 addition & 1 deletion sdks/full/go/servers/datacenters/client.go

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

2 changes: 1 addition & 1 deletion sdks/full/go/servers/logs/client.go

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

19 changes: 11 additions & 8 deletions sdks/full/openapi/openapi.yml

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

19 changes: 11 additions & 8 deletions sdks/full/openapi_compat/openapi.yml

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

12 changes: 6 additions & 6 deletions sdks/full/rust-cli/README.md

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

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

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

1 change: 1 addition & 0 deletions sdks/full/rust-cli/docs/CloudBootstrapResponse.md

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

Loading

0 comments on commit a9bee68

Please sign in to comment.