fix(workflow): use status/category list filters in health and report fetchers #360

Merged
wbtiger merged 1 commits from heke1228/gitlink-cli:fix/workflow-health-list-filter into master 2026-07-14 22:22:55 +08:00
Contributor

背景

workflow +health / +repo-report / +triage 的抓取器用 state=open 过滤 PR/Issue 列表。但 GitLink 列表 API 对 PR 以 status 过滤、对 Issue 以 category 过滤,state 参数被静默忽略——按 API 文档未传 status 即返回全部。于是抓取器把 open + merged + closed 全部取回,污染 OpenPRs/OpenIssues 计数并扭曲健康评分。仓库内 pr.goissue.gohealth/api.go 已使用正确参数名。

另修 updateRecentActivityRecentActivityDays == 0(今日活跃)被原判定当作“未设置”,允许更旧信号覆盖。

改动

  • pulls 抓取发 status(open=0),issues 抓取发 categoryopened)。
  • 移除 || input.RecentActivityDays == 0
  • 补单测锁定查询键与“今日活跃不被覆盖”。

验证

go test ./... 通过;改回 state= 或恢复 == 0 子句会使新测试失败(变异验证)。

## 背景 `workflow +health` / `+repo-report` / `+triage` 的抓取器用 `state=open` 过滤 PR/Issue 列表。但 GitLink 列表 API 对 PR 以 `status` 过滤、对 Issue 以 `category` 过滤,`state` 参数被**静默忽略**——按 API 文档未传 `status` 即返回全部。于是抓取器把 open + merged + closed 全部取回,污染 `OpenPRs`/`OpenIssues` 计数并扭曲健康评分。仓库内 `pr.go`、`issue.go`、`health/api.go` 已使用正确参数名。 另修 `updateRecentActivity`:`RecentActivityDays == 0`(今日活跃)被原判定当作“未设置”,允许更旧信号覆盖。 ## 改动 - pulls 抓取发 `status`(open=`0`),issues 抓取发 `category`(`opened`)。 - 移除 `|| input.RecentActivityDays == 0`。 - 补单测锁定查询键与“今日活跃不被覆盖”。 ## 验证 `go test ./...` 通过;改回 `state=` 或恢复 `== 0` 子句会使新测试失败(变异验证)。
heke1228 added 1 commit 2026-07-08 12:16:39 +08:00
e4b03e0053
fix(workflow): use status/category list filters in health and report fetchers
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
wbtiger merged commit a3bddb552c into master 2026-07-14 22:22:52 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#360
No description provided.