Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/main' into copilot/configure-wor…
…k-queue-labels

# Conflicts:
#	actions/setup/js/work_queue_issues_checks.cjs

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
  • Loading branch information
Copilot and pelikhan authored Oct 9, 2026
commit ae3d601b7aa1e90728d17edbf0ec0b0dc06b73da
2 changes: 1 addition & 1 deletion actions/setup/js/work_queue_issues_acceptance_checks.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function registerTests({ describe, it, beforeEach, afterEach }) {
assert.ok(result.pending);
assert.match(result.pending[0].reason, /Failed to read file/);
assert.equal(m.issues.size, 0);
assert.equal(m.calls.filter(call => call[0] === "mutation").length, 0);
assert.equal(m.calls.filter(call => call[0] === "mutation" && call[1].includes("WorkQueueIssueProjection")).length, 0);
});
it("authenticates staged activation without binding Claims or writing Issues", async () => {
const f = fixture({ worker: true });
Expand Down
28 changes: 26 additions & 2 deletions actions/setup/js/work_queue_issues_checks.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const helpers = require("./work_queue_test_helpers.cjs");
const { newWork } = require("./work_queue_graph.cjs");
const { defaultPolicy, validatePolicy } = require("./work_queue_policy.cjs");
const { main, ownProjectionTargets, workIssueStatus, summaryBody, journalPath } = require("./work_queue_issues.cjs");
const { issueBody } = require("./work_queue_issue_messages.cjs");
const { issueCompletionPolicy } = require("./work_queue_issue_contract.cjs");
const { STATUSES, discoverTarget, ensureStatusLabel, mutateIssues } = require("./work_queue_issue_api.cjs");
const { withProjectionLocks } = require("./work_queue_issue_coordination.cjs");
const { canonical, digest } = require("./work_queue_codec.cjs");
Expand Down Expand Up @@ -74,6 +76,7 @@ function mock(f, { labelMissing = false } = {}) {
const calls = [];
const locks = new Set();
const warnings = [];
const restBlobs = new Map();
const nativeRun = {
id: Number(f.origin.run_id),
run_attempt: f.origin.run_attempt,
Expand Down Expand Up @@ -107,7 +110,7 @@ function mock(f, { labelMissing = false } = {}) {
repos: {
get: async () => {
calls.push(["authentication-repository"]);
return { status: 200, data: { id: 1, full_name: "owner/repo" } };
return { status: 200, data: { id: 1, full_name: "owner/repo", default_branch: "main", size: 1 } };
},
},
actions: {
Expand All @@ -117,6 +120,27 @@ function mock(f, { labelMissing = false } = {}) {
},
},
git: {
getRef: async ({ ref }) => {
if (ref === "heads/main") return { data: { object: { sha: "b".repeat(40) } } };
if (ref === "heads/work-queue") return { data: { object: { sha } } };
throw Object.assign(new Error("Not found"), { status: 404 });
},
getCommit: async () => ({ data: { tree: { sha: "c".repeat(40) }, parents: [] } }),
getTree: async () => {
restBlobs.clear();
const files = [["work-queue.jsonl", transactions.map(commit => canonical(commit)).join("\n") + "\n"], ...[...journals].map(([file, value]) => [file, canonical(value) + "\n"])];
const tree = files.map(([file, content]) => {
const blobSha = digest({ file, content });
restBlobs.set(blobSha, content);
return { path: file, type: "blob", mode: "100644", sha: blobSha };
});
return { data: { truncated: false, tree } };
},
getBlob: async ({ file_sha }) => {
const content = restBlobs.get(file_sha);
assert.equal(typeof content, "string");
return { data: { encoding: "base64", content: Buffer.from(content, "utf8").toString("base64"), size: Buffer.byteLength(content) } };
},
createRef: async ({ ref }) => {
calls.push(["lock", ref]);
if (locks.has(ref)) throw Object.assign(new Error("held"), { status: 422 });
Expand Down Expand Up @@ -487,7 +511,7 @@ function registerTests({ describe, it, beforeEach, afterEach }) {
assert.equal(ownProjectionTargets(state, helpers.context(otherRun, { ref }), ref).targets.length, 0);
assert.equal(ownProjectionTargets(state, helpers.context(originalAdmission, { ref }), ref).targets.length, 1);
assert.equal(issueCompletionPolicy(state, work, { ...originalAdmission, role: "projector" }, ref, "owner/repo"), "keep-open");
assert.ok(summaryBody(state, work, false, 10).includes(`/actions/runs/${originalAdmission.run_id}`));
assert.ok(summaryBody(state, work, 10).includes(`/actions/runs/${originalAdmission.run_id}`));
assert.ok(issueBody(state, work, helpers.context(otherRun, { ref }), { label: "work" }, "work-queue").includes(`/actions/runs/${originalAdmission.run_id}`));
});
it("does not treat configuration or API access as installed projector authority", async () => {
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.