Skip to content

feat: add meshstack api to call any meshStack API path - #12

Draft
JohannesRudolph wants to merge 1 commit into
mainfrom
feat/cli-api
Draft

JohannesRudolph wants to merge 1 commit into
mainfrom
feat/cli-api

Conversation

@JohannesRudolph

Copy link
Copy Markdown
Member

Adds meshstack api <path>, in the style of gh api: it sends an authorized request to a path of the endpoint and writes the answer unparsed.

This covers what no command wraps yet, without one command per kind: deleting or purging building blocks, tenants and projects, and reading v2-preview media types (lifecycle timestamps and authors).

  • -X method, -H headers (Accept picks the API version), --input file or - for stdin.
  • A non-2xx answer still writes its body, then exits 1.
  • An absolute URL is refused, so the token stays on the endpoint.
  • The raw request shares the 401 retry with DoRequest. client/ is untouched.

Independent of #7, #10 and #11.

🤖 Generated with Claude Code

Like `gh api`, it sends an authorized request and writes the answer
as it came. It covers what no command wraps yet: deleting and purging
meshObjects, tenants and projects, or the v2-preview media types that
carry lifecycle timestamps and authors.

The raw request shares the 401 retry with DoRequest, and refuses an
absolute URL so the bearer token never leaves the endpoint.

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 e68a0da2e23a8b531f466359d6922bec73630451.

Scope Coverage
Unit tests 58.1%
Acceptance tests 14.6%
Combined 58.4%
Uncovered functions
client/api_key.go:48: meshApiKeyClient.Create 0.0%
client/api_key.go:52: meshApiKeyClient.Read 0.0%
client/api_key.go:56: meshApiKeyClient.Update 0.0%
client/api_key.go:60: meshApiKeyClient.Delete 0.0%
client/api_key_permissions.go:21: ApiKeyPermissions.AllCodes 0.0%
client/api_key_permissions.go:34: ApiKeyPermissions.WorkspaceCodes 0.0%
client/api_key_permissions.go:50: ApiKeyPermissions.MarkdownString 0.0%
client/api_key_permissions.go:226: AllApiKeyPermissions 0.0%
client/api_key_permissions.go:231: WorkspacePermissionCodes 0.0%
client/building_block_definition.go:72: MeshBuildingBlockDefinitionApprovalPolicies.NothingRequiresApproval 0.0%
client/building_block_definition.go:83: DisabledSchedule 0.0%
client/building_block_definition.go:90: MeshBuildingBlockDefinitionSchedule.IsDisabled 0.0%
client/building_block_definition.go:95: MeshBuildingBlockDefinitionSpec.HasNeutralPolicies 0.0%
client/building_block_definition.go:100: MeshBuildingBlockDefinitionSpec.WithNeutralPolicies 0.0%
client/building_block_definition.go:153: meshBuildingBlockDefinitionClient.List 0.0%
client/building_block_definition.go:160: meshBuildingBlockDefinitionClient.Read 0.0%
client/building_block_definition.go:164: meshBuildingBlockDefinitionClient.Create 0.0%
client/building_block_definition.go:168: meshBuildingBlockDefinitionClient.Update 0.0%
client/building_block_definition.go:172: meshBuildingBlockDefinitionClient.Delete 0.0%
client/building_block_definition_version.go:100: TagInputTargetsFor 0.0%
client/building_block_definition_version.go:245: meshBuildingBlockDefinitionVersionClient.List 0.0%
client/building_block_definition_version.go:251: meshBuildingBlockDefinitionVersionClient.Create 0.0%
client/building_block_definition_version.go:260: meshBuildingBlockDefinitionVersionClient.Update 0.0%
client/building_block_definition_version_implementation.go:78: MeshBuildingBlockDefinitionImplementation.InferTypeFromNonNilField 0.0%
client/building_block_definition_version_implementation.go:99: MeshBuildingBlockDefinitionImplementation.MarshalJSON 0.0%
... and 169 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.

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