@vzn/vx-reapi 0.0.612 → 0.0.614
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/package.json +2 -2
- package/src/index.ts +8 -3
package/README.md
CHANGED
|
@@ -37,7 +37,8 @@ from the environment, and `VX_REAPI_EXECUTE=1` turns on remote execution the
|
|
|
37
37
|
way `execute: true` does (off by default: a plugin must not move where a
|
|
38
38
|
build runs merely by being configured for caching). `execute` is a
|
|
39
39
|
boolean: a string (`process.env.X`) is refused.
|
|
40
|
-
`instanceName` is the option form of `VX_REAPI_INSTANCE
|
|
40
|
+
`instanceName` is the option form of `VX_REAPI_INSTANCE`; like the endpoint
|
|
41
|
+
it is trimmed, and a blank one is unset. `headers`
|
|
41
42
|
adds gRPC metadata to every call: a hosted server's API key goes there
|
|
42
43
|
(`headers: { 'x-buildbuddy-api-key': process.env.BB_KEY! }`).
|
|
43
44
|
`toolName` and `toolVersion` (default `vx`, `0.0.0`) fill each call's
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx-reapi",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.614",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Bazel Remote Execution API plugin for vx — remote cache (ActionCache + CAS) against NativeLink, BuildBuddy, Buildbarn or bazel-remote.",
|
|
6
6
|
"keywords": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@vzn/vx": "^0.0.
|
|
42
|
+
"@vzn/vx": "^0.0.614"
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
45
45
|
"type": "git",
|
package/src/index.ts
CHANGED
|
@@ -98,7 +98,10 @@ function connection(options: ReapiPluginOptions): ReapiOptions | undefined {
|
|
|
98
98
|
const endpoint = (options.endpoint ?? process.env['VX_REAPI_ENDPOINT'])?.trim()
|
|
99
99
|
if (endpoint === undefined || endpoint === '') return undefined
|
|
100
100
|
assertEndpoint(endpoint, from)
|
|
101
|
-
|
|
101
|
+
// A secrets file's trailing newline sent a name no blob is under, and
|
|
102
|
+
// every lookup missed in silence.
|
|
103
|
+
const instanceName =
|
|
104
|
+
(options.instanceName ?? process.env['VX_REAPI_INSTANCE'])?.trim() || undefined
|
|
102
105
|
// A server behind a private CA, or one that asks for a client
|
|
103
106
|
// certificate, was unreachable: TLS used the system roots and no client
|
|
104
107
|
// pair (F-41). Each is a PEM file, read here; one that cannot be read is
|
|
@@ -203,9 +206,11 @@ export function reapi(options: ReapiPluginOptions = {}): VxPlugin {
|
|
|
203
206
|
let remoteCache: ReapiRemoteCache | undefined
|
|
204
207
|
return definePlugin(import.meta, {
|
|
205
208
|
async executor(ctx): Promise<TaskExecutor | undefined> {
|
|
206
|
-
|
|
209
|
+
// Before the connection: with execute off, an unreadable PEM is the
|
|
210
|
+
// cache hook's to refuse, never a failure "in executor".
|
|
211
|
+
if (options.execute !== true && process.env['VX_REAPI_EXECUTE'] !== '1') return undefined
|
|
207
212
|
const conn = connection(options)
|
|
208
|
-
if (
|
|
213
|
+
if (conn === undefined) return undefined
|
|
209
214
|
executorClient = new ReapiClient({ ...conn, onWarn: (m) => ctx.warn(m) })
|
|
210
215
|
// Negotiate once: turns zstd transfer compression on when the server
|
|
211
216
|
// advertises it. The digest function stays SHA256 (see wire.negotiate).
|