feat(aws): setup script editor
Build App (Preview) / compute-version (pull_request) Successful in 6s
Secret Scan / scan (push) Successful in 7s
Secret Scan / scan (pull_request) Successful in 14s
Build App (Preview) / create-release (pull_request) Successful in 6s
Build App (Preview) / build-macos (pull_request) Successful in 6m3s
Build App (Preview) / test (pull_request) Successful in 8m39s
Build App (Preview) / build-windows (pull_request) Successful in 11m38s
Build Container / build-container (pull_request) Successful in 17m24s
Build App (Preview) / build-linux (pull_request) Failing after 21m19s
Build App (Preview) / prune-previews (pull_request) Skipped
Build App (Preview) / compute-version (pull_request) Successful in 6s
Secret Scan / scan (push) Successful in 7s
Secret Scan / scan (pull_request) Successful in 14s
Build App (Preview) / create-release (pull_request) Successful in 6s
Build App (Preview) / build-macos (pull_request) Successful in 6m3s
Build App (Preview) / test (pull_request) Successful in 8m39s
Build App (Preview) / build-windows (pull_request) Successful in 11m38s
Build Container / build-container (pull_request) Successful in 17m24s
Build App (Preview) / build-linux (pull_request) Failing after 21m19s
Build App (Preview) / prune-previews (pull_request) Skipped
HostSection gets a monospace "Setup script" textarea (saved on blur, blank as none) with the 32 KiB UTF-8 limit checked using the backend's message, and notes on when it runs (as claude, bash -e, after the clone, every start, 30 minutes, output in the Overview card) and what it gets under copy-at-connect. Also in Host settings: the environment's advisory lifetime cap (Q8), read by a new aws_environment_max_hours command, and the copy-at-connect limits (no CA before the first connect, removed credentials linger in a running task, no setup re-run after a re-clone), documented in CLAUDE.md too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5388db487e
commit
9e1e72d2a4
13 files changed
+274
-10
No files matched your search
@@ -1625,6 +1625,24 @@ pub async fn aws_workspace_status(
|
||||
crate::host::aws_host::workspace_status(&project).await
|
||||
}
|
||||
|
||||
/// The lifetime cap (hours; 0 = none) of an AWS project's environment, read
|
||||
/// from its record, for Host settings. `None` for a local project or when the
|
||||
/// record can't be read; never an error.
|
||||
#[tauri::command]
|
||||
pub async fn aws_environment_max_hours(
|
||||
project_id: String,
|
||||
state: State<'_, AppState>,
|
||||
) -> Result<Option<u32>, String> {
|
||||
let Some(project) = state.projects_store.get(&project_id) else {
|
||||
return Ok(None);
|
||||
};
|
||||
if !project.is_aws() {
|
||||
return Ok(None);
|
||||
}
|
||||
let settings = state.settings_store.get();
|
||||
Ok(crate::host::aws_host::environment_max_hours(&project, &settings).await)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn stop_project_container(
|
||||
project_id: String,
|
||||
|
||||
@@ -638,6 +638,22 @@ async fn project_sdk(project: &Project, settings: &AppSettings) -> Result<(Strin
|
||||
Ok((host_id.to_string(), region, sdk))
|
||||
}
|
||||
|
||||
/// The lifetime cap, in hours (0 = none), of the environment `project` runs
|
||||
/// in, from its record (Q8: Host settings show it). `None` when it can't be
|
||||
/// read — offline, denied, slow, or the environment is gone.
|
||||
pub async fn environment_max_hours(project: &Project, settings: &AppSettings) -> Option<u32> {
|
||||
let placement = project.aws_placement.as_ref()?;
|
||||
let read = async {
|
||||
let (_, region, sdk) = project_sdk(project, settings).await.ok()?;
|
||||
let who = caller_identity(&sdk).await.ok()?;
|
||||
read_environment(&SdkRuntimeApi::new(&sdk), &placement.environment, &who.account, ®ion)
|
||||
.await
|
||||
.ok()
|
||||
};
|
||||
let info = tokio::time::timeout(std::time::Duration::from_secs(10), read).await.ok()??;
|
||||
Some(info.max_workspace_hours)
|
||||
}
|
||||
|
||||
/// `ProjectHost::Aws::ensure_started`.
|
||||
pub async fn ensure_started(
|
||||
project: &Project,
|
||||
|
||||
@@ -554,6 +554,7 @@ pub fn run() {
|
||||
commands::project_commands::check_unsaved_work,
|
||||
commands::project_commands::aws_task_log,
|
||||
commands::project_commands::aws_workspace_status,
|
||||
commands::project_commands::aws_environment_max_hours,
|
||||
commands::project_commands::remove_aws_resources,
|
||||
commands::project_commands::rebuild_project_container,
|
||||
commands::project_commands::reconcile_project_statuses,
|
||||
|
||||
Reference in new issue
Block a user