fix: default listIssues to open state in tracker-linear
When no state filter is specified, tracker-github defaults to "open" but tracker-linear was returning all issues. Now defaults to excluding completed/canceled issues, matching tracker-github behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9227892f0c
commit
27f2e27ec6
|
|
@ -282,10 +282,11 @@ function createLinearTracker(): Tracker {
|
|||
const filter: Record<string, unknown> = {};
|
||||
const variables: Record<string, unknown> = {};
|
||||
|
||||
if (filters.state === "open") {
|
||||
filter["state"] = { type: { nin: ["completed", "canceled"] } };
|
||||
} else if (filters.state === "closed") {
|
||||
if (filters.state === "closed") {
|
||||
filter["state"] = { type: { in: ["completed", "canceled"] } };
|
||||
} else if (filters.state !== "all") {
|
||||
// Default to open (exclude completed/canceled) to match tracker-github
|
||||
filter["state"] = { type: { nin: ["completed", "canceled"] } };
|
||||
}
|
||||
|
||||
if (filters.assignee) {
|
||||
|
|
|
|||
|
|
@ -421,6 +421,17 @@ describe("tracker-linear plugin", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it("defaults to open state when no state specified", async () => {
|
||||
mockLinearAPI({ issues: { nodes: [] } });
|
||||
await tracker.listIssues!({}, project);
|
||||
|
||||
const writeCall = requestMock.mock.results[0].value.write.mock.calls[0][0];
|
||||
const body = JSON.parse(writeCall);
|
||||
expect(body.variables.filter.state).toEqual({
|
||||
type: { nin: ["completed", "canceled"] },
|
||||
});
|
||||
});
|
||||
|
||||
it("passes assignee filter", async () => {
|
||||
mockLinearAPI({ issues: { nodes: [] } });
|
||||
await tracker.listIssues!({ assignee: "Alice" }, project);
|
||||
|
|
|
|||
Loading…
Reference in New Issue