@delegoapp/runner 0.1.0 → 0.1.1
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/dist/job-pipeline.js +18 -3
- package/package.json +1 -1
package/dist/job-pipeline.js
CHANGED
|
@@ -25,13 +25,28 @@ export async function runRealExecutionOnce(config) {
|
|
|
25
25
|
if (!job) {
|
|
26
26
|
return false;
|
|
27
27
|
}
|
|
28
|
-
console.log(`claimed ${job.id} for ${job.repositorySlug}`);
|
|
28
|
+
console.log(`claimed ${job.id} for ${job.repositorySlug ?? '<no repository>'}`);
|
|
29
29
|
await postRunnerEvent(config, '/api/runner/heartbeat', job.id);
|
|
30
30
|
let workspace = null;
|
|
31
31
|
let commitMetadata = null;
|
|
32
|
+
if (!job.repositorySlug) {
|
|
33
|
+
const message = "This job has no repository configured. Add a Repository Mapping (Linear → Repository) in delego for the issue's project, then re-trigger the agent session.";
|
|
34
|
+
await reportFailure(config, job, message, {
|
|
35
|
+
attemptId: job.attemptId,
|
|
36
|
+
repositorySlug: job.repositorySlug,
|
|
37
|
+
});
|
|
38
|
+
console.error(`failed ${job.id}: ${message}`);
|
|
39
|
+
await postRunnerEvent(config, '/api/runner/heartbeat', null);
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
// After the guard above the slug is non-null for the remainder of the function.
|
|
43
|
+
const executableJob = {
|
|
44
|
+
...job,
|
|
45
|
+
repositorySlug: job.repositorySlug,
|
|
46
|
+
};
|
|
32
47
|
try {
|
|
33
48
|
validatePublishingPolicy(job.publishingPolicy);
|
|
34
|
-
workspace = await prepareWorkspace(config,
|
|
49
|
+
workspace = await prepareWorkspace(config, executableJob);
|
|
35
50
|
await reportProgress(config, job, `Prepared local workspace for ${job.executionPreferences.executor} execution.`, {
|
|
36
51
|
executor: job.executionPreferences.executor,
|
|
37
52
|
model: job.executionPreferences.model,
|
|
@@ -58,7 +73,7 @@ export async function runRealExecutionOnce(config) {
|
|
|
58
73
|
repositorySlug: job.repositorySlug,
|
|
59
74
|
publishingPolicy: job.publishingPolicy,
|
|
60
75
|
});
|
|
61
|
-
prMetadata = await publishBranchAndMaybePr(workspace.worktreePath,
|
|
76
|
+
prMetadata = await publishBranchAndMaybePr(workspace.worktreePath, executableJob, workspace.branchName, commitMetadata);
|
|
62
77
|
pushed = true;
|
|
63
78
|
if (prMetadata) {
|
|
64
79
|
console.log(`publish: created ${prMetadata.draft ? 'draft ' : ''}PR ${prMetadata.url}`);
|
package/package.json
CHANGED