Skip to content

feat: wait for a run already going, and name the building blocks a failed run waits on - #86

Open
j0g3sc wants to merge 2 commits into
claude/cli-gaps-pr-plan-8932c4from
claude/cli-gaps-waiting
Open

j0g3sc wants to merge 2 commits into
claude/cli-gaps-pr-plan-8932c4from
claude/cli-gaps-waiting

Conversation

@j0g3sc

@j0g3sc j0g3sc commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #85, which changes the same wait code; this PR shows only its own two commits and moves to main once #85 is merged.

Two gaps around waiting, one commit each:

  1. meshstack bb wait <uuid> without --before waits for the run that is going on now, such as one that approve-run or another command started. Before, --before was required, and fed with the block's current state it waited for a new run and gave up after a minute. If no run is going on, the command prints the block and its outcome at once. --before works as before.

  2. Name the building blocks a failed run waits on. A run that creates building blocks, such as a starterkit, fails as soon as one of them waits for approval: the Terraform provider only warns, and the module's postcondition fails the run. meshStack does not link the created block to the run, only the run's logs name it. So when a run failed, bb wait and trigger-run --wait read the building blocks whose uuids appear in the logs (at most 20), and name those that wait for someone, with the bbrun plan command for one that waits for approval:

    the run of building block P ended with action REVIEW_ERRORS. The logs of the run name building blocks that wait for someone: building block C waits for approval: review its plan with 'meshstack buildingblockrun plan R'. Act on them, and then run building block P again

    The lookup is best-effort: a uuid that is no building block, or one the login may not read, is skipped, and so are logs the login may not read.

The meshstack-cli skill covers both under Waiting for a run.

Test plan

  • task lint
  • go test ./...: the wait test covers bb wait without --before on an ended run, and a failed run whose logs name a block that waits for approval.
  • No acceptance test: the local stack has no definition with an approval policy, so no block waits for approval there.

🤖 Generated with Claude Code

j0g3sc and others added 2 commits November 13, 2026 11:58
Without --before, 'meshstack buildingblock wait <uuid>' waits for the
run that is going on, such as one that an approval or another command
started. Fed with the block's current state, --before waited for a new
run and gave up after a minute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A run that creates building blocks, such as a starterkit, fails as soon
as one of them waits for approval, and only the run's logs name that
building block. When a run failed, 'meshstack buildingblock wait' and
'trigger-run --wait' now read the building blocks that its logs mention
and name those that wait for someone, with the command to review the
plan of one that waits for approval.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@meshcloud-gh-actions

Copy link
Copy Markdown

Coverage of the acceptance run against the meshStack backend, on 15dd817197fb309b98d993d63f0bfed7327c7697.

Scope Coverage
Unit tests 78.7%
Acceptance tests 54.5%
Combined 81.2%
Uncovered functions
client/api_key.go:52: meshApiKeyClient.Create 0.0%
client/api_key.go:56: meshApiKeyClient.Read 0.0%
client/api_key.go:60: meshApiKeyClient.Update 0.0%
client/api_key.go:64: meshApiKeyClient.Delete 0.0%
client/api_key_permissions.go:20: ApiKeyPermissions.AllCodes 0.0%
client/api_key_permissions.go:33: ApiKeyPermissions.WorkspaceCodes 0.0%
client/api_key_permissions.go:262: AllApiKeyPermissions 0.0%
client/api_key_permissions.go:266: WorkspacePermissionCodes 0.0%
client/building_block_definition.go:71: MeshBuildingBlockDefinitionApprovalPolicies.NothingRequiresApproval 0.0%
client/building_block_definition.go:82: DisabledSchedule 0.0%
client/building_block_definition.go:89: MeshBuildingBlockDefinitionSchedule.IsDisabled 0.0%
client/building_block_definition.go:93: MeshBuildingBlockDefinitionSpec.HasNeutralPolicies 0.0%
client/building_block_definition.go:97: MeshBuildingBlockDefinitionSpec.WithNeutralPolicies 0.0%
client/building_block_definition.go:166: meshBuildingBlockDefinitionClient.List 0.0%
client/building_block_definition.go:173: meshBuildingBlockDefinitionClient.Read 0.0%
client/building_block_definition.go:177: meshBuildingBlockDefinitionClient.Create 0.0%
client/building_block_definition.go:181: meshBuildingBlockDefinitionClient.Update 0.0%
client/building_block_definition.go:185: meshBuildingBlockDefinitionClient.Delete 0.0%
client/building_block_definition_version.go:101: MeshBuildingBlockType.TagInputTargets 0.0%
client/building_block_definition_version.go:245: meshBuildingBlockDefinitionVersionClient.Create 0.0%
client/building_block_definition_version.go:254: meshBuildingBlockDefinitionVersionClient.Update 0.0%
client/building_block_definition_version_implementation.go:81: MeshBuildingBlockDefinitionImplementation.InferType 0.0%
client/building_block_definition_version_implementation.go:95: MeshBuildingBlockDefinitionImplementation.MarshalJSONTo 0.0%
client/building_block_definition_version_implementation.go:108: *MeshBuildingBlockDefinitionImplementation.UnmarshalJSONFrom 0.0%
client/building_block_runner.go:93: meshBuildingBlockRunnerClient.Create 0.0%
... and 125 more

covdata func names a method without its receiver, so an entry can belong to an implementation nothing selects rather than to a function the tests never reached. Open the file and line before reading one as a coverage gap.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant