fix(aws): environments panel acts on the scanned region; runs keyed per region
Rows and actions belong to the scan they came from: a region change hides the old rows, detection in flight disables actions, and every action and confirmation targets scan.region. Runs, pending state and errors are keyed by region as well as state key. A boundary run that fails in the apply now offers the boundary bundle with its summary; waiting-for-admin shows only after a bundle is saved; clearer Destroy copy. Tests for each, and no act() warnings in the new tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cf9b5eab3a
commit
bc23fc2dee
7 files changed
+347
-91
No files matched your search
@@ -6,7 +6,7 @@ import Button from "../../ui/Button";
|
||||
import Field, { inputClass } from "../../ui/Field";
|
||||
import Modal from "../../ui/Modal";
|
||||
import AdminBundleModal from "./AdminBundleModal";
|
||||
import DeployProgress, { useDeployRuns } from "./DeployProgress";
|
||||
import DeployProgress, { runKey, useDeployRuns } from "./DeployProgress";
|
||||
import NetworkFields from "./NetworkFields";
|
||||
import {
|
||||
BOUNDARY_STATE_KEY,
|
||||
@@ -51,7 +51,8 @@ export default function DeployEnvironmentModal({
|
||||
if (result?.ok) setBoundaryDone(true);
|
||||
onDetect();
|
||||
});
|
||||
const boundaryRun = boundary.runs[BOUNDARY_STATE_KEY];
|
||||
const boundaryRun = boundary.runs[runKey(region, BOUNDARY_STATE_KEY)];
|
||||
const boundaryFailed = boundaryRun?.done && boundaryRun.result && !boundaryRun.result.ok ? boundaryRun.result : null;
|
||||
|
||||
if (bundle) {
|
||||
return (
|
||||
@@ -137,6 +138,24 @@ export default function DeployEnvironmentModal({
|
||||
</p>
|
||||
)}
|
||||
{boundaryRun && <DeployProgress run={boundaryRun} connectionId={connectionId} />}
|
||||
{boundaryFailed && (
|
||||
<div className="space-y-1.5">
|
||||
<p>
|
||||
Creating the boundary failed. If it was refused, an account administrator can create it from a
|
||||
bundle.
|
||||
</p>
|
||||
<Button
|
||||
size="md"
|
||||
onClick={() =>
|
||||
setBundle({
|
||||
reason: boundaryFailed.summary ?? `OpenTofu exited with code ${boundaryFailed.exit_code}`,
|
||||
})
|
||||
}
|
||||
>
|
||||
Get the boundary bundle for an administrator
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div className="space-y-4">
|
||||
|
||||
Reference in new issue
Block a user