Repository navigation
feat(client): claim a run and report its source steps and artifacts through the run client - #33
Conversation
|
Coverage of the acceptance run against the meshStack backend, on
Uncovered functions
|
f7111e1 to
73db1b9
Compare
73db1b9 to
ebf91ce
Compare
9ab69a7 to
322b873
Compare
3a034bf to
eb512e3
Compare
5975d78 to
98854c7
Compare
abbd309 to
e90226d
Compare
c85b993 to
0332c2c
Compare
3032cd0 to
f74c926
Compare
d537434 to
75703bd
Compare
75703bd to
52fcb6b
Compare
j0g3sc
left a comment
There was a problem hiding this comment.
This is way too large to review thoroughly.
I focused on the generic client and the changes along the profile selection:
This is what i found:
profile selection:
- Credentials can go to any host:
meshstack api <full URL>takes the URL’s host as the endpoint. If credentials come from environment variables, they are sent to whatever host the URL names. - login hint that always fails: When no stored profile matches the endpoint, the error suggests
meshstack login --endpoint X. But the login prompt rejects that command whenever any profile already exists; it needs--profile <name>added. - meshstack logout on a fresh setup fails: With no profiles and no endpoint it exits with an error instead of warning “Nothing to log out of”, which breaks cleanup scripts that run logout every time.
client:
- Update can panic: MeshObjectByUuidMetadata.meshObjectId() and MeshTenant.meshObjectId() dereference a uuid without checking for nil. An object with no uuid, as a Terraform plan can produce, crashes the provider instead of returning an error.
- Every kind now exposes Create, Update and Delete: That includes read-only kinds like event logs and runs. A call that the API doesn’t support compiles and only fails at runtime, and Delete even treats the resulting 404 as success.
- Three clients silently moved to preview API versions: BuildingBlockDefinition and DefinitionVersion went from v1 to v1-preview, and BuildingBlockV2 from v2 to v2-preview. The commit message doesn’t mention it, and it changes what the Terraform provider sends.
claude found smaller stuff as well for other topics. I'd suggest to maybe split this PR up into chunks and make a PR stack out of it that allows a more focused review on each.
52fcb6b to
ffe1302
Compare
ffe1302 to
ea7f8e9
Compare
…hrough the run client A building block runner works with client.Client.BuildingBlockRun: Claim hands it the next run with the run token, the inputs and the implementation, and sends the version of the HTTP client's user agent as X-Meshcloud-Runner-Version. RegisterSource, UpdateSourceSteps, DownloadArtifact and UploadArtifact address a run by its uuid, because the API key of a runner may not read a run. The names follow the operations of the meshObject API. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
http.Error.IsTemporary is true for 408, 423, 429 and every 5xx, so that a caller that polls, as a runner does for a pipeline run, knows when to go on. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A refused connection is retried under every policy and for every method, because the server received nothing. A runner started together with meshStack then waits for its API, and a client outlasts a restart of meshStack. Each retry logs a warning, so a person who gave a wrong endpoint sees why the command waits and can stop it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… JSON pointer A debug log shows a JSON body indented, with the value at each redacted JSON pointer replaced by "[REDACTED]", and applies one-token pointers to the fields of a url-encoded form. Every request redacts the plaintext of a secret and the clientSecret of an API key; http.WithRedactedJsonPointers adds the tokens of an OIDC grant, the access token of an API key login and the run token of a claimed run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…client/http http.Error now shows the body as it came, and BodyAsJson reads it into the type the caller expects. client.MeshObjectError reads the error body of meshStack and keeps what wraps the http.Error, such as the authorization of a 403. internal/oidc reads its OAuth error itself. meshstack api no longer writes the body of a failed answer to stdout; the error says what meshStack answered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… checkout The Go runner clones a commit of a local repository, so the test runs a head that is not pushed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ea7f8e9 to
ebc066e
Compare
|
|
@j0g3sc Thanks for the review. I split the PR into a stack of six, each based on the one below it:
Your findings: Profile selection (#111)
Client (#114)
|



What it does
This is the part of the client that the Go building block runner needs:
client.Client.BuildingBlockRunis a read-only run client withClaim,RegisterSource,UpdateSourceSteps,DownloadArtifactandUploadArtifact. They address a run by its uuid, because the API key of a runner may not read a run.http.Error.IsTemporarytells whether an HTTP error is temporary.http.WithRedactedJsonPointers).http.Errorshows the body as it came.client.MeshObjectErrorreads the error body of meshStack.internal/oidcreads its OAuth error itself.meshstack apino longer writes the body of a failed answer to stdout.Review carefully
client/building_block_run.go,client/building_block_run_source.go,client/http/retry.goandclient/http/logging.go(redaction).Place in the stack
6 of 6. Base:
generic-mesh-object-client. The runner PR (#86) and the provider PR (#392) build on this branch.🤖 Generated with Claude Code