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
4 changes: 3 additions & 1 deletion .github/workflows/collect.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Collect dashboard data
run-name: Collect dashboard (${{ inputs.request_id || github.event_name }})
on:
# The bot dispatches collection when an Issue or PR is opened, reopened or closed, and every
# eight hours otherwise. This daily run only covers a bot that has stopped dispatching.
schedule:
- cron: '17,47 * * * *'
- cron: '17 2 * * *'
workflow_dispatch:
inputs:
source_repository:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## 使用

在目标仓 Actions 手动运行 **Collect dashboard data**,或由 Bot 触发;每小时第 17、47 分钟自动续跑。`main` 上包含 `site/`、`.sync/` 以外文件改动的推送,也会自动派发一次采集;仅改这两个目录的采集提交不会再次派发。采集提交 `site/` 后,**Deploy dashboard Pages** 发布站点。首次配置见 [Actions 采集](docs/actions-collection.md)。
在目标仓 Actions 手动运行 **Collect dashboard data**,或由 Bot 触发:Issue、PR 新建、重新打开或关闭时立即触发,其余变化每 8 小时随定时刷新一次;看板仓自己每天 UTC 02:17 定时运行一次,作为 Bot 停止触发时的兜底。`main` 上包含 `site/`、`.sync/` 以外文件改动的推送,也会自动派发一次采集;仅改这两个目录的采集提交不会再次派发。采集提交 `site/` 后,**Deploy dashboard Pages** 发布站点。首次配置见 [Actions 采集](docs/actions-collection.md)。

本地快速预览(Python 3.10+,凭据来自环境或已登录的 gh):

Expand Down
2 changes: 1 addition & 1 deletion docs/actions-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Worker 校验 GitHub OIDC 签名、issuer、audience、不可变仓库与组织

App 的 Actions 写权限在 App 注册页 **Permissions & events → Repository permissions → Actions → Read and write** 设置,并由目标组织在安装页批准更新;仅修改注册页不等于既有 installation 已获授权。即使两个看板仓同属一个组织,也要分别批准正式与测试 App 各自的 installation;测试 App 的安装范围须覆盖实验源仓及测试看板仓,也可以包含其他仓库。两套 App 的安装范围可以重叠;各 Bot 通过源仓过滤、看板目标映射和 OIDC 信任配置隔离业务,范围外 Webhook 仍归档,不触发业务。临时令牌只授予当前配置中的源仓读取或目标看板写入权限,不随 App 安装范围扩大。仓库 Settings → Actions 的默认 `GITHUB_TOKEN` 权限继续保持只读;触发所需的 App Actions 写权限与此设置不同。

工作流接受 `workflow_dispatch`,并在每小时第 17、47 分钟定时续跑;固定 checkout main,禁止 checkout 输入指定的任意分支。输入 `source_repository` 可省略,填写时必须匹配本站源仓;`request_id` 为诊断用刷新编号,不包含原始 Webhook、私钥或安装令牌。可在 Actions 的 **Collect dashboard data** 手动执行,也可以由 Bot 调用 GitHub workflow dispatch API。
工作流接受 `workflow_dispatch`。Bot 只在 Issue、PR 新建、重新打开或关闭时立即触发,其余变化(CI 运行、评审、发布等)由 Bot 每 8 小时一次的空闲刷新带上;看板仓自己每天 UTC 02:17 定时运行一次,只作 Bot 停止触发时的兜底;固定 checkout main,禁止 checkout 输入指定的任意分支。输入 `source_repository` 可省略,填写时必须匹配本站源仓;`request_id` 为诊断用刷新编号,不包含原始 Webhook、私钥或安装令牌。可在 Actions 的 **Collect dashboard data** 手动执行,也可以由 Bot 调用 GitHub workflow dispatch API。

`collect-on-push.yml` 在 `main` 收到包含 `site/`、`.sync/` 以外文件改动的推送时,自动派发 `collect.yml` 的 `workflow_dispatch`,固定 `ref=main`,`request_id=push-<完整提交 SHA>`,不传 `source_repository`。它使用本仓 `GITHUB_TOKEN`,仅声明 `contents: read` 和 `actions: write`;不在 PR 上运行,也不取消正在执行的采集。`paths-ignore` 排除 `site/**` 与 `.sync/**`,因此只修改这两个目录的采集提交不会再次派发;源码与数据混合的推送仍会触发。定时、手动及 Bot 触发保持不变,Pages 仍由 `site/` 的提交触发。

