Repository navigation
Clarify why the ESLint factory cannot dispatch workers #67217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
6f54ce5
9e0ba6a
0700dc5
60849ef
b58cc77
362147f
515b0ec
0023df3
a81eacc
27163d1
708cbbf
fe5c200
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,7 +67,7 @@ async function main(options = {}) { | |
| fs.chmodSync(outputPath, 0o444); | ||
| configuration.core.setOutput?.("work_queue_origin", canonical(snapshot.origin)); | ||
| configuration.core.info( | ||
| `Work queue activation: ${worker ? `${worker.claims.length} immutable Claims authenticated${staged ? " for staged preview (not bound)" : " and bound"}` : runtime.role === "observer" ? "read-only observer" : "unassigned queue-control context"}; snapshot captured` | ||
| `Work queue activation: ${worker ? `${worker.claims.length} immutable Claims authenticated${staged ? " for staged preview (not bound)" : " and bound"}` : latest.sha === null ? "queue uninitialized; an administrator must protect the work-queue branch and install Policy before workers can be dispatched" : runtime.role === "observer" ? "read-only observer" : "unassigned queue-control context"}; snapshot captured` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [/grill-with-docs] The new log text hardcodes the literal string "work-queue branch", but 💡 Suggested fixUse the actual configured branch name (falling back to the default) when building the message, e.g. thread @copilot please address this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The activation diagnostic now names the configured branch (with
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This nested ternary is hard to parse at a glance, and the resulting template-literal line is ~417 characters (vs. the repo's function activationMessage({ worker, staged, latest, runtime }) {
if (worker) return `${worker.claims.length} immutable Claims authenticated${staged ? " for staged preview (not bound)" : " and bound"}`;
if (latest.sha === null) return "queue uninitialized; an administrator must protect the work-queue branch and install Policy before workers can be dispatched";
if (runtime.role === "observer") return "read-only observer";
return "unassigned queue-control context";
}Non-blocking, but would improve maintainability for future edits to this message. @copilot please address this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extracted activation message selection into |
||
| ); | ||
| return snapshot; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ import fs from "fs"; | |
| import path from "path"; | ||
| import os from "node:os"; | ||
| import { main, resolveWorkerAssignment } from "./write_work_queue_snapshot.cjs"; | ||
| import { loadWorkQueueSnapshot } from "./work_queue_mcp_server.cjs"; | ||
| import { loadWorkQueueSnapshot, readWorkQueueState } from "./work_queue_mcp_server.cjs"; | ||
| import { normalizeRuntimeMessage, readClaimScopeContext } from "./work_queue_claim_scope.cjs"; | ||
| import { queueFixture, REF, REPOSITORY, WORKFLOW, DISPATCHER } from "./work_queue_lifecycle.test_helpers.cjs"; | ||
| import { newRequest, newState, replayTransactions, serializeTransactionLog } from "./work_queue_replay.cjs"; | ||
|
|
@@ -177,6 +177,20 @@ describe("authenticated immutable activation snapshots", () => { | |
| expect(loadWorkQueueSnapshot(options.snapshotPath).projection.policy_epoch).toBe("e1"); | ||
| }); | ||
|
|
||
| it("reports an absent queue as uninitialized without claiming worker readiness or installing Policy", async () => { | ||
| const { options } = setup({ granted: false }); | ||
| const initialize = vi.fn(); | ||
| const snapshot = await main({ | ||
| ...options, | ||
| readWorkQueueLog: async () => ({ sha: null, transactions: [], state: newState() }), | ||
| initializeWorkQueue: initialize, | ||
| }); | ||
| expect(snapshot).toMatchObject({ sha: null, worker: null, role: "dispatcher" }); | ||
| expect(initialize).not.toHaveBeenCalled(); | ||
| expect(readWorkQueueState(loadWorkQueueSnapshot(options.snapshotPath)).queue_state).toBe("uninitialized"); | ||
| expect(options.core.info).toHaveBeenCalledWith(expect.stringContaining("administrator must protect the work-queue branch and install Policy")); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This assertion hard-codes 💡 Assert the configured branch
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The absent-queue regression test now sets |
||
| }); | ||
|
|
||
| it("rejects actual oversized encoded framing before creating a snapshot or publishing origin output", async () => { | ||
| const { fixture, options } = setup({ granted: false }); | ||
| const before = fixture.transactions; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The activation diagnostic now uses the configured queue branch, defaulting to
WORK_QUEUE_BRANCH; the regression test covers a custom branch. Fixed inb58cc77f.