summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2025-07-26 16:27:24 -0700
committerElizabeth Hunt <me@liz.coffee>2025-07-26 16:51:38 -0700
commitdf1a7eec824d9e9d99c58b1f7792c8f384955273 (patch)
tree777293cac122ec41fc00e7df93ae30dfe85ebc13
parentf0898a3c19fafc5784385371beac6304b36f8f79 (diff)
downloadci-df1a7eec824d9e9d99c58b1f7792c8f384955273.tar.gz
ci-df1a7eec824d9e9d99c58b1f7792c8f384955273.zip
Adds better secret log liens
-rw-r--r--u/process/exec.ts2
-rw-r--r--worker/secret.ts14
2 files changed, 11 insertions, 5 deletions
diff --git a/u/process/exec.ts b/u/process/exec.ts
index 7721f61..46b31c4 100644
--- a/u/process/exec.ts
+++ b/u/process/exec.ts
@@ -51,7 +51,7 @@ export const getStdout = (
if (code === 0) {
res(streams);
} else {
- rej(new Error(`exited with non-zero code: ${code}`));
+ rej(new Error(`exited with non-zero code: ${code}. ${stderr}`));
}
});
}),
diff --git a/worker/secret.ts b/worker/secret.ts
index 241823d..30316bd 100644
--- a/worker/secret.ts
+++ b/worker/secret.ts
@@ -47,9 +47,12 @@ export class Bitwarden implements IVault<TClient, TKey, TItemId> {
.flatMap((tConfig) => tConfig.move(`bw config server ${tConfig.get().server}`).map(getStdout))
.map(async (tEitherWithConfig) => {
const eitherWithConfig = await tEitherWithConfig.get();
- tEitherWithConfig.trace.trace('logging in~ ^.^');
return eitherWithConfig.flatMapAsync((_) =>
- tEitherWithConfig.move('bw login --apikey --quiet').map(getStdout).get(),
+ tEitherWithConfig
+ .peek((t) => t.trace.trace('logging in~ ^.^'))
+ .move('bw login --apikey --quiet')
+ .map(getStdout)
+ .get(),
);
})
.peek(TraceUtil.promiseify(TraceUtil.traceResultingEither(Bitwarden.loginMetric)));
@@ -57,9 +60,12 @@ export class Bitwarden implements IVault<TClient, TKey, TItemId> {
.flatMap(TraceUtil.withMetricTrace(Bitwarden.unlockVaultMetric))
.map(async (tEitherWithAuthd) => {
const eitherWithAuthd = await tEitherWithAuthd.get();
- tEitherWithAuthd.trace.trace('unlocking the secret vault~ (◕ᴗ◕✿)');
return eitherWithAuthd.flatMapAsync((_) =>
- tEitherWithAuthd.move('bw unlock --passwordenv BW_PASSWORD --raw').map(getStdout).get(),
+ tEitherWithAuthd
+ .peek((t) => t.trace.trace('unlocking the secret vault~ (◕ᴗ◕✿)'))
+ .move('bw unlock --passwordenv BW_PASSWORD --raw')
+ .map(getStdout)
+ .get(),
);
})
.peek(TraceUtil.promiseify(TraceUtil.traceResultingEither(Bitwarden.unlockVaultMetric)));