Skip to content

ci: the gallery check on every PR, and a README note on how content arrives - #1

Merged
os-zhuang merged 2 commits into
mainfrom
claude/project-thread-adxihm
Nov 10, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/project-thread-adxihm

Conversation

@objectstack-fleet

Copy link
Copy Markdown

Requested by Steedos · project thread

Refs objectstack-ai/objectstack#31122

维护者速读

  • 改了什么:给画廊仓加一个只读检查工作流 Gallery check,每个 PR 都跑 export-gallery --check;README 加一段「内容怎么进来」的说明。
  • 为什么改:定时导出任务每个稳定版会在这里开一个 PR,由你一键合并;这一键安全的前提是 PR 先被机器检查过(index.json 合不合 schema、应用目录全不全、有没有 .env/node_modules/本机路径、框架版本是不是已发布的稳定版)。
  • 风险与回滚:工作流只有 contents: read,不推送、不评论、不执行 PR 里的文件;回滚即 revert 本 PR。
  • 先看:.github/workflows/gallery-check.yml(钉住的 objectstack 提交与三步安装、构建、检查)。
  • 两分钟验证:看本 PR 自己的 Gallery check 检查,预期绿色,日志末行 gallery check: clean。
  • 需要你做的:合并本 PR,并在 main 上开分支保护,把 Gallery check 设为必需检查(设置清单见 objectstack#31122 的报告评论)。

What changes

  • .github/workflows/gallery-check.yml (new), on pull_request, with permissions: contents: read only. Job name Gallery check, the context branch protection should require. It checks out this PR, and checks out objectstack-ai/objectstack at the pinned full SHA c2bb879fe71c16bd1d0b42708109efb7f6543d5d: the main commit that merged export-gallery --check (feat(scenarios): export-gallery --check, the mechanical check a gallery PR must pass objectstack#31748). Then it runs pnpm install --frozen-lockfile --filter '@objectstack/scenarios...' and OS_SKIP_DTS=1 pnpm --filter '@objectstack/scenarios^...' build. Last, pnpm --filter @objectstack/scenarios export-gallery --check "$GITHUB_WORKSPACE/gallery" fails the job with one line per finding.
  • Interim, named in the file: @objectstack/scenarios is not on npm yet, so the checker runs from source at the pin. Once a release carries it, the checkout, install and build steps become one npx --yes @objectstack/scenarios@VERSION export-gallery --check ., pinned to that exact version.
  • README.md: a "How content arrives" section, plus one sentence in the Chinese half. The content is generated, a PR from the scheduled export task is the normal path, every PR must pass the gallery check, and hand edits belong in apps/README.md only.

No content under apps/ or index.json is touched.

What the check fails on

index.json that does not match the exporter's schema (an absent one is an empty gallery); an entry without a complete apps/ID/ (README, run record, scorecard and transcript in JSON and Markdown, source/objectstack.config.ts, at least one screenshot, every listed screenshot on disk and none unlisted); a directory under apps/ that no entry lists; a framework.version that is not a stable @objectstack/cli release published on npm (npm view @objectstack/cli versions); and, anywhere in the tree, a .env* name, a node_modules directory, a symbolic link, or a text file naming a local absolute path.

Acceptance notes

  • Branch protection on main (PR only, Gallery check required) is a repository setting for the maintainer. This PR does not and cannot set it.
  • AGENTS.md lists the hand-written files, and the list does not name .github/workflows/gallery-check.yml. That file is outside this PR's surface (one workflow and the README note), so it is left alone. Adding the workflow to that list is a one-line follow-up.

Verification

The workflow's steps, run against this branch's tree
  • Fresh detached worktree of objectstack at c2bb879fe71c16bd1d0b42708109efb7f6543d5d. The filtered install exited 0. OS_SKIP_DTS=1 pnpm --filter '@objectstack/scenarios^...' build exited 0 in 35 s under the verify lock, on a shared box.
  • pnpm --filter @objectstack/scenarios export-gallery --check on this branch's tree (head b0145986: README, AGENTS.md, CLAUDE.md, LICENSE, .gitignore, apps/README.md, the workflow): gallery check: clean, exit 0.
  • Negative leg, same checkout: a copy of the tree with a .env file and an unlisted apps/stray/ gave exit 1 and two lines, app-unlisted apps/stray and env-file .env.
  • The YAML parses (yaml.safe_load).

Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants