Skip to content

[Bug]: Issue links on custom GitHub Enterprise hostnames are not recognized #38251

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

Not sure

Steps to reproduce

  1. Sign in to a GitHub Enterprise Server whose hostname does not contain a github label or end in .ghe.com, such as code.acme.test.
  2. Add a project from a repository on that server.
  3. Start a thread in the project and ask the agent to read an issue using its full HTTPS URL.

Expected behavior

The issue URL resolves through the configured project and the agent can read the issue.

Actual behavior

The issue tool rejects the URL with “This is not a recognised issue URL.”

Impact

Minor bug or occasional failure. People using a custom GitHub Enterprise hostname encounter this whenever they pass an issue URL to an issue tool; the same URLs also fail to open in the internal issue panel.

Version or commit

main at 705c7f2479. The cause is at packages/source-control-github/src/shared/definition.ts:105.

Environment

Linux x64, the repository's own tests.

Logs or stack traces

AssertionError: expected undefined to be 'ported'
Automated repro

Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.

diff --git a/packages/client-runtime/src/issueLinks.test.ts b/packages/client-runtime/src/issueLinks.test.ts
index 004b526d99..822998c437 100644
--- a/packages/client-runtime/src/issueLinks.test.ts
+++ b/packages/client-runtime/src/issueLinks.test.ts
@@ -35,28 +35,31 @@ describe("resolveIssueLinkTarget", () => {
     expect(target?.ref).toMatchObject({ tracker: "github", host: "github.com", ...expected });
   });
 
-  it("prefers the project bound to the link's own port over one on the bare hostname", () => {
-    const enterprise = (id: string, host: string) =>
-      ({
-        id: ProjectId.make(id),
-        environmentId: EnvironmentId.make("env"),
-        repositoryIdentity: {
-          canonicalKey: `${host}/acme/web`,
-          provider: SourceControlProviderKind.make("github"),
-          displayName: "acme/web",
-          owner: "acme",
-          name: "web",
-        },
-      }) as never;
-    const target = resolveIssueLinkTarget({
-      url: "https://github.example.com:8443/acme/web/issues/7",
-      projects: [
-        enterprise("bare", "github.example.com"),
-        enterprise("ported", "github.example.com:8443"),
-      ],
-    });
-    expect(target?.ref.projectId).toBe("ported");
-  });
+  it.each(["github.example.com", "code.acme.test"])(
+    "prefers the project bound to an issue link's own port on %s",
+    (host) => {
+      const enterprise = (id: string, host: string) =>
+        ({
+          id: ProjectId.make(id),
+          environmentId: EnvironmentId.make("env"),
+          repositoryIdentity: {
+            canonicalKey: `${host}/acme/web`,
+            provider: SourceControlProviderKind.make("github"),
+            displayName: "acme/web",
+            owner: "acme",
+            name: "web",
+          },
+        }) as never;
+      const target = resolveIssueLinkTarget({
+        url: `https://${host}:8443/acme/web/issues/7`,
+        projects: [
+          enterprise("bare", host),
+          enterprise("ported", `${host}:8443`),
+        ],
+      });
+      expect(target?.ref.projectId).toBe("ported");
+    },
+  );
 
   it.each([
     "https://github.com.evil.example/acme/web/issues/7",
cd packages/client-runtime && pnpm exec vp test run src/issueLinks.test.ts

Workaround

No response

Activity

  1. added
    vouch:trusted
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions