summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2025-07-01 10:49:40 -0700
committerElizabeth Hunt <me@liz.coffee>2025-07-01 10:49:40 -0700
commit7d2c0a4aedad3c5e8a81bd19f4417aa4f9fb8360 (patch)
treec4bba5f176774ce337d532e9b47e16ef5a98b337
parentf556523d908ed2ae836fe077f11c5a1b724d459a (diff)
downloadci-7d2c0a4aedad3c5e8a81bd19f4417aa4f9fb8360.tar.gz
ci-7d2c0a4aedad3c5e8a81bd19f4417aa4f9fb8360.zip
Use correct fetch code props
-rw-r--r--.ci/ci.ts2
-rw-r--r--model/job/jobs.ts2
-rw-r--r--model/pipeline/builder.ts2
-rw-r--r--worker/executor.ts3
-rwxr-xr-xworker/scripts/checkout_ci.ts4
5 files changed, 7 insertions, 6 deletions
diff --git a/.ci/ci.ts b/.ci/ci.ts
index 38a8aad..3cc20a0 100644
--- a/.ci/ci.ts
+++ b/.ci/ci.ts
@@ -56,7 +56,7 @@ const getPipeline = () => {
}
const fetchAnsibleCode: FetchCodeJob = {
- type: 'fetch_code.js',
+ type: 'fetch_code',
arguments: {
remoteUrl: `${REMOTE}/infra`,
checkout: 'main',
diff --git a/model/job/jobs.ts b/model/job/jobs.ts
index 4ed5858..dc23070 100644
--- a/model/job/jobs.ts
+++ b/model/job/jobs.ts
@@ -7,7 +7,7 @@ export interface FetchCodeJobProps extends JobArgT {
}
export interface FetchCodeJob {
- readonly type: 'fetch_code.js';
+ readonly type: 'fetch_code';
readonly arguments: FetchCodeJobProps;
}
diff --git a/model/pipeline/builder.ts b/model/pipeline/builder.ts
index c30867c..926a97f 100644
--- a/model/pipeline/builder.ts
+++ b/model/pipeline/builder.ts
@@ -30,7 +30,7 @@ export class DefaultGitHookPipelineBuilder extends BasePipelineBuilder {
this.addStage({
parallelJobs: [
<FetchCodeJob>{
- type: 'fetch_code.js',
+ type: 'fetch_code',
arguments: {
remoteUrl,
checkout: rev,
diff --git a/worker/executor.ts b/worker/executor.ts
index bfcbc37..47b337c 100644
--- a/worker/executor.ts
+++ b/worker/executor.ts
@@ -18,7 +18,7 @@ export const executeJob = (tJob: ITraceable<Job, LogMetricTraceSupplier>) => {
const metric = jobTypeMetric(tJob.get().type);
return tJob
.flatMap(TraceUtil.withMetricTrace(metric))
- .peek((tJob) => tJob.trace.trace(`let's do this little job ok!! ${tJob.get()}`))
+ .peek((tJob) => tJob.trace.trace(`let's do this little job ok!! ${JSON.stringify(tJob.get())}`))
.map((tJob) =>
validateExecutionEntries(tJob.get().arguments)
.mapLeft((badEntries) => {
@@ -28,6 +28,7 @@ export const executeJob = (tJob: ITraceable<Job, LogMetricTraceSupplier>) => {
.flatMapAsync((args) => getStdout(tJob.move(tJob.get().type), { env: args })),
)
.flatMapAsync(TraceUtil.promiseify(TraceUtil.traceResultingEither(metric)))
+ .peek(TraceUtil.promiseify(t => t.traceScope(() => LogLevel.DEBUG).trace.trace(JSON.stringify(t.get()))))
.get();
};
// -- </job.exectuor> --
diff --git a/worker/scripts/checkout_ci.ts b/worker/scripts/checkout_ci.ts
index 0a8b30d..0c6d92c 100755
--- a/worker/scripts/checkout_ci.ts
+++ b/worker/scripts/checkout_ci.ts
@@ -51,7 +51,7 @@ await LogMetricTraceable.ofLogTraceable(_logJob)
tEitherJob.get().flatMapAsync((ciJob) => {
const wd = getWorkingDirectoryForCiJob(ciJob);
const fetchPackageJob = <FetchCodeJob>{
- type: 'fetch_code.js',
+ type: 'fetch_code',
arguments: {
remoteUrl: ciJob.arguments.remote,
checkout: ciJob.arguments.rev,
@@ -62,7 +62,7 @@ await LogMetricTraceable.ofLogTraceable(_logJob)
mkdir(wd, { recursive: true })
.then(() => process.chdir(wd))
.then(() => tEitherJob.move(fetchPackageJob).map(executeJob).get())
- .then(() => ciJob),
+ .then((e) => e.fold(err => { throw err; }, () => ciJob)),
);
}),
)