Repository navigation
Work queue rejects GitHub Enterprise Cloud (ghe.com) hosts #67290
Description
Problem
The native work queue cannot run on GitHub Enterprise Cloud with data residency (for example, https://foo.ghe.com). The JavaScript runtime accepts only the literal host github.com, so it rejects resources on the actual server. We found this while evaluating tools.work-queue for a production queue on foo.ghe.com. We currently run a custom issue-comment ledger there that follows the WorkQueueOps pattern.
Analysis
This analysis comes from reading the source at 7745f43bf7f0ae5e7f2e1dc11e891dff8dff3edb. We did not run the queue on GHE.
| Location | Effect on a GHE server |
|---|---|
work_queue_graph.cjs:21 |
Rejects every Issue/PR dependency node whose host is not github.com |
work_queue_resource_scope.cjs:39 |
Rejects every effect target whose host is not github.com |
work_queue_resource_scope.cjs:90 |
hasNativeBinding returns false for other hosts, so Work subject validation fails at line 107 |
work_queue_effect_resource.cjs:40 |
Sets target.host only when GITHUB_API_URL is https://api.github.com, so GHE targets have no host |
work_queue_policy.cjs:108 |
Rejects Policy backing_issues whose host is not github.com |
The Go code under pkg/ has no host check. work_queue_dependency_resolver.cjs already compares hosts without a fixed value. The work-queue specification does not say whether GHE is out of scope. Related: #41912 passed the enterprise host to the CLI proxy.
Plan
- Add one helper (for example,
expectedGitHubHost()inwork_queue_resource_scope.cjs) that returns the hostname ofGITHUB_SERVER_URL, orgithub.comwhen the variable is unset. - Replace the literal
"github.com"comparisons atwork_queue_graph.cjs:21,work_queue_resource_scope.cjs:39and:90, andwork_queue_policy.cjs:108with that helper. - In
work_queue_effect_resource.cjs:40, always settarget.host = expectedGitHubHost(). - Document in
docs/src/content/docs/reference/work-queue.mdthat resourcehostmust equal the server's host.
Acceptance criteria
- With
GITHUB_SERVER_URL=https://contoso.ghe.com, resources with hostcontoso.ghe.compass validation, and resources with hostgithub.comare rejected. - With
GITHUB_SERVER_URLunset orhttps://github.com, the current behavior is unchanged. work_queue_graph.test.cjs,work_queue_resource_scope.test.cjs, andwork_queue_policy.test.cjscover both cases.
If GHE is intentionally out of scope for the work queue, please state that in reference/work-queue.md instead.
Activity