spur-board 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/daemon.mjs +16 -8
  2. package/package.json +1 -1
package/dist/daemon.mjs CHANGED
@@ -11466,6 +11466,10 @@ function refKey(ref) {
11466
11466
  function projectForSource(config, source) {
11467
11467
  return config.projects.find((project) => source === trackerSource(project) || project.repos.some((repo) => source === `github:${project.id}:${repo.toLowerCase()}`));
11468
11468
  }
11469
+ /** A closed issue of a GitHub Issues tracker, which lists only open issues. */
11470
+ function closedIssue(project, status) {
11471
+ return project.tracker.type === "github-issues" && status === "closed";
11472
+ }
11469
11473
  async function updateTerminal(trx, config, taskId, at, completeSince, blind) {
11470
11474
  const task = await trx.selectFrom("task").selectAll().where("id", "=", taskId).executeTakeFirstOrThrow();
11471
11475
  const project = config.projects.find((entry) => entry.id === task.project);
@@ -11555,7 +11559,7 @@ async function ticket(trx, config, fact, at, source) {
11555
11559
  if (task === void 0) task = pending;
11556
11560
  if (task?.manual_exclude === 1) return;
11557
11561
  if (task === void 0) {
11558
- if (!fact.inFilter) return;
11562
+ if (!fact.inFilter || closedIssue(project, fact.status)) return;
11559
11563
  task = await trx.insertInto("task").values({
11560
11564
  project: project.id,
11561
11565
  tracker_kind: project.tracker.type,
@@ -11851,8 +11855,10 @@ function createObservationCore(deps) {
11851
11855
  "task.manual_include",
11852
11856
  "ticket_snapshot.detail"
11853
11857
  ]).where("project", "=", project.id).where("membership", "!=", "archived").execute()).flatMap((task) => {
11854
- const outside = task.detail === null ? false : !parseJson(ticketFactsSchema, task.detail).inFilter;
11855
- return task.manual_include === 1 || outside ? [{
11858
+ const detail = task.detail === null ? null : parseJson(ticketFactsSchema, task.detail);
11859
+ const outside = detail !== null && !detail.inFilter;
11860
+ const openIssue = project.tracker.type === "github-issues" && detail !== null && !closedIssue(project, detail.status);
11861
+ return task.manual_include === 1 || outside || openIssue ? [{
11856
11862
  kind: "ticket",
11857
11863
  trackerId: source,
11858
11864
  ...task.tracker_id === null ? {} : { id: task.tracker_id },
@@ -11952,12 +11958,14 @@ function createObservationCore(deps) {
11952
11958
  "ticket_snapshot.task_id",
11953
11959
  "ticket_snapshot.detail",
11954
11960
  "task.tracker_id",
11955
- "task.key"
11961
+ "task.key",
11962
+ "task.membership"
11956
11963
  ]).where("task.project", "=", project.id).where("task.manual_include", "=", 0).where("task.manual_exclude", "=", 0).execute();
11957
11964
  for (const row of rows) {
11965
+ if (project.tracker.type === "github-issues" && row.membership === "archived") continue;
11958
11966
  if (unresolved.has(row.key) || row.tracker_id !== null && (seen.has(row.tracker_id) || unresolved.has(row.tracker_id))) continue;
11959
11967
  const fact = parseJson(ticketFactsSchema, row.detail);
11960
- if (!fact.inFilter) continue;
11968
+ if (!fact.inFilter || closedIssue(project, fact.status)) continue;
11961
11969
  const outside = {
11962
11970
  ...fact,
11963
11971
  inFilter: false
@@ -13835,7 +13843,7 @@ function matchesFilter(issue, tracker) {
13835
13843
  if (tracker.label !== void 0) return issue.labels.some((label) => label.name === tracker.label);
13836
13844
  return issue.milestone?.title === tracker.milestone;
13837
13845
  }
13838
- /** Lists tracker issues and resolves manually included keys outside the filter. */
13846
+ /** Lists open filter issues and resolves requested tickets missing from that listing. */
13839
13847
  function createGithubIssuesAdapter(options) {
13840
13848
  const transport = options.fetch ?? fetch;
13841
13849
  const [owner, name] = options.tracker.repo.split("/");
@@ -13931,7 +13939,7 @@ function createGithubIssuesAdapter(options) {
13931
13939
  const observedAt = (/* @__PURE__ */ new Date()).toISOString();
13932
13940
  const milestone = await milestoneNumber(ctx.signal);
13933
13941
  const filter = new URL(`${root}/issues`);
13934
- filter.searchParams.set("state", "all");
13942
+ filter.searchParams.set("state", "open");
13935
13943
  filter.searchParams.set("per_page", "100");
13936
13944
  if (options.tracker.label !== void 0) filter.searchParams.set("labels", options.tracker.label);
13937
13945
  if (milestone !== void 0) filter.searchParams.set("milestone", String(milestone));
@@ -13969,7 +13977,7 @@ function createGithubIssuesAdapter(options) {
13969
13977
  fact = normalize(detail, options.id, options.tracker.repo, matchesFilter(detail, options.tracker));
13970
13978
  facts.set(issueNo, fact);
13971
13979
  } catch (error) {
13972
- if (error instanceof GithubIssuesHttpError && error.status === 404) {
13980
+ if (error instanceof GithubIssuesHttpError && (error.status === 404 || error.status === 410)) {
13973
13981
  entities.push({
13974
13982
  ref,
13975
13983
  status: "not_found"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spur-board",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": "^24.12.0 || ^26.0.0"