Repository navigation
refactor(client): build every kind's client on one generic MeshObjectClient and hal.Links - #114
Merged
Merged
Conversation
|
Coverage of the acceptance run against the meshStack backend, on
Uncovered functions
|
grubmeshi
force-pushed
the
generic-mesh-object-client
branch
from
November 25, 2026 11:36
901026c to
3f976f2
Compare
…Client and hal.Links Every kind's client is a type alias for one of three interfaces, each of which adds to the one before: MeshObjectReadOnlyClient[M, Filter] with Read, List and ListSeq, MeshObjectImmutableClient[M, Filter] with Create and Delete, and MeshObjectClient[M, Filter] with Update. The alias takes what the API docs offer: event logs and building block runs are read-only; tenants and the project bindings and workspace user bindings are immutable; every other kind, users and workspace user groups included, has the full client. One implementation serves all three. List collects every page, and ListSeq reads a page only when the caller asks for an object of it. An action of an object is a method of its type that follows a link of its _links through hal.Links, so that the rel, the method, the payload and the result are stated once: MeshBuildingBlockV2.TriggerRun and Purge, and MeshBuildingBlockRun.Abort, Approve, Reject, Predecessor and Logs. A link to another origin than the endpoint is refused. client.Raw and the per-kind methods such as ReadFunc and GetLogs are gone, and ids are strings. The polymorph package reads and writes a struct by its type property, as the implementation of a definition version needs. The building block runner types are an enum. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
grubmeshi
force-pushed
the
generic-mesh-object-client
branch
from
November 25, 2026 12:22
3f976f2 to
e2b4e86
Compare
|
j0g3sc
approved these changes
Nov 25, 2026
j0g3sc
left a comment
Collaborator
There was a problem hiding this comment.
Yep, nice assigning these generic clients matching the API conventions by design now. Did not go through all changes in detail but lgtm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What it does
MeshObjectReadOnlyClient[M, Filter]: Read, List, ListSeqMeshObjectImmutableClient[M, Filter]: + Create, DeleteMeshObjectClient[M, Filter]: + Update_linksthroughhal.Links, so that the rel, the HTTP method, the payload and the result type are written in one place:MeshBuildingBlockV2.TriggerRun(ctx) (MeshBuildingBlockV2, error),Purge(ctx) errorMeshBuildingBlockRun.Abort(ctx) error,Approve(ctx, predecessorRunUuid string) error,Reject(ctx) error,Predecessor(ctx) (MeshBuildingBlockRun, error),Logs(ctx) (MeshBuildingBlockRunLogs, error)Linksstays public, and a missing link ishal.ErrNoLink. A link to another origin than the endpoint is refused.client.Raw,client/internaland the per-kind methods such asReadFuncandGetLogsare gone. Ids are strings.client.Client.HttpClientsends any other request.NewMeshWorkspaceUserGroupId(workspace, name), as a project does.polymorphpackage reads and writes a struct by its type property, for the implementation of a definition version. The building block runner types are an enum.Review carefully
client/meshobject.go(the three levels, paging,followLink) andclient/types/hal/link.go.client/types/polymorph.Mechanical
The kind files (alias plus
meshObjectId), the command adaptations incmd/, and the test updates. This removes the temporary glue ofhttp-do-request.Breaking for the Terraform provider
The
Mesh…Clientinterfaces change shape, and the action methods replaceTriggerRun,Delete(…, purge)andGetLogs.Place in the stack
5 of 6. Base:
apidocs-etag. Next:feature/single-go-bin-runner.🤖 Generated with Claude Code