Repository navigation
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
| if body == nil { | ||
| return | ||
| } | ||
| WithHeader("Content-Type", contentType)(opts) |
There was a problem hiding this comment.
f: introduce WithContentType (using WithHeader), so have the string Content-Type then only there defined once
There was a problem hiding this comment.
Added http.WithContentType; WithBody, WithBodyFile, WithJsonPayload, WithFormPayload, AbortRun and ClaimRun use it, so Content-Type is spelled only there.
| "github.com/meshcloud/meshstack-cli/internal/testutil/fakemeshstack" | ||
| ) | ||
|
|
||
| func TestRunnerRun(t *testing.T) { |
There was a problem hiding this comment.
f: do not have this test or this logic here in cli client, discuss how to move into bb runner repo
There was a problem hiding this comment.
Moved TestRunnerRun and its fixture to the runner (internal/executor/runyml_test.go). The decoding of inputs and implementation variants stays, as it reads the claim response, and so does MeshRunnerRunImplementation.MarshalJSON, so the public type encodes what it decodes. If you want it out of the CLI, the runner could encode runs with a json/v2 WithMarshalers option instead.
|
|
||
| // TestPublicApiNamesNoInternalType keeps client callable from another module, which Go's internal | ||
| // rule forbids to name an internal type. | ||
| func TestPublicApiNamesNoInternalType(t *testing.T) { |
There was a problem hiding this comment.
f: remove this test, rely on instructions / already complying design
There was a problem hiding this comment.
Removed; the development skill keeps the rule as one line.
| ForRun(run MeshRunnerRun) MeshRunnerRunClient | ||
| // ForRunUuid authorizes with the runner's own credentials and can only register a source and patch its status. | ||
| ForRunUuid(runUuid uuid.UUID) MeshRunnerRunClient |
There was a problem hiding this comment.
f: remove this / move this to the bb runner repo, using the client/http AUthorization interface if possible (which allows to just provide the bearer token aka the run token then i hope)
There was a problem hiding this comment.
ForRunUuid is gone; ForRun(auth http.Authorization, links MeshRunnerRunLinks) is the only way to a run client. The runner passes http.BearerToken(run token) in the child and its session in the poller, which builds the source links from the run uuid itself (building-block-runner#86).
2ac56de to
3926fcc
Compare
3926fcc to
8e92887
Compare
8e92887 to
9807a76
Compare
9807a76 to
2d49f9d
Compare
…un without a stored one A command takes the profile that --profile or MESHSTACK_PROFILE names, and an unknown name is an error. Without a name it takes the current profile when no endpoint is given or the profile has that endpoint, else the only stored profile with that endpoint. With no such profile it runs with the endpoint and the credential from the settings alone: it stores nothing and caches no token. Only 'meshstack login' creates a profile. An endpoint is a scheme and a host, and one with a path is refused. 'meshstack api <URL>' takes the origin of the URL as the endpoint. A profile stores an API token with its other credentials. A token that an earlier version cached is gone, so log in with --apitoken again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ion to client/types/version Another module can then name the HTTP client, its request options and the version type that client/ already uses in its exported API. The files move unchanged, apart from import paths. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…Client and hal.Links Every kind's client is client.MeshObjectClient[M, Id, Filter] with Read, List, Create, Update and Delete under a type alias, and List reads a page only when the caller asks for an object of it. An action of an object follows a link of its _links through hal.Links: Get, Post and Delete send the media type of the kind, decode the answer and let its links follow themselves too. A link to another origin than the endpoint is refused. client.Raw and the per-kind methods such as ReadFunc, TriggerRun and GetLogs are gone. client/http has one DoRequest, which returns the response body, and UnmarshalJsonBody, ReadAllBody and IgnoreResponse consume it. Request options set the retry policy, refuse redirects and capture the response header. A GET and a DELETE are retried on every transient failure, any other method on 423, 429 and 503. The debug log shows the first 1024 bytes of a body as they came. internal/json is the only importer of encoding/json/v2. The polymorph package reads and writes a struct by its type property, as the implementation of a definition version needs. The API docs are cached by the ETag of /api/openapi. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
MeshBuildingBlockRunnerImplementationTypes is an enum.Enum like the other enums of the client, and MeshBuildingBlockRunnerSpec.ImplementationType is an entry of it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…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>
Go 1.27.0 has GO-2026-6859 in net/http, which fails the vulnerability check. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2d49f9d to
9f1ecad
Compare
|



building-block-runner moves all its runners into one Go binary (meshcloud/building-block-runner#86). It builds its meshStack client through
pkg/auth.ResolveClient, as the Terraform provider does, and needs aclientit can call from another module.Reading order
internal/httpbecomesclient/httpandinternal/versionbecomesclient/types/version, with only the imports rewritten.client/httpAPI. No exported name ofclientuses aninternal/type any more, andTestPublicApiNamesNoInternalTypechecks it. New client options:WithoutRedirects(), andWithRetry(policy), which picks per request which failures are retried. Without options,NewClientreturns the shared client as before.client.Runner. A runner claims a run, registers as a status source, reports status, and downloads or uploads the plan artifact, using the run token.ForRunUuidreports with the runner's own credentials. A run's implementation decodes into one typed variant by itstype; the Terraform variant carriesasync. An INTEGER input keeps every digit as*big.Int.NewRunnerClientbuilds this API alone.Changes for callers of
clientWithHeaderreplacesWithAcceptandWithHeaders, andWithBodytakes the content type.Sendreturns the raw response, and anErrornames the method and URL.client.Authorizationalias is gone; usehttp.Authorization.ListOptionsandPagemove toclient/types.Merge order
Merge and release this first. #86 then pins the release in place of this branch's head.
Cross-repo PRs
🤖 Generated with Claude Code