Skip to content

Commit cd9c4f9

Browse files
authored
Final fixes for 1.3.0 (#2174)
* lazy selected profile logging (which fixed the completion command) * added missing commands and fields * fix serve-app-manifest-json-schema * update schema in manifest * update golem-ai and golem-agentic * update golem-agentic * cleanup templates + test deployment together * llm chat agent * cleanups * fix agent template * fix llm agent template * update agentic + fixes * fix template
1 parent d8b7609 commit cd9c4f9

File tree

18 files changed

+2228
-787
lines changed

18 files changed

+2228
-787
lines changed

Makefile.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ args = ["s3", "sync", "cli/schema.golem.cloud", "s3://schema.golem.cloud"]
10711071
description = "Serve the schema.golem.cloud directory locally to help testing the schemas in editors"
10721072
install_crate = "miniserve"
10731073
command = "miniserve"
1074-
args = ["--interfaces", "127.0.0.1", "--port", "41357", "schema.golem.cloud"]
1074+
args = ["--interfaces", "127.0.0.1", "--port", "41357", "cli/schema.golem.cloud"]
10751075

10761076
## Cleanup
10771077
[tasks.clear-v8]

cli/golem-cli/src/context.rs

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ pub struct Context {
6969
// Readonly
7070
config_dir: PathBuf,
7171
format: Format,
72+
help_mode: bool,
7273
local_server_auto_start: bool,
7374
deploy_args: DeployArgs,
7475
profile_name: ProfileName,
@@ -94,6 +95,7 @@ pub struct Context {
9495
templates: std::sync::OnceLock<
9596
BTreeMap<GuestLanguage, BTreeMap<ComposableAppGroupName, ComposableAppTemplate>>,
9697
>,
98+
selected_profile_logging: std::sync::OnceLock<()>,
9799

98100
// Directly mutable
99101
app_context_state: tokio::sync::RwLock<ApplicationContextState>,
@@ -204,28 +206,14 @@ impl Context {
204206

205207
set_log_output(log_output);
206208

207-
log_action(
208-
"Selected",
209-
format!(
210-
"profile: {}{}",
211-
profile.name.0.log_color_highlight(),
212-
project
213-
.as_ref()
214-
.map(|project| format!(
215-
", project: {}",
216-
project.to_string().log_color_highlight()
217-
))
218-
.unwrap_or_else(|| "".to_string())
219-
),
220-
);
221-
222209
let client_config = ClientConfig::from(&profile.profile);
223210
let file_download_client =
224211
new_reqwest_client(&client_config.file_download_http_client_config)?;
225212

226213
Ok(Self {
227214
config_dir,
228215
format,
216+
help_mode: log_output_for_help.is_some(),
229217
local_server_auto_start,
230218
deploy_args,
231219
profile_name: profile.name,
@@ -245,6 +233,7 @@ impl Context {
245233
golem_clients: tokio::sync::OnceCell::new(),
246234
file_download_client,
247235
templates: std::sync::OnceLock::new(),
236+
selected_profile_logging: std::sync::OnceLock::new(),
248237
app_context_state: tokio::sync::RwLock::new(ApplicationContextState::new(
249238
yes,
250239
app_source_mode,
@@ -304,6 +293,7 @@ impl Context {
304293
}
305294

306295
pub fn profile_name(&self) -> &ProfileName {
296+
self.log_selected_profile_once();
307297
&self.profile_name
308298
}
309299

@@ -316,6 +306,7 @@ impl Context {
316306
}
317307

318308
pub fn profile_project(&self) -> Option<&ProjectReference> {
309+
self.log_selected_profile_once();
319310
self.project.as_ref()
320311
}
321312

@@ -326,6 +317,8 @@ impl Context {
326317
pub async fn golem_clients(&self) -> anyhow::Result<&GolemClients> {
327318
self.golem_clients
328319
.get_or_try_init(|| async {
320+
self.log_selected_profile_once();
321+
329322
let clients = GolemClients::new(
330323
self.client_config.clone(),
331324
self.auth_token_override,
@@ -539,6 +532,27 @@ impl Context {
539532
}
540533
}
541534
}
535+
536+
fn log_selected_profile_once(&self) {
537+
self.selected_profile_logging.get_or_init(|| {
538+
if !self.help_mode {
539+
log_action(
540+
"Selected",
541+
format!(
542+
"profile: {}{}",
543+
self.profile_name.0.log_color_highlight(),
544+
self.project
545+
.as_ref()
546+
.map(|project| format!(
547+
", project: {}",
548+
project.to_string().log_color_highlight()
549+
))
550+
.unwrap_or_default()
551+
),
552+
);
553+
}
554+
});
555+
}
542556
}
543557

544558
pub struct GolemClients {

cli/golem-cli/tests/app/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ async fn adding_and_changing_rpc_deps_retriggers_build() {
794794
}
795795

796796
#[test]
797-
async fn build_all_templates() {
797+
async fn build_and_deploy_all_templates() {
798798
let mut ctx = TestContext::new();
799799
let app_name = "all-templates-app";
800800

@@ -844,7 +844,12 @@ async fn build_all_templates() {
844844
}
845845

846846
let outputs = ctx.cli([cmd::APP, cmd::BUILD]).await;
847-
assert!(outputs.success())
847+
assert!(outputs.success());
848+
849+
ctx.start_server();
850+
851+
let outputs = ctx.cli([cmd::APP, cmd::DEPLOY, flag::YES]).await;
852+
assert!(outputs.success());
848853
}
849854

850855
#[test]

cli/golem-templates/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ static WIT: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/wit/deps");
3636

3737
static APP_MANIFEST_HEADER: &str = indoc! {"
3838
# Schema for IDEA:
39-
# $schema: https://schema.golem.cloud/app/golem/1.2.4/golem.schema.json
39+
# $schema: https://schema.golem.cloud/app/golem/1.3.0-rc1/golem.schema.json
4040
# Schema for vscode-yaml
41-
# yaml-language-server: $schema=https://schema.golem.cloud/app/golem/1.2.4/golem.schema.json
41+
# yaml-language-server: $schema=https://schema.golem.cloud/app/golem/1.3.0-rc1/golem.schema.json
4242
4343
# See https://learn.golem.cloud/docs/app-manifest#field-reference for field reference
4444
# For creating APIs see https://learn.golem.cloud/invoke/making-custom-apis

cli/golem-templates/templates/ts/ts-app-common/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"components-ts/*/*"
88
],
99
"dependencies": {
10-
"@golemcloud/golem-ts-sdk": "0.0.40"
10+
"@golemcloud/golem-ts-sdk": "0.0.45"
1111
},
1212
"devDependencies": {
1313
"@rollup/plugin-alias": "^5.1.1",
@@ -19,6 +19,6 @@
1919
"rollup": "^4.50.1",
2020
"tslib": "^2.8.1",
2121
"typescript": "^5.9.2",
22-
"@golemcloud/golem-ts-typegen": "0.0.40"
22+
"@golemcloud/golem-ts-typegen": "0.0.45"
2323
}
2424
}

0 commit comments

Comments
 (0)