@1aboveio/skills 1.0.25 → 1.0.27
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.
- package/.codex-plugin/plugin.json +1 -1
- package/.codex-plugin/resources.json +136 -135
- package/package.json +4 -4
- package/skills/app-dev/airflow/SKILL.md +1 -1
- package/skills/app-dev/android-development/SKILL.md +1 -1
- package/skills/app-dev/app-debug/SKILL.md +1 -1
- package/skills/app-dev/better-auth/SKILL.md +1 -1
- package/skills/app-dev/data-catalog/SKILL.md +1 -1
- package/skills/app-dev/data-quality/SKILL.md +1 -1
- package/skills/app-dev/ios-foundation/SKILL.md +1 -1
- package/skills/app-dev/maestro/SKILL.md +1 -1
- package/skills/app-dev/monorepo/SKILL.md +1 -1
- package/skills/app-dev/nextjs-fullstack/SKILL.md +1 -1
- package/skills/app-dev/prisma-setup/SKILL.md +1 -1
- package/skills/app-dev/pyspark/SKILL.md +1 -1
- package/skills/app-dev/python-backend/SKILL.md +1 -1
- package/skills/app-dev/shadcn/SKILL.md +1 -1
- package/skills/app-dev/zod-v4/SKILL.md +1 -1
- package/skills/cicd/cloud-build/SKILL.md +1 -1
- package/skills/cicd/cloud-debug/SKILL.md +1 -1
- package/skills/cicd/cloud-deploy/SKILL.md +1 -1
- package/skills/cicd/docker/SKILL.md +1 -1
- package/skills/cicd/github-actions/SKILL.md +24 -9
- package/skills/cicd/github-actions/references/audit-and-cleanup.md +116 -0
- package/skills/cicd/github-actions/references/audit-profile-optimize.md +3 -0
- package/skills/cicd/github-actions/references/pipeline.md +6 -4
- package/skills/cicd/github-actions/references/runners.md +9 -6
- package/skills/cicd/github-actions/references/speed-and-audit.md +22 -16
- package/skills/cicd/github-flow/SKILL.md +1 -1
- package/skills/cicd/github-flow/scripts/watch-checks.mjs +46 -2
- package/skills/cicd/google-cloud/SKILL.md +1 -1
- package/skills/cicd/mergify/SKILL.md +1 -1
- package/skills/cicd/podman/SKILL.md +1 -1
- package/skills/content/article-review/SKILL.md +1 -1
- package/skills/content/article-to-image/SKILL.md +1 -1
- package/skills/content/flowchart-svg/SKILL.md +1 -1
- package/skills/content/image-gen/SKILL.md +1 -1
- package/skills/content/mermaid/SKILL.md +1 -1
- package/skills/content/wechat-article-writer/SKILL.md +1 -1
- package/skills/content/wechat-publisher/SKILL.md +1 -1
- package/skills/content/wechat-search/SKILL.md +1 -1
- package/skills/content/xai-search/SKILL.md +1 -1
- package/skills/core/distill-writing/SKILL.md +1 -1
- package/skills/core/doc-to-md/SKILL.md +1 -1
- package/skills/core/editorial-review/SKILL.md +1 -1
- package/skills/core/house-style/SKILL.md +1 -1
- package/skills/core/plain-language/SKILL.md +1 -1
- package/skills/core/polish-cn/SKILL.md +1 -1
- package/skills/core/reg-parser/SKILL.md +1 -1
- package/skills/core/terminology/SKILL.md +1 -1
- package/skills/core/write-doc/SKILL.md +1 -1
- package/skills/core/write-report/SKILL.md +1 -1
- package/skills/engineering/better-review/SKILL.md +1 -1
- package/skills/engineering/e2e-test/SKILL.md +1 -1
- package/skills/engineering/engineering/SKILL.md +1 -1
- package/skills/engineering/engineering-runtime/SKILL.md +1 -1
- package/skills/engineering/engineering-runtime/coherence/workflow.json +13 -13
- package/skills/engineering/ensure-coverage/SKILL.md +1 -1
- package/skills/engineering/golden-path/SKILL.md +1 -1
- package/skills/engineering/harness-runtime/SKILL.md +1 -1
- package/skills/engineering/resolve-issues/SKILL.md +1 -1
- package/skills/engineering/resolve-release/SKILL.md +1 -1
- package/skills/engineering/rush-issues/SKILL.md +1 -1
- package/skills/engineering/rush-release/SKILL.md +1 -1
- package/skills/engineering/test-quality/SKILL.md +1 -1
- package/skills/risk-compliance/compliance-audit/SKILL.md +1 -1
- package/skills/risk-compliance/contract-compare/SKILL.md +1 -1
- package/skills/risk-compliance/contract-review/SKILL.md +1 -1
- package/skills/risk-compliance/doc-authenticity/SKILL.md +1 -1
- package/skills/risk-compliance/fraud-detection/SKILL.md +1 -1
- package/skills/risk-compliance/payment-analysis/SKILL.md +1 -1
- package/skills/risk-compliance/portfolio-payment-analysis/SKILL.md +1 -1
- package/skills/risk-compliance/similar-domain/SKILL.md +1 -1
- package/skills/risk-compliance/tld-detection/SKILL.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1aboveio/skills",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "Every 1aboveio skill package in one: install once, then choose which packages Pi loads with npx @1aboveio/skills select.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"nativeCodex": {
|
|
29
29
|
"schemaVersion": 1,
|
|
30
30
|
"metadataPath": ".codex-plugin/resources.json",
|
|
31
|
-
"metadataDigest": "
|
|
32
|
-
"releaseIdentity": "
|
|
31
|
+
"metadataDigest": "560d8d22851bef36fd55814ff343d80d39c82905ea4318ae43e9b29125a7a686",
|
|
32
|
+
"releaseIdentity": "9f07fb7b278d0812cfbbb9f581b4db61b80d9fd92e98478c026c47f06a3af994"
|
|
33
33
|
},
|
|
34
34
|
"pi": {
|
|
35
35
|
"skills": [
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
]
|
|
262
262
|
}
|
|
263
263
|
],
|
|
264
|
-
"digest": "
|
|
264
|
+
"digest": "cc2f6cae546894eb78e9ec9e721cd58070acda6c24c45b7a17abfc30f65e20f9"
|
|
265
265
|
},
|
|
266
266
|
"publishConfig": {
|
|
267
267
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: airflow
|
|
3
3
|
description: Airflow DAG architecture and conventions. Use when designing, writing, reviewing, testing, or debugging Airflow DAGs and tasks, including TaskGroups, data intervals, timezone-aware date parameters, CLI validation, environment-based scheduling, and pytest integrity tests.
|
|
4
4
|
user-invocable: true
|
|
5
|
-
release-version: 0.50.
|
|
5
|
+
release-version: 0.50.7
|
|
6
6
|
---
|
|
7
7
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
8
8
|
# Airflow DAG Development Patterns
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: android-development
|
|
3
3
|
description: "Prove and debug Expo / React Native apps on an owned Android emulator. Use for Android startup/rendering failures, Metro or ADB problems, native harness failures, APK builds, SDK/NDK/JDK workspace setup, native journey validation, and choosing Kotlin/Compose versus React Native for Android flows. Reproduce failed Android CI checkpoints off CI before fixing and redispatching. Standalone invocation offers Project or Session; init persists repo conventions. Maestro journey authoring, UI-driver migration and flow diagnosis belong to maestro. NOT for workflow YAML, CI speed or runners (github-actions), browser tests (e2e-test), iOS (ios-foundation), plain Jest tests, or signing/store release."
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Android development
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: app-debug
|
|
3
3
|
description: "Diagnose runtime failures in deployed Cloud Run services — 5xx/422 errors, tracebacks, Next.js SSR/hydration or Server Action failures, DB/Secret Manager connection errors, cold-start timeouts, container OOM. NOT for build or deploy failures (cloud-debug)."
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# App Debug
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: better-auth
|
|
3
3
|
description: "Add or debug Better Auth for Next.js App Router: login, sessions, protected routes, middleware, OAuth (including Feishu/Lark), cookies, Prisma, and Auth.js migration."
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Better Auth for Next.js
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: data-catalog
|
|
3
3
|
description: "Column definitions for warehouse tables, written inside the Spark/PySpark or SQL script that builds each table (CATALOG_TABLE / CATALOG_FIELDS, or a `-- @field` comment block), with a generated markdown catalog in docs/catalog/ and a CI check that fails a PR whose catalog is stale. Use when writing or changing a table script that adds, renames, removes, or changes the meaning of an output column or feature; when asked what a warehouse column or feature means; to set a repo up ('init the data catalog', 'generate the data dictionary', '字段字典', 'add catalog CI'); or to audit existing SQL or Spark scripts for undocumented columns. NOT for implementing or tuning the Spark job itself (pyspark), DAG wiring (airflow), or general workflow YAML (github-actions)."
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Data catalog
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: data-quality
|
|
3
3
|
description: "Check a published warehouse table's data against its data-catalog definitions with read-only SELECTs: columns never filled or stuck at one value, counts below zero, ratios outside 0–1, declared values that never appear and undeclared values that do. Then classify each finding as a wrong definition, wrong code, or wrong data. Use when asked whether a table's data is right, to profile or sanity-check a dwd/ads table, to find dead or constant columns, to check a column's values against its documented list, after a pipeline change ships, or when a data-catalog definition and the data might disagree. NOT for validating a Spark change before it ships (pyspark canary and reconciliation), writing definitions (data-catalog), or monitoring dashboards."
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Data quality
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ios-foundation
|
|
3
3
|
description: "Set up and prove an Expo / React Native native iOS workspace from an assigned or fresh isolated workspace to a manual Login smoke on an owned iOS Simulator: isolated workspace and private caches, Xcode/runtime/CocoaPods preflight, frozen install with `pod install --deployment`, platform-scoped prebuild, an ad-hoc-signed Debug simulator build, a private simulator by exact UDID, Metro on a free port, a disposable PostgreSQL backend with owned cleanup, and the evidence record (setup proof only; feature work reports the smoke result). Use for 'set up iOS', 'build the iOS app', 'run the app on the iOS simulator', 'add iOS to the React Native app', 'prove the iOS build', or when a pod install, xcodebuild, simulator boot, Metro connection or Keychain session fails. NOT for Android (android-development), signing, TestFlight or App Store release, or general workflow YAML (github-actions)."
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# iOS foundation
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: maestro
|
|
3
3
|
description: "Design, run, debug and migrate mobile E2E journeys with Maestro: complete flows and subflows, selectors, parameters, exclusive UI-driver ownership, non-UI authentication/backend helpers and failure evidence. Use for Maestro YAML/CLI/MCP work, slow fragmented mobile journeys, UiAutomation driver collisions, or replacing a hybrid Python/uiautomator2 UI harness. Android-first; use platform-neutral flow guidance for iOS only with its verified device/runtime contract. NOT for Android provisioning/builds (android-development), iOS setup (ios-foundation), browser Playwright tests (e2e-test), or CI workflow YAML (github-actions)."
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Maestro
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: monorepo
|
|
3
3
|
description: Turborepo architecture for shared packages, pnpm workspaces, DAL boundaries, and pipelines.
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Turborepo Monorepo Architecture
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: nextjs-fullstack
|
|
3
3
|
description: "Build or debug Next.js App Router features with React 19 — pages/layouts/route handlers, Server/Client Components, Server Actions, forms, middleware, DAL, strict TypeScript, Zod — plus our conventions: nuqs URL state, SWR cache, Skeleton/Progress + Sonner feedback, drag-and-drop upload, the portal app shell, list pages as filter/sort/paginate tables. shadcn component mechanics: see the shadcn skill."
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Next.js 16 Fullstack Development
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: prisma-setup
|
|
3
3
|
description: Use when adding or debugging Prisma with PostgreSQL, Next.js, or Turborepo, including schema.prisma, prisma.config.ts, client generation, migrations, seeds, relations, adapters, and DAL/database-layer setup. Triggers on phrases like "Prisma schema", "prisma migrate", "schema.prisma", "seed the database", "PrismaClient error", "relation issue", or "database layer".
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Prisma v7 Setup Guide
|
|
@@ -12,7 +12,7 @@ description: >
|
|
|
12
12
|
Connect, spark-submit, Hudi commits, backfills, validate-only canaries,
|
|
13
13
|
cluster reconciliation, or Spark event-log profiling — including warehouse
|
|
14
14
|
job timeouts, empty Hudi writes, or EMR/Dataproc performance regressions.
|
|
15
|
-
release-version: 0.50.
|
|
15
|
+
release-version: 0.50.7
|
|
16
16
|
---
|
|
17
17
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
18
18
|
# PySpark
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: python-backend
|
|
3
3
|
description: "Python backend architecture for FastAPI, Tortoise ORM, Pydantic Settings, loguru, and uv. Also: uv.lock installs in CI/Docker via a proxy or mirror (`uv sync --frozen` bypasses it), slow uv installs on runners, relocking."
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Python Backend Conventions
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: shadcn
|
|
3
3
|
description: "Add or debug shadcn/ui in a React/Next.js project: components.json, shadcn init/add, presets, registries, Tailwind styling, base/radix/aria composition, component fixes, and list-index pages — where the default is the DiceUI data table with filter/sort/pagination in the URL via nuqs, not a bare shadcn Table."
|
|
4
4
|
allowed-tools: Bash(npx shadcn@latest *), Bash(pnpm dlx shadcn@latest *), Bash(bunx --bun shadcn@latest *)
|
|
5
|
-
release-version: 0.50.
|
|
5
|
+
release-version: 0.50.7
|
|
6
6
|
---
|
|
7
7
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
8
8
|
# shadcn/ui
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zod-v4
|
|
3
3
|
description: Zod v4 schema conventions and v3 migration for errors, validators, objects, enums, records, and async parsing.
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Zod v3 to v4 Migration
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cloud-build
|
|
3
3
|
description: "Build or debug Cloud Build pipelines for Cloud Run: cloudbuild.yaml, triggers, Artifact Registry, builds, migrations, deploys, secrets, VPC, notifications. Use cloud-deploy for staged promotion. NOT for GitHub Actions PR checks (github-actions)."
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Cloud Build Direct Deploy to Cloud Run
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cloud-debug
|
|
3
3
|
description: "Debug Cloud Build or Deploy failures: builds, deployments, health checks, and pipeline errors. Inputs: service, build ID, region. NOT for GitHub Actions runs (github-actions) or runtime errors in a running service (app-debug)."
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Cloud Build & Cloud Deploy Debug Skill
|
|
@@ -5,7 +5,7 @@ description: >
|
|
|
5
5
|
CI/CD pipelines with staged promotion, verification gates, or GitFlow branching.
|
|
6
6
|
Also use when debugging Cloud Deploy pipeline failures. NOT for simple single-container
|
|
7
7
|
deploys — use cloud-build instead.
|
|
8
|
-
release-version: 0.50.
|
|
8
|
+
release-version: 0.50.7
|
|
9
9
|
---
|
|
10
10
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
11
11
|
# Cloud Deploy + Skaffold + Kustomize for Cloud Run
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: docker
|
|
3
3
|
description: Docker/Podman container architecture and build patterns. Read when designing or reviewing containerization, Dockerfile structure, multi-stage builds, PyPI mirror support, or docker-compose setup for Python/uv projects, and when a Dockerfile's dependency install misses the layer cache on every build (build args such as a commit SHA or version declared too early) or an image build is slow in CI.
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# Docker Build Patterns
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: github-actions
|
|
3
|
-
description: "Author, review, audit, profile, optimize, or debug GitHub Actions workflows (.github/workflows/*.yml): run-history audits, job and step timing, resource bottlenecks, before/after comparisons, conditional CI by changed path, the one required gate check, PR and merge-queue lanes, sharding, workers, caching, self-hosted runners, timeouts, concurrency, permissions and action pinning, post-deploy verification, npm publishing. Use for 'set up CI', 'CI is slow', 'profile CI', 'optimize our pipeline', 'audit CI for redundant or wasted jobs', 'why is this check stuck expected or never started', 'harden this workflow', or 'browser not found on the runner'. NOT for pushing, opening, or merging a PR, or writing CI conventions into CONTRIBUTING.md (github-flow), queue rules or a check unmet inside Mergify (mergify), Playwright config and specs (e2e-test), cloudbuild.yaml or Cloud Run deploys (cloud-build), or which gates a repo must prove (ensure-coverage)."
|
|
4
|
-
release-version: 0.50.
|
|
3
|
+
description: "Author, review, audit, profile, optimize, or debug GitHub Actions workflows (.github/workflows/*.yml): run-history audits, CI cleanup to get each job below five minutes, job and step timing, resource bottlenecks, before/after comparisons, conditional CI by changed path, the one required gate check, PR and merge-queue lanes, sharding, workers, caching, self-hosted runners, timeouts, concurrency, permissions and action pinning, post-deploy verification, npm publishing. Use for 'set up CI', 'CI is slow', 'profile CI', 'optimize our pipeline', 'audit CI for redundant or wasted jobs', 'why is this check stuck expected or never started', 'harden this workflow', or 'browser not found on the runner'. NOT for pushing, opening, or merging a PR, or writing CI conventions into CONTRIBUTING.md (github-flow), queue rules or a check unmet inside Mergify (mergify), Playwright config and specs (e2e-test), cloudbuild.yaml or Cloud Run deploys (cloud-build), or which gates a repo must prove (ensure-coverage)."
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# GitHub Actions
|
|
@@ -10,6 +10,10 @@ GitHub Actions verifies; Cloud Build builds and deploys. No workflow deploys to
|
|
|
10
10
|
|
|
11
11
|
## Workflow
|
|
12
12
|
|
|
13
|
+
For pipeline audits and cleanup, read [audit checklist and cleanup method](references/audit-and-cleanup.md).
|
|
14
|
+
It covers the whole skill, cgroup awareness, and the `test-quality` handoff for test cleanup.
|
|
15
|
+
The target is every job under five minutes, including setup and teardown; report exceptions.
|
|
16
|
+
|
|
13
17
|
For an existing pipeline, use **inspect -> fix -> verify**:
|
|
14
18
|
[inspect-fix-verify guidance](references/audit-profile-optimize.md). Inspect only enough
|
|
15
19
|
source and representative runs to choose an optimization, implement it for fix/optimize
|
|
@@ -66,9 +70,11 @@ replacement of an established pipeline during an audit or performance-only chang
|
|
|
66
70
|
- Keep one type-check gate and one lint gate; turn off the type check and lint inside
|
|
67
71
|
framework builds in other jobs.
|
|
68
72
|
- Shard E2E.
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
-
|
|
73
|
+
- **Cgroup awareness:** derive test/build workers, within-job parallelism and Node heap
|
|
74
|
+
limits from effective CPU and memory ceilings. Share the budget across concurrent
|
|
75
|
+
processes and reserve non-heap memory. Read [resource sizing](references/audit-and-cleanup.md#cgroup-awareness).
|
|
76
|
+
- For expensive test cleanup, load `test-quality` and follow its audit → fix → verify
|
|
77
|
+
method; CI owns worker counts and sharding.
|
|
72
78
|
- Put disposable Postgres on a size-bounded tmpfs by default. Disable durability only
|
|
73
79
|
when measured and the tests do not require persistence/recovery semantics.
|
|
74
80
|
- Screenshot and trace only failed tests.
|
|
@@ -79,9 +85,15 @@ replacement of an established pipeline during an audit or performance-only chang
|
|
|
79
85
|
- Load the pnpm lockfile once, at admission. Skip the re-load in the queue only with a repo
|
|
80
86
|
command for it, and never when the batch changed `pnpm-lock.yaml`.
|
|
81
87
|
|
|
82
|
-
**
|
|
83
|
-
-
|
|
84
|
-
-
|
|
88
|
+
**Performance target**
|
|
89
|
+
- Every job, including E2E and builds: < 5 min from job start through teardown.
|
|
90
|
+
- Full workflow run: ≤ 20 min; for merge-queue workflows, admission ≤ 5 min and
|
|
91
|
+
queue validation ≤ 15 min. Include E2E, builds, scheduling and dependency waits,
|
|
92
|
+
setup and teardown. These limits are inclusive; the per-job target stays < 5 min.
|
|
93
|
+
- Measure from run creation to completion, not by summing parallel job durations.
|
|
94
|
+
Break out scheduling wait and execution to locate the cause of a breach.
|
|
95
|
+
- Use the [cleanup method](references/audit-and-cleanup.md#cleanup-method) for over-budget jobs;
|
|
96
|
+
preserve validation and report any unmet target.
|
|
85
97
|
|
|
86
98
|
**Security**
|
|
87
99
|
- Set `permissions: contents: read` at the top.
|
|
@@ -102,6 +114,7 @@ replacement of an established pipeline during an audit or performance-only chang
|
|
|
102
114
|
|
|
103
115
|
| Read | When |
|
|
104
116
|
|---|---|
|
|
117
|
+
| [audit-and-cleanup.md](references/audit-and-cleanup.md) | Overall audit checklist, sub-five-minute jobs, cgroup sizing, test cleanup handoff |
|
|
105
118
|
| [audit-profile-optimize.md](references/audit-profile-optimize.md) | Profile the bottleneck, optimize its execution path, verify; expand only as needed |
|
|
106
119
|
| [ci-case-studies.md](references/ci-case-studies.md) | Anonymized CI improvements, measured results, failed experiments and evidence caveats |
|
|
107
120
|
| [conditional-ci.md](references/conditional-ci.md) | Template; path, event, or queue conditions |
|
|
@@ -112,6 +125,8 @@ replacement of an established pipeline during an audit or performance-only chang
|
|
|
112
125
|
| [post-deploy-and-publishing.md](references/post-deploy-and-publishing.md) | Post-deploy verification, npm publishing |
|
|
113
126
|
| [debugging.md](references/debugging.md) | Failed run, missing check, stuck job |
|
|
114
127
|
|
|
115
|
-
**Hand-offs:**
|
|
128
|
+
**Hand-offs:** test cleanup → `test-quality` (optional integration; load it before changing
|
|
129
|
+
tests; if unavailable, report that part blocked and continue independent CI cleanup);
|
|
130
|
+
what to prove → `ensure-coverage`; Playwright → `e2e-test`; build and deploy →
|
|
116
131
|
`cloud-build` / `cloud-deploy`; queue config and a stuck queued PR → `mergify`; push, PR,
|
|
117
132
|
merge, and CI conventions in `CONTRIBUTING.md` → `github-flow`.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# CI audit and cleanup
|
|
2
|
+
|
|
3
|
+
Read for a pipeline audit, CI cleanup, or a request to get jobs below five minutes.
|
|
4
|
+
Use the checklist across the requested pipeline for an audit; for a focused fix, inspect
|
|
5
|
+
only applicable areas. Read-only audits report findings. Cleanup requests implement and
|
|
6
|
+
verify the justified changes within scope.
|
|
7
|
+
|
|
8
|
+
## Audit checklist
|
|
9
|
+
|
|
10
|
+
For each applicable item, distinguish verified, finding, unknown, and not applicable.
|
|
11
|
+
Attach the job or file and evidence to findings; unknown means evidence is missing.
|
|
12
|
+
The run-history CLI supplies timing and redundancy leads, not a resource or security audit.
|
|
13
|
+
A compact response is sufficient; a report file is optional.
|
|
14
|
+
|
|
15
|
+
- [ ] **Selection:** changed paths select their consumers; shared inputs fan out;
|
|
16
|
+
unknown paths receive sufficient validation; skips are intentional and visible.
|
|
17
|
+
- [ ] **Gates and queues:** reducers preserve failures and missing results; required
|
|
18
|
+
names match protection; queue trees validate; repeated checks have a concrete purpose.
|
|
19
|
+
- [ ] **Job structure:** dependencies express actual prerequisites; independent work
|
|
20
|
+
runs concurrently; compatible checks share setup; downstream jobs reuse one build.
|
|
21
|
+
- [ ] **Cgroup awareness:** workers, build parallelism and heap limits follow effective
|
|
22
|
+
CPU and memory ceilings; concurrent commands share that budget; child containers have
|
|
23
|
+
explicit limits. Apply [resource sizing](#cgroup-awareness).
|
|
24
|
+
- [ ] **Runner ownership:** labels exist; fork guards precede allocation; workspace
|
|
25
|
+
cleanup is scoped; ports, files and services are private to the job.
|
|
26
|
+
- [ ] **Installs and caches:** installs preserve lockfile integrity; cache keys cover
|
|
27
|
+
inputs; cache transfer saves time; fleet proxies are inherited; images match consumers.
|
|
28
|
+
- [ ] **Timeouts and teardown:** job and inner command limits leave cleanup time;
|
|
29
|
+
cancellation removes owned containers and child processes; temporary resources expire.
|
|
30
|
+
- [ ] **Security:** permissions are minimal; third-party actions are pinned; untrusted
|
|
31
|
+
expressions pass through environment variables; secrets stay out of logs and artifacts.
|
|
32
|
+
- [ ] **Failure evidence:** useful logs and failure artifacts survive; retries are
|
|
33
|
+
visible; reporting cannot hide producer failures; scheduled failures alert an owner.
|
|
34
|
+
- [ ] **Test quality:** expensive tests prove distinct behavior; repeated setup, sleeps,
|
|
35
|
+
redundant matrices and weak assertions are assessed through `test-quality`.
|
|
36
|
+
- [ ] **Performance:** every job completes in **under five minutes**, including setup,
|
|
37
|
+
execution, artifact handling and teardown. Measure execution from job start to finish;
|
|
38
|
+
report runner queue wait separately. Identify missing timings and every over-budget job.
|
|
39
|
+
- [ ] **Run latency:** full workflow run ≤ 20 minutes; for merge-queue workflows,
|
|
40
|
+
admission ≤ 5 minutes and queue validation ≤ 15 minutes. Include E2E and builds.
|
|
41
|
+
Measure run creation through completion, including scheduling, dependency waits,
|
|
42
|
+
setup, execution, artifact handling and teardown. Apply the lane-specific limit
|
|
43
|
+
when relevant; equality meets the run limit. Report missing timing as unknown.
|
|
44
|
+
Do not sum parallel job times or omit trailing reporting jobs. Distinguish this
|
|
45
|
+
workflow duration from time spent waiting for admission to the merge queue.
|
|
46
|
+
|
|
47
|
+
## Cgroup awareness
|
|
48
|
+
|
|
49
|
+
Read limits where the workload executes, including inside a job-started container.
|
|
50
|
+
Resolve the process's cgroup and visible ancestor limits: on v2 use `cpu.max`,
|
|
51
|
+
`cpuset.cpus.effective` and `memory.max`; support the corresponding v1 quota, cpuset
|
|
52
|
+
and memory controls where needed. Combine finite quota/period limits with CPU affinity
|
|
53
|
+
and cpusets, taking the tightest applicable limits. Treat `max` and v1 unlimited memory
|
|
54
|
+
sentinels as unlimited, not numbers to allocate. For unavailable controls or non-Linux
|
|
55
|
+
runners, use a documented bounded runner allocation and log the fallback; host CPU count
|
|
56
|
+
alone does not establish a container's allowance.
|
|
57
|
+
|
|
58
|
+
Derive positive worker counts from the CPU budget, with a minimum of one for fractional
|
|
59
|
+
quotas; reduce for measured memory use or fixture isolation. Pass the computed count to
|
|
60
|
+
Playwright, Vitest, pytest, Node test concurrency and framework build workers instead of
|
|
61
|
+
hard-coding a fleet count or relying on host-core defaults. Increase parallelism within
|
|
62
|
+
the job while resources permit. Divide the budget among simultaneous commands and nested
|
|
63
|
+
worker pools; preserve every command's exit status and isolate mutable fixtures.
|
|
64
|
+
|
|
65
|
+
For a build running alone, derive `--max-old-space-size` in MiB from the effective memory
|
|
66
|
+
ceiling, reserving space for young-generation memory, native allocations, buffers and
|
|
67
|
+
build subprocesses. Old space is not total process memory: use most of the allocation
|
|
68
|
+
when measurements support it, rather than assigning 100% blindly. Scope the setting to
|
|
69
|
+
the build command; inherited `NODE_OPTIONS` can give each child the same heap allowance.
|
|
70
|
+
Log the detected ceilings, chosen workers and heap, and check throttling and peak memory
|
|
71
|
+
when tuning. A job-started sibling container using the host Docker/Podman API does not
|
|
72
|
+
inherit the runner container's limits: pass CPU and memory caps within the assigned
|
|
73
|
+
runner budget, then derive its worker counts inside that container.
|
|
74
|
+
|
|
75
|
+
## Cleanup method
|
|
76
|
+
|
|
77
|
+
1. **Measure the jobs.** Profile a representative successful run with
|
|
78
|
+
`scripts/ci-run-audit.mjs --repo <owner/repo> --profile-run <id> --json`.
|
|
79
|
+
List each job's elapsed time and dominant phases, plus full run duration and its
|
|
80
|
+
applicable overall/admission/queue limit. Trace run-level breaches through the
|
|
81
|
+
critical path, scheduling and dependencies even when every job is under five minutes.
|
|
82
|
+
Use history only to resolve a concrete redundancy or variability question.
|
|
83
|
+
Preserve existing gate names and meaning.
|
|
84
|
+
2. **Remove repeated work.** Select only relevant jobs; consolidate compatible short
|
|
85
|
+
checks; keep one qualifying type check and lint; build once for consumers. Remove
|
|
86
|
+
repeated installs, schema preparation and cache transfers when the evidence supports
|
|
87
|
+
it. Keep changed merge-queue trees validated and legitimate scheduled checks intact.
|
|
88
|
+
3. **Clean expensive tests through `test-quality`.** When tests dominate, load the
|
|
89
|
+
installed `test-quality` skill and follow its audit → fix → verify method and its
|
|
90
|
+
“When the goal is speed” guidance. Pass the slow suites, per-file/test timings,
|
|
91
|
+
existing behavior requirements and the execution budget remaining after job overhead.
|
|
92
|
+
Fix repeated fixture/subprocess setup first. Before deleting a redundant test, read
|
|
93
|
+
its named twin, confirm the same branch/input condition and equally strong assertions,
|
|
94
|
+
and find references to its name. Preserve distinct paths, review deletions freshly,
|
|
95
|
+
and run affected tests with real dependencies. An audit-only request stops at findings.
|
|
96
|
+
This integration is optional for CI work without test changes; if `test-quality` is
|
|
97
|
+
unavailable, continue independent workflow cleanup and report test cleanup blocked.
|
|
98
|
+
4. **Use the allocation.** Apply cgroup awareness to worker pools, framework builds and
|
|
99
|
+
independent commands. Then balance shards by measured duration when a suite still
|
|
100
|
+
exceeds its budget. Include repeated setup and shared runner capacity in the tradeoff;
|
|
101
|
+
moving time into queue waits or adding shards without a measured benefit is not done.
|
|
102
|
+
5. **Verify the result.** Run affected script checks and `actionlint` for workflow edits;
|
|
103
|
+
use `test-quality` verification for test changes. Compare the changed phases and each
|
|
104
|
+
job's full elapsed time and full run duration on a comparable runner and cache state.
|
|
105
|
+
Check both job and run limits: faster jobs can still leave a slow dependency chain.
|
|
106
|
+
Preserve all qualifying behavior and report any moved bottleneck or increased
|
|
107
|
+
runner consumption.
|
|
108
|
+
|
|
109
|
+
Completion means every in-scope job is measured below five minutes and each full run
|
|
110
|
+
meets its applicable limit (≤ 20 minutes overall, ≤ 5 minutes for merge-queue admission,
|
|
111
|
+
≤ 15 minutes for queue validation), with validation preserved. A five-minute timeout
|
|
112
|
+
is not evidence of success. Keep timeouts above measured execution with cleanup headroom;
|
|
113
|
+
do not skip tests, mask failures or rename/split a job solely to hide its cost. If a job
|
|
114
|
+
or run remains over budget, identify its dominant cause and next bounded action.
|
|
115
|
+
Report unmeasured changes as unverified and any necessary exception
|
|
116
|
+
as requiring agreement; do not claim the target is met or silently exempt E2E/build jobs.
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Inspect, fix, verify
|
|
2
2
|
|
|
3
|
+
For an overall pipeline audit or cleanup, first read the
|
|
4
|
+
[audit checklist and cleanup method](audit-and-cleanup.md): every job targets under
|
|
5
|
+
five minutes, including setup and teardown, with test cleanup handed to `test-quality`.
|
|
3
6
|
Use this loop for an existing pipeline. Optimization is the default focus: reduce
|
|
4
7
|
required-check latency or runner consumption while preserving validation, not fix every
|
|
5
8
|
red job or produce an investigation report. For fix/optimize requests, carry through
|
|
@@ -20,9 +20,11 @@ merge to main ────► Cloud Build: build → push by digest → migrate
|
|
|
20
20
|
rc tag ───────────► Cloud Build: prod candidate at 0% traffic ──► rush-release verifies, shifts traffic
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
- **PR lane:** prove the change.
|
|
24
|
-
- **Queue lane:** prove the merged result; run slow suites here.
|
|
25
|
-
|
|
23
|
+
- **PR lane:** prove the change. Merge-queue admission runs ≤ 5 min; other runs ≤ 20 min.
|
|
24
|
+
- **Queue lane:** prove the merged result; run slow suites here. Queue validation runs
|
|
25
|
+
≤ 15 min. Without a queue, run slow suites on the PR and require an up-to-date branch.
|
|
26
|
+
Run limits include E2E, builds and scheduling through full completion. Every job
|
|
27
|
+
separately targets < 5 min. See [timing criteria](speed-and-audit.md#sla).
|
|
26
28
|
- **No main test lane with a queue:** the queue already tested the tree that lands on `main`;
|
|
27
29
|
a merge to `main` triggers deploy, not a CI rerun. Without a queue, `push: main` tests it.
|
|
28
30
|
- **Post-deploy lane:** test the deployed revision, never a local build.
|
|
@@ -103,7 +105,7 @@ Require exactly one check, `gate`, in branch protection and the queue. Template:
|
|
|
103
105
|
- [ ] No `paths:` on a workflow that reports `gate`
|
|
104
106
|
- [ ] One `gate` job with `if: always()`; it is the only required check
|
|
105
107
|
- [ ] Area jobs gate on `changes` outputs; `gate` allows a skip only when that filter was false
|
|
106
|
-
- [ ]
|
|
108
|
+
- [ ] Full run meets its inclusive limit: overall ≤ 20 min, merge-queue admission ≤ 5 min, queue validation ≤ 15 min; include E2E/builds and scheduling. Every job separately targets < 5 min.
|
|
107
109
|
- [ ] Queue trigger handled (Mergify draft prefix or `merge_group`), if the repo uses a queue
|
|
108
110
|
- [ ] Self-hosted: fork guard, canonical labels, `persist-credentials: false`, dynamic service ports
|
|
109
111
|
- [ ] Third-party actions SHA-pinned (at least in jobs with secrets or `id-token`)
|
|
@@ -109,10 +109,12 @@ the tool image:
|
|
|
109
109
|
run: |
|
|
110
110
|
docker run --name "e2e-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}-${GITHUB_JOB}" --rm \
|
|
111
111
|
--network host --ipc=host --cpus 8 --memory 16g \
|
|
112
|
-
-e CI=true -e
|
|
112
|
+
-e CI=true -e DATABASE_URL \
|
|
113
113
|
-v "${GITHUB_WORKSPACE}:/work:z" -w /work \
|
|
114
114
|
"${PLAYWRIGHT_IMAGE}" \
|
|
115
|
-
bash -lc 'npm ci && timeout 20m
|
|
115
|
+
bash -lc 'npm ci && timeout 20m npm run test:e2e:ci'
|
|
116
|
+
# test:e2e:ci derives workers inside this container from effective cgroup limits;
|
|
117
|
+
# it passes that count to Playwright. Implement this repo-owned command before use.
|
|
116
118
|
- name: Remove the E2E container
|
|
117
119
|
if: always()
|
|
118
120
|
run: docker rm -f "e2e-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}-${GITHUB_JOB}" 2>/dev/null || true
|
|
@@ -126,10 +128,11 @@ the tool image:
|
|
|
126
128
|
never by wrapping the client (`timeout 20m docker run …`): killing the client detaches
|
|
127
129
|
the container, which then outlives the job.
|
|
128
130
|
- **Stay inside the measured slot**: the current configured default is
|
|
129
|
-
`--cpus 8 --memory 16g`;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
`--cpus 8 --memory 16g`; the example caps must be replaced with the actual runner
|
|
132
|
+
allocation when it differs. Derive Playwright and other worker counts inside the
|
|
133
|
+
executing container; reduce for memory-heavy apps and shared fixtures. Apply
|
|
134
|
+
[cgroup awareness](audit-and-cleanup.md#cgroup-awareness), including explicit sibling
|
|
135
|
+
container limits. Historical benchmark counts are evidence, not configuration defaults.
|
|
133
136
|
- `--network host` so the container reaches `services:` at the same `127.0.0.1` port;
|
|
134
137
|
`:z` on the workspace mount for SELinux.
|
|
135
138
|
- The fleet reaps CI containers older than about two hours. Keep every job well under that.
|
|
@@ -82,15 +82,12 @@ jobs hung for 24h.
|
|
|
82
82
|
`push: main` and gate reruns on `schedule:` instead of building evidence reuse, and keep
|
|
83
83
|
a heavy check in one lane (PR or queue), not both. A changed queue tree still needs
|
|
84
84
|
validation. Build once and pass the artifact to dependent jobs.
|
|
85
|
-
- **
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
run: pnpm exec playwright test
|
|
92
|
-
- run: pnpm vitest run --maxWorkers=4 # or: pytest -n 4
|
|
93
|
-
```
|
|
85
|
+
- **Cgroup awareness.** Derive worker counts and build heap limits at runtime from
|
|
86
|
+
effective CPU/memory limits; increase within-job parallelism while sharing the budget
|
|
87
|
+
across commands. Pass calculated counts explicitly to test/build tools. See
|
|
88
|
+
[resource sizing](audit-and-cleanup.md#cgroup-awareness) for limits, fallbacks and
|
|
89
|
+
sibling containers. Test-content cleanup belongs to `test-quality` through the
|
|
90
|
+
[cleanup method](audit-and-cleanup.md#cleanup-method).
|
|
94
91
|
- **Disposable Postgres.** Size-bounded tmpfs by default (`size=1g`); it changes no
|
|
95
92
|
durability setting. Profile launch, readiness and schema preparation separately. Turn
|
|
96
93
|
durability off only when measured and not testing persistence/recovery. Poll health
|
|
@@ -104,12 +101,21 @@ jobs hung for 24h.
|
|
|
104
101
|
|
|
105
102
|
## SLA
|
|
106
103
|
|
|
107
|
-
|
|
104
|
+
Every job, including E2E and builds, targets under five minutes including setup and
|
|
105
|
+
teardown. Apply the [audit checklist and cleanup method](audit-and-cleanup.md) to jobs
|
|
106
|
+
above that target. Also apply these inclusive full-run limits:
|
|
108
107
|
|
|
109
|
-
|
|
|
110
|
-
|
|
111
|
-
|
|
|
112
|
-
|
|
|
113
|
-
|
|
|
108
|
+
| Run type | Maximum duration |
|
|
109
|
+
|---|---|
|
|
110
|
+
| Overall workflow run | ≤ 20 min |
|
|
111
|
+
| Merge-queue admission | ≤ 5 min |
|
|
112
|
+
| Queue validation | ≤ 15 min |
|
|
113
|
+
|
|
114
|
+
For merge-queue workflows, use the applicable admission or queue limit. Measure from
|
|
115
|
+
run creation through completion, including scheduling, dependency waits, E2E, builds,
|
|
116
|
+
artifacts and teardown. Break out wait and execution for diagnosis; do not sum parallel
|
|
117
|
+
job times or stop timing at an earlier gate while reporting jobs still run. Queue
|
|
118
|
+
residence before the validation workflow is created is a separate measurement.
|
|
114
119
|
|
|
115
|
-
Over budget -> inspect the critical
|
|
120
|
+
Over either job or run budget -> inspect the critical path and scheduling, fix the
|
|
121
|
+
cause, and verify both limits. Several individually fast jobs can still form a slow run.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: github-flow
|
|
3
3
|
description: "Deliver a committed change to done: push, open a PR, wait for its checks, and merge through the repo's flow (direct push, pull request, or merge queue). Use whenever you commit or finish a change, when CONTRIBUTING.md has a Delivery section, and for asks like 'commit this', 'push it', 'open a PR', 'ship it', 'land it', 'get it merged', 'is my PR green', 'wait for CI', 'merge once the checks pass', 'confirm it really merged'. Every wait here runs the bundled scripts/watch-checks.mjs: never hand-roll a gh pr view or gh pr checks --watch polling loop, and never call a branch merged without the merge commit. Also: declare a repo's delivery flow, or write the CI conventions and Delivery section into CONTRIBUTING.md on request. NOT for writing workflow YAML (github-actions), Mergify config or a stuck queued PR (mergify), cutting a release (resolve-release), or PRs that resolve-issues or rush-issues deliver."
|
|
4
|
-
release-version: 0.50.
|
|
4
|
+
release-version: 0.50.7
|
|
5
5
|
---
|
|
6
6
|
**Updates:** Once/session run `node <skill-base-dir>/release-check.mjs`.
|
|
7
7
|
# GitHub Flow
|
|
@@ -184,17 +184,61 @@ function readPr(args, timeoutMs) {
|
|
|
184
184
|
return { ok: false, error: 'required checks returned an invalid name' }
|
|
185
185
|
}
|
|
186
186
|
const names = new Set(required.data.map((check) => check.name))
|
|
187
|
+
// `gh pr checks --required` describes checks GitHub has reported, so a required context that
|
|
188
|
+
// has not started yet is invisible and the visible subset reads as complete. The repository's
|
|
189
|
+
// branch rulesets name every required context whether or not it has run, which is what the
|
|
190
|
+
// review bar actually is. Merge them in; a ruleset that cannot be read leaves the previous
|
|
191
|
+
// behaviour intact rather than failing the watch.
|
|
192
|
+
//
|
|
193
|
+
// The repository comes from the PR's own URL so this adds no extra provider read.
|
|
194
|
+
for (const context of readRequiredContexts(args.repo ?? repoFromUrl(pr.data.url), timeoutMs)) names.add(context)
|
|
187
195
|
if (names.size > 0) {
|
|
188
196
|
const rollup = Array.isArray(pr.data.statusCheckRollup) ? pr.data.statusCheckRollup : []
|
|
189
197
|
const selected = rollup.filter((check) => names.has(check?.name ?? check?.context))
|
|
190
|
-
|
|
191
|
-
|
|
198
|
+
// A required context with no rollup entry has not started. Report it as EXPECTED so the
|
|
199
|
+
// watcher waits for it, and so the existing never-started bound can fire if it never runs.
|
|
200
|
+
for (const name of names) {
|
|
201
|
+
if (!selected.some((check) => (check.name ?? check.context) === name)) {
|
|
202
|
+
selected.push({ name, status: 'EXPECTED' })
|
|
203
|
+
}
|
|
192
204
|
}
|
|
193
205
|
pr.data.statusCheckRollup = selected
|
|
194
206
|
}
|
|
195
207
|
return pr
|
|
196
208
|
}
|
|
197
209
|
|
|
210
|
+
/**
|
|
211
|
+
* Every required status context on the repository's active branch rulesets.
|
|
212
|
+
*
|
|
213
|
+
* Returns an empty list on any failure: a repository protected by classic branch protection, an
|
|
214
|
+
* unreadable ruleset, or a token without the permission to read one must not stop a watch that
|
|
215
|
+
* worked before, and `gh pr checks --required` still covers the checks that are running.
|
|
216
|
+
*/
|
|
217
|
+
function readRequiredContexts(repo, timeoutMs) {
|
|
218
|
+
if (!repo) return []
|
|
219
|
+
const perCall = Math.max(1000, Math.floor(timeoutMs / 3))
|
|
220
|
+
const list = ghJson(['api', `repos/${repo}/rulesets`], perCall, true)
|
|
221
|
+
if (!list.ok) return []
|
|
222
|
+
const contexts = new Set()
|
|
223
|
+
for (const summary of list.data) {
|
|
224
|
+
if (!summary || summary.enforcement !== 'active' || summary.target !== 'branch') continue
|
|
225
|
+
const detail = ghJson(['api', `repos/${repo}/rulesets/${summary.id}`], perCall)
|
|
226
|
+
if (!detail.ok) return [...contexts]
|
|
227
|
+
for (const rule of detail.data?.rules ?? []) {
|
|
228
|
+
if (rule?.type !== 'required_status_checks') continue
|
|
229
|
+
for (const check of rule.parameters?.required_status_checks ?? []) {
|
|
230
|
+
if (typeof check?.context === 'string' && check.context) contexts.add(check.context)
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return [...contexts]
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function repoFromUrl(value) {
|
|
238
|
+
const match = /^https?:\/\/[^/]+\/([^/]+)\/([^/]+)\/(?:pull|pulls)\//.exec(String(value ?? ''))
|
|
239
|
+
return match ? `${match[1]}/${match[2]}` : undefined
|
|
240
|
+
}
|
|
241
|
+
|
|
198
242
|
// One rollup entry -> {name, phase}. `statusCheckRollup` mixes CheckRun (status +
|
|
199
243
|
// conclusion) and StatusContext (state only) shapes, and `gh` does not normalise them.
|
|
200
244
|
// An entry that matches neither fails closed as `unknown` rather than reading as pending
|