Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 7 additions & 4 deletions .github/workflows/constraint-solving-potd.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 3 additions & 12 deletions actions/setup-cli/install.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions actions/setup/js/generate_history_link.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ function generateHistoryUrl({ owner, repo, itemType, workflowCallId, workflowId,
// Build the search query parts
const queryParts = [`repo:${owner}/${repo}`];

// Add item type qualifier (issues and PRs use is: qualifiers; discussions and comments do not)
// Add item type qualifier (issues use is:issue qualifier; discussions and comments do not)
if (itemType === "issue") {
queryParts.push("is:issue");
} else if (itemType === "pull_request") {
queryParts.push("is:pr");
}

queryParts.push(`"${markerId}"`);
Expand All @@ -64,7 +62,7 @@ function generateHistoryUrl({ owner, repo, itemType, workflowCallId, workflowId,
url.searchParams.set("q", queryParts.join(" "));

// Set the type parameter based on itemType for correct GitHub search filtering
const searchTypeMap = { issue: "issues", pull_request: "issues", discussion: "discussions", comment: "issues", discussion_comment: "discussions" };
const searchTypeMap = { issue: "issues", pull_request: "pullrequests", discussion: "discussions", comment: "issues", discussion_comment: "discussions" };
url.searchParams.set("type", searchTypeMap[itemType] ?? "issues");

return url.toString();
Expand Down
12 changes: 6 additions & 6 deletions actions/setup/js/generate_history_link.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe("generate_history_link.cjs", () => {
expect(url).toContain("type=issues");
});

it("should include is:pr qualifier for pull_request type", () => {
it("should NOT include is:pr qualifier for pull_request type", () => {
const url = generateHistoryUrl({
owner: "testowner",
repo: "testrepo",
Expand All @@ -57,8 +57,8 @@ describe("generate_history_link.cjs", () => {
serverUrl: "https://github.com",
});

expect(url).toContain("is%3Apr");
expect(url).toContain("type=issues");
expect(url).not.toContain("is%3Apr");
expect(url).toContain("type=pullrequests");
});

it("should NOT include is: qualifier for discussion type", () => {
Expand Down Expand Up @@ -329,10 +329,10 @@ describe("generate_history_link.cjs", () => {
});

const parsed = new URL(url);
expect(parsed.searchParams.get("type")).toBe("issues");
expect(parsed.searchParams.get("type")).toBe("pullrequests");

const query = parsed.searchParams.get("q");
expect(query).toContain("is:pr");
expect(query).not.toContain("is:pr");
expect(query).toContain('"gh-aw-workflow-id: my-workflow"');
});

Expand Down Expand Up @@ -461,7 +461,7 @@ describe("generate_history_link.cjs", () => {
serverUrl: "https://github.com",
});

expect(link).toContain("type=issues");
expect(link).toContain("type=pullrequests");
});

it("should generate link with correct search URL for discussion", () => {
Expand Down