Expand Down
2 changes: 2 additions & 0 deletions docs/dashboard-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

看板只展示已采集的稳定状态,不运行测试。页面依次为:总览、Issue、PR、CI、测试、Coverage、版本验证、运维、GitCode 同步(见 [GitCode 同步记录](gitcode-sync.md))。配置了[分支线](branch-lines.md)时,CI、测试、Coverage 页首可在 main、legacy 与 release 分支之间切换,每次只显示一条分支线。旧的“看板”“构建报告”“历史数据”页已移除;看板形式并入 Issue 与 PR 页,历史分片仍作为采集器的存储保留。

页首显示快照时间。没有数据变化的采集不改快照时间,新的 UTC 日期会重建一次,Bot 至少每 8 小时采集一次;所以快照超过 36 小时未更新时,页面提示采集可能已停止。

## 总览

总览面向“今天要处理什么”,从上到下依次展示以下内容。
Expand Down
6 changes: 4 additions & 2 deletions static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1426,8 +1426,10 @@
$('#meta').title='按浏览器时区显示';
$('#repo-link').title=snap.repo;
}
const stale=snap && Date.now()-new Date(snap.generated_at)>7200000;
const message=STATE.clientError || [...(snap?.notices||[]).map(n=>n.message).filter(message=>message !== '部分补充信息不可读取,请以 GitHub 原页面为准。'), ...(stale?['快照超过两小时未更新;当前显示最后一次发布的数据。']:[])].join(' ');
// A quiet collection keeps the snapshot's time, a new UTC day rebuilds it, and the bot collects at
// least every eight hours: an older snapshot means collection has stopped.
const stale=snap && Date.now()-new Date(snap.generated_at)>36*3600000;
const message=STATE.clientError || [...(snap?.notices||[]).map(n=>n.message).filter(message=>message !== '部分补充信息不可读取,请以 GitHub 原页面为准。'), ...(stale?['快照超过 36 小时未更新,采集可能已停止;当前显示最后一次发布的数据。']:[])].join(' ');
banner.className='banner '+(message?'warn':'hidden');banner.textContent=message;
document.querySelectorAll('#tabs a').forEach(a=>{
const active=a.dataset.tab===STATE.tab;a.classList.toggle('active',active);
Expand Down
8 changes: 4 additions & 4 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GitHub 状态看板</title>
<!-- Keep the UI bundle on one cache version so GitHub Pages cannot mix old CSS with new JS. -->
<link rel="stylesheet" href="./style.css?v=20261015.5">
<link rel="stylesheet" href="./style.css?v=20261017.1">
</head>
<body>
<header class="topbar">
Expand Down Expand Up @@ -48,8 +48,8 @@
<aside id="drawer" class="drawer hidden" aria-label="卡片详情"></aside>
<dialog id="board-settings" class="settings"></dialog>
<div id="tooltip" class="tooltip hidden"></div>
<script src="./board-local.js?v=20261015.5"></script><script src="./app.js?v=20261015.5"></script>
<script src="./board.js?v=20261015.5"></script>
<script src="./gitcode-sync.js?v=20261015.5"></script>
<script src="./board-local.js?v=20261017.1"></script><script src="./app.js?v=20261017.1"></script>
<script src="./board.js?v=20261017.1"></script>
<script src="./gitcode-sync.js?v=20261017.1"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion test/journey-board.spec.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('all existing pages render; only static requests and no promotional copy',
await expect(page.locator('#tab-overview .ci-lane-row[data-lane="pr"] .ci-lane-day')).toHaveCount(14);
await expect(page.locator('#tab-overview')).toContainText('v1.0');
await expect(page.locator('#meta')).toContainText('20:00');
await expect(page.locator('#global-banner')).toContainText('超过两小时');
await expect(page.locator('#global-banner')).toContainText('超过 36 小时未更新');
await expect(page.locator('body')).not.toContainText('把进展与风险放在同一页');
await page.screenshot({path:shot('overview-desktop'),fullPage:true});
await expect(page.locator('.topbar #tabs a')).toHaveCount(9);
Expand Down
Loading