Skip to content

Commit c537d22

Browse files
refactor: contributors run nothing; auto-regenerate index on merge
- Rename community/scripts -> community/_ci (maintainer/CI-only tooling; no longer collides with the top-level scripts/ bucket or invites contributors in) - Drop the contributor "regenerate the index" step from community/CONTRIBUTING.md - Remove the index-freshness gate from community-check.yml (PR gate is now just entry validation) - Add community-index.yml: regenerate community/README.md from meta.yaml on merge to main and commit it back if changed (path-excludes README.md to avoid re-trigger); build_index parses YAML only, never runs contributor code - Update RESERVED_DIRS and all path references Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2a20835 commit c537d22

13 files changed

Lines changed: 74 additions & 20 deletions

.github/workflows/community-check.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ name: Community Entry Check
22

33
# Lightweight, non-executing gate for community showcase entries.
44
# It does NOT run contributor code. It validates entry structure, scans for
5-
# committed secrets, confirms hosted entries use Opik, and verifies the
6-
# generated showcase index is up to date. Secrets-free, so it runs on forks.
5+
# committed secrets, and confirms hosted entries use Opik. Secrets-free, so it
6+
# runs on forks. The showcase index (community/README.md) is regenerated
7+
# separately on merge by community-index.yml — contributors run nothing.
78
#
89
# Community entries are intentionally exempt from the verified-bucket workflows
910
# (compliance / pr-test / test-notebooks / scheduled), which are path-scoped to
@@ -32,26 +33,21 @@ jobs:
3233

3334
- name: Install tooling
3435
run: |
35-
cd community/scripts
36+
cd community/_ci
3637
uv sync
3738
3839
- name: Unit-test the check tooling
3940
run: |
40-
cd community/scripts
41+
cd community/_ci
4142
uv run pytest -q
4243
4344
- name: Lint the check tooling
4445
run: |
45-
cd community/scripts
46+
cd community/_ci
4647
uv run ruff check .
4748
uv run ruff format --check .
4849
4950
- name: Validate all community entries
5051
run: |
51-
cd community/scripts
52+
cd community/_ci
5253
uv run python check_entry.py
53-
54-
- name: Verify showcase index is up to date
55-
run: |
56-
cd community/scripts
57-
uv run python build_index.py --check
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Community Index
2+
3+
# Regenerates the community showcase index (community/README.md) from every
4+
# entry's meta.yaml after changes land on main. This keeps the index current
5+
# with zero manual action — contributors never run the generator, and no one
6+
# hand-edits community/README.md.
7+
#
8+
# It runs build_index.py (which only parses YAML — it never executes contributor
9+
# code) and commits the result back to main only if it changed. The path filter
10+
# excludes community/README.md so this workflow's own index commit does not
11+
# re-trigger it.
12+
13+
on:
14+
push:
15+
branches: [main]
16+
paths:
17+
- "community/**"
18+
- "!community/README.md"
19+
20+
permissions:
21+
contents: write
22+
23+
concurrency:
24+
group: community-index
25+
cancel-in-progress: false
26+
27+
jobs:
28+
regenerate:
29+
runs-on: ubuntu-latest
30+
timeout-minutes: 10
31+
steps:
32+
- uses: actions/checkout@v7
33+
34+
- uses: astral-sh/setup-uv@v7
35+
with:
36+
version: "latest"
37+
enable-cache: true
38+
python-version: "3.12"
39+
40+
- name: Regenerate showcase index
41+
run: |
42+
cd community/_ci
43+
uv sync
44+
uv run python build_index.py
45+
46+
- name: Commit index if it changed
47+
run: |
48+
if [[ -n "$(git status --porcelain community/README.md)" ]]; then
49+
git config user.name "github-actions[bot]"
50+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
51+
git add community/README.md
52+
git commit -m "chore: regenerate community showcase index"
53+
git push
54+
else
55+
echo "Showcase index already up to date."
56+
fi

community/CONTRIBUTING.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ either Comet cloud or the self-hosted open-source platform.
2828
dashboard.
2929
4. If you want it considered for hosting, include your code in the folder — it
3030
must genuinely use Opik (`import opik`, `@opik.track`, ...).
31-
5. Regenerate the index: `cd community/scripts && uv run python build_index.py`
32-
(commit the updated `community/README.md`).
33-
6. Open a PR. A maintainer reviews it.
31+
5. Open a PR. A maintainer reviews it.
32+
33+
That's it — you don't need to run anything. The showcase index
34+
(`community/README.md`) is regenerated automatically when your entry merges, so
35+
your project appears there without any manual step on your part.
3436

3537
## What the automated check enforces
3638

37-
`community/scripts/check_entry.py` runs on your PR (a hard gate). It does **not**
39+
`community/_ci/check_entry.py` runs on your PR (a hard gate). It does **not**
3840
run your code. It checks:
3941

4042
- `meta.yaml` has all required fields, at least one link, and a valid

community/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Community
22

3-
<!-- This file is generated by community/scripts/build_index.py. Do not edit by hand. -->
3+
<!-- This file is generated by community/_ci/build_index.py. Do not edit by hand. -->
44

55
Work built with Opik by the open-source community. These entries are
66
**community-contributed and not maintainer-verified** — they are showcased here
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
_HEADER = """\
1010
# Community
1111
12-
<!-- This file is generated by community/scripts/build_index.py. Do not edit by hand. -->
12+
<!-- This file is generated by community/_ci/build_index.py. Do not edit by hand. -->
1313
1414
Work built with Opik by the open-source community. These entries are
1515
**community-contributed and not maintainer-verified** — they are showcased here
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
)
1414

1515
COMMUNITY_DIR = Path(__file__).resolve().parent.parent
16-
RESERVED_DIRS = {"scripts", "templates"}
16+
RESERVED_DIRS = {"_ci", "templates"}
1717

1818

1919
def discover_entries(community_dir: Path) -> list[Path]:
File renamed without changes.

0 commit comments

Comments
 (0)