GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Repo metadata: each repo's type in .github/logix-repo-metadata.jsonc · openlogix/.github@674ff91

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github
    • logix-repo-metadata.jsonc
  • CLAUDE.md
  • README.md
  • repos-janitor
    • janitor.py
  • schemas
    • logix-repo-metadata-v1.json
  • tests/repos-janitor
    • expected-output.txt
    • fake-gh
      • gh
    • org/repos/openlogix
      • .github
        • files/.github
          • logix-repo-metadata.jsonc
        • topics
      • logix-catalog
        • files/.github
          • logix-repo-metadata.jsonc
        • topics
      • logix-cli
        • files/.github
          • logix-repo-metadata.jsonc
        • topics
      • logix-core
        • files/.github
          • logix-repo-metadata.jsonc
        • topics
      • logix-engine
        • files/.github
          • logix-repo-metadata.jsonc
        • topics
      • logix-ide
        • files/.github
          • logix-repo-metadata.jsonc
        • topics
      • logix-studio
        • files/.github
          • logix-repo-metadata.jsonc
        • topics
    • run.sh
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/logix-repo-metadata.jsonc‎

Copy file name to clipboard
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This repo's Open Logix metadata, read by repos-janitor (the website repo's
2+
// CLAUDE.md, Repo types, owns the policy). Change it only by pull request.
3+
{
4+
"$schema": "https://www.openlogix.org/schemas/logix-repo-metadata-v1.json",
5+
// Only read: shared actions, schemas and repos-janitor.
6+
"type": "no-releases"
7+
}
Collapse file

‎CLAUDE.md‎

Copy file name to clipboardExpand all lines: CLAUDE.md
+3-2Lines changed: 3 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ Guidance for Claude working in this repo, `openlogix/.github`. It is GitHub's sp
44

55
## What's here
66

7-
**Repo type: no releases** (topic `openlogix-no-releases`; the website repo's `CLAUDE.md`, Repo types, owns the policy). Its tests make no releases (the release tests use a fake `gh`), so it has none.
7+
**Repo type: no releases** (`.github/logix-repo-metadata.jsonc`; the website repo's `CLAUDE.md`, Repo types, owns the policy). Its tests make no releases (the release tests use a fake `gh`), so it has none.
88

99
- `actions/<name>/action.yaml`: composite GitHub Actions shared by the Open Logix repos' CI and release workflows. [README.md](README.md) lists them.
1010
- `.github/workflows/actions-test.yaml`: tests the actions.
1111
- `profile/README.md`: the org page at github.com/openlogix. A table of all Open Logix repos for developers: repo, what it is, status. The repo list, descriptions and statuses follow the website repo's `CLAUDE.md` (Repos, Availability); when those change, update this table too.
12+
- `schemas/logix-repo-metadata-v1.json`: the schema of every repo's `.github/logix-repo-metadata.jsonc` (its type; Repo types, in the website repo's `CLAUDE.md`), owned here, with a copy on the website.
1213
- `schemas/logix-remote-config-v1.json`: the schema every remote config names in `$schema` (Remote updates, the website repo's `CLAUDE.md`), owned here; the website serves a copy at `www.openlogix.org/schemas/`, so copy it there whenever it changes. Until the first release it changes without a new version.
1314
- `tests/<action>/`: fixtures for an action's tests, such as `tests/check-remote-config/` (cases, fixture releases, a fake `gh` and `run.sh`).
1415
- Later, possibly: default community files (`CONTRIBUTING.md`, `SECURITY.md`, issue templates) and `workflow-templates/`. Add them only when asked.
@@ -37,7 +38,7 @@ A workflow here that checks what no single repo's CI can see and reports problem
3738
| `schema-copy-should-match` | a website `docs/schemas/` file |
3839
| `daily-build-should-pass` | a scheduled workflow's last scheduled run on `main` |
3940
| `daily-build-should-be-recent` | the same, run in the last 26 hours |
40-
| `repo-should-have-one-type` | a repo's type topics |
41+
| `repo-metadata-should-be-valid` | a repo's `.github/logix-repo-metadata.jsonc`: present, valid against `schemas/logix-repo-metadata-v1.json` (`type`: `installable`, `dependency`, `no-releases`) |
4142
| `repo-should-have-no-releases` | a "no releases" repo |
4243

4344
The rules behind them are the website repo's `CLAUDE.md` (Remote updates, Repo types).
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The pre-release policy (pre-releases are kept about 5 days unless made stable) i
5151

5252
## repos-janitor
5353

54-
[repos-janitor.yaml](.github/workflows/repos-janitor.yaml) checks across the Open Logix repos every 6 hours what no single repo's CI can see, as requirements (as Apio's janitor): remote configs valid, the releases they name valid and (for prod) stable, each repo's Latest right for its type, dev configs not behind prod, release tags that are dates, the website's schema copies, every repo's daily builds, and one type topic per repo. Its run summary lists the errors and warnings, each with why it applies, the result and links to fix it, then what passed; the run, and its badge above, go red on any error. It only reads, and only reports for now.
54+
[repos-janitor.yaml](.github/workflows/repos-janitor.yaml) checks across the Open Logix repos every 6 hours what no single repo's CI can see, as requirements (as Apio's janitor): remote configs valid, the releases they name valid and (for prod) stable, each repo's Latest right for its type, dev configs not behind prod, release tags that are dates, the website's schema copies, every repo's daily builds, and each repo's type in its `.github/logix-repo-metadata.jsonc`. Its run summary lists the errors and warnings, each with why it applies, the result and links to fix it, then what passed; the run, and its badge above, go red on any error. It only reads, and only reports for now.
5555

5656
## Versions
5757

Collapse file

‎repos-janitor/janitor.py‎

Copy file name to clipboardExpand all lines: repos-janitor/janitor.py
+40-23Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@
4848
CONFIG_FILE = re.compile(r"^remote-config/([^/]+)/([^/]+)/([^/]+)$")
4949
CHANNEL_CONFIG = re.compile(r"^remote-config/[^/]+/[0-9]{3}/(?!channels\.jsonc$)[a-z][a-z0-9-]*\.jsonc$")
5050
WORKFLOW = re.compile(r"^\.github/workflows/[^/]+\.ya?ml$")
51-
# Repo types (the website repo's CLAUDE.md, Repo types): one GitHub topic
52-
# per repo.
53-
TYPES = {"openlogix-installable": "installable", "openlogix-dependency": "dependency",
54-
"openlogix-no-releases": "no releases"}
51+
# Repo types (the website repo's CLAUDE.md, Repo types), from each repo's
52+
# metadata file.
53+
METADATA = ".github/logix-repo-metadata.jsonc"
54+
METADATA_SCHEMA = "https://www.openlogix.org/schemas/logix-repo-metadata-v1.json"
55+
TYPES = ["installable", "dependency", "no-releases"]
5556
# Where the release model's rules are (Remote updates, Repo types).
5657
POLICY_URL = "https://github.com/openlogix/openlogix.github.io/blob/main/CLAUDE.md"
5758
DATE_TAG = re.compile(r"^[0-9]{4}-[0-9]{2}-[0-9]{2}$")
@@ -75,7 +76,7 @@
7576
"schema-copy-should-match": "Schema copy should match its owner",
7677
"daily-build-should-pass": "Daily build should pass",
7778
"daily-build-should-be-recent": "Daily build should be recent",
78-
"repo-should-have-one-type": "Repo should have one type",
79+
"repo-metadata-should-be-valid": "Repo metadata should be valid",
7980
"repo-should-have-no-releases": "Repo should have no releases",
8081
}
8182

@@ -217,13 +218,29 @@ def __init__(self, info: dict) -> None:
217218
self.name = info["full_name"]
218219
self.short = info["name"]
219220
self.branch = info["default_branch"]
220-
self.topics = sorted(t for t in info.get("topics", []) if t in TYPES)
221-
self.type = TYPES[self.topics[0]] if len(self.topics) == 1 else None
222221
tree = api(f"repos/{self.name}/git/trees/{self.branch}?recursive=1") or {}
223222
self.files = [t["path"] for t in tree.get("tree", []) if t["type"] == "blob"]
224223
self._releases = None
225224
self._latest = "unread"
226225
self._channels = None
226+
# The metadata file: its problem (None when it's valid) and the type.
227+
self.type, self.metadata_problem = self.read_metadata()
228+
229+
def read_metadata(self) -> tuple[str | None, str | None]:
230+
if METADATA not in self.files:
231+
return None, f"There's no `{METADATA}`."
232+
try:
233+
data = json.loads(strip_comments(raw(self.name, METADATA, self.branch)))
234+
except ValueError as e:
235+
return None, f"It isn't valid JSONC: {e}"
236+
if not isinstance(data, dict) or data.get("$schema") != METADATA_SCHEMA:
237+
return None, f"Its `$schema` must be `{METADATA_SCHEMA}`."
238+
extra = sorted(set(data) - {"$schema", "type"})
239+
if extra:
240+
return None, f"It has unknown keys: {', '.join(f'`{k}`' for k in extra)}."
241+
if data.get("type") not in TYPES:
242+
return None, f"Its `type` must be {', '.join(f'`{t}`' for t in TYPES)}, not `{data.get('type')}`."
243+
return data["type"], None
227244

228245
def latest(self) -> str | None:
229246
"""The tag GitHub marks Latest; None without a stable release, or
@@ -592,25 +609,25 @@ def check_tags(repo: Repo, report: Report) -> None:
592609

593610

594611
def check_type(repo: Repo, report: Report) -> None:
595-
"""repo-should-have-one-type and repo-should-have-no-releases."""
612+
"""repo-metadata-should-be-valid and repo-should-have-no-releases."""
596613
page = f"https://github.com/{repo.name}"
597-
inst = report.require(repo.name, "repo-should-have-one-type", repo.name, f"[{repo.name}]({page})", repo.name)
598-
inst.because("Each Open Logix repo declares its type with one GitHub topic, shown under About on its GitHub page: "
599-
"`openlogix-installable` (people install it), `openlogix-dependency` (programs download it) or "
600-
"`openlogix-no-releases` (it's only read). The type decides its release policy "
601-
f"([Repo types]({POLICY_URL})).")
602-
inst.link("the repo's page (topics under About)", page)
603-
if not repo.topics:
604-
inst.verdict(False, "It has no type topic: add `openlogix-installable`, `openlogix-dependency` "
605-
"or `openlogix-no-releases`.")
606-
return
607-
if len(repo.topics) > 1:
608-
inst.verdict(False, f"It has several: {', '.join(f'`{t}`' for t in repo.topics)}. Keep one.")
614+
file_url = blob(repo.name, repo.branch, METADATA)
615+
inst = report.require(repo.name, "repo-metadata-should-be-valid", repo.name,
616+
f"[`{METADATA}`]({file_url})", METADATA, file=METADATA)
617+
inst.because(f"Each Open Logix repo declares its type in `{METADATA}`: `installable` (people install it), "
618+
"`dependency` (programs download it) or `no-releases` (it's only read). The type decides its "
619+
f"release policy ([Repo types]({POLICY_URL})).")
620+
if METADATA in repo.files:
621+
inst.link("the file", file_url)
622+
else:
623+
inst.link("create the file", f"https://github.com/{repo.name}/new/{repo.branch}?filename={METADATA}")
624+
if repo.metadata_problem:
625+
inst.verdict(False, repo.metadata_problem)
609626
return
610-
inst.verdict(True, f"Its type is \"{repo.type}\": it has the topic `{repo.topics[0]}`.")
611-
if repo.type == "no releases":
627+
inst.verdict(True, f"Its type is `{repo.type}`.")
628+
if repo.type == "no-releases":
612629
nr = report.require(repo.name, "repo-should-have-no-releases", repo.name, f"[{repo.name}]({page})", repo.name)
613-
nr.because(f"Its type is \"no releases\" (topic `openlogix-no-releases`): it's only read, never downloaded "
630+
nr.because(f"Its type is `no-releases` ([`{METADATA}`]({file_url})): it's only read, never downloaded "
614631
f"([Repo types]({POLICY_URL})).").link("the releases", releases_page(repo.name))
615632
tags = [r["tag_name"] for r in repo.all_releases()]
616633
nr.verdict(not tags, "It has no releases." if not tags
Collapse file

‎schemas/logix-repo-metadata-v1.json‎

Copy file name to clipboard
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://www.openlogix.org/schemas/logix-repo-metadata-v1.json",
4+
"title": "Open Logix repo metadata",
5+
"description": "What an Open Logix repo is, for the org's tools: .github/logix-repo-metadata.jsonc in each repo, changed only by pull request. repos-janitor reads it. The file is JSONC: comments say why.",
6+
"type": "object",
7+
"required": ["$schema", "type"],
8+
"properties": {
9+
"$schema": {
10+
"const": "https://www.openlogix.org/schemas/logix-repo-metadata-v1.json"
11+
},
12+
"type": {
13+
"description": "The repo type, which decides its release policy (Repo types, in the website repo's CLAUDE.md): installable (a product people install, from its release marked Latest; also when programs download it too), dependency (data or tools programs download, as remote configs name them) or no-releases (it's only read: no releases at all).",
14+
"enum": ["installable", "dependency", "no-releases"]
15+
}
16+
},
17+
"additionalProperties": false
18+
}
Collapse file

‎tests/repos-janitor/expected-output.txt‎

Copy file name to clipboardExpand all lines: tests/repos-janitor/expected-output.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
::error title=Latest should be a prod release (openlogix/logix-studio)::2026-11-02: It's on dev: promote it, or mark a prod release Latest.
1313
::error title=Schema copy should match its owner (openlogix/openlogix.github.io)::docs/schemas/logix-other-v1.json: No owner has schemas/logix-other-v1.json (logix-catalog, .github).
1414
::error title=Schema copy should match its owner (openlogix/openlogix.github.io)::docs/schemas/logix-remote-config-v1.json: It differs from its owner's file: copy it again.
15-
::error title=Repo should have one type (openlogix/openlogix.github.io)::openlogix/openlogix.github.io: It has no type topic: add openlogix-installable, openlogix-dependency or openlogix-no-releases.
15+
::error title=Repo metadata should be valid (openlogix/openlogix.github.io)::.github/logix-repo-metadata.jsonc: There's no .github/logix-repo-metadata.jsonc.
1616
repos-janitor: 8 repos, 15 errors, 36 passed.
Collapse file

‎tests/repos-janitor/fake-gh/gh‎

Copy file name to clipboardExpand all lines: tests/repos-janitor/fake-gh/gh
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env python3
22
"""A stand-in for the gh CLI in the repos-janitor tests: answers the calls
33
janitor.py and check_remote_config.py make from the fixture org in
4-
$FAKE_GH_ORG: repos/<owner>/<name>/ with topics (its topics), files/ (the default branch's
5-
files), releases.json, sums/<tag> (SHA256SUMS), files-of/<tag>/<name> (other
4+
$FAKE_GH_ORG: repos/<owner>/<name>/ with files/ (the default branch's
5+
files, such as .github/logix-repo-metadata.jsonc), releases.json, sums/<tag> (SHA256SUMS), files-of/<tag>/<name> (other
66
release files, such as BUILD-INFO.json) and runs/<workflow>.json."""
77
import json, os, sys
88
from pathlib import Path
@@ -46,8 +46,7 @@ if args[:1] == ["api"]:
4646
path, _, query = path.partition("?")
4747
parts = path.split("/")
4848
if path == "orgs/openlogix/repos":
49-
out([{"full_name": f"openlogix/{d.name}", "name": d.name, "default_branch": "main", "archived": False,
50-
"topics": (d / "topics").read_text().split() if (d / "topics").is_file() else []}
49+
out([{"full_name": f"openlogix/{d.name}", "name": d.name, "default_branch": "main", "archived": False}
5150
for d in sorted((org / "repos" / "openlogix").iterdir())])
5251
full = "/".join(parts[1:3])
5352
rest = parts[3:]
Collapse file

‎tests/repos-janitor/org/repos/openlogix/.github/files/.github/logix-repo-metadata.jsonc‎

Copy file name to clipboard
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// This repo's Open Logix type.
2+
{
3+
"$schema": "https://www.openlogix.org/schemas/logix-repo-metadata-v1.json",
4+
"type": "no-releases"
5+
}
Collapse file

‎tests/repos-janitor/org/repos/openlogix/.github/topics‎

Copy file name to clipboardExpand all lines: tests/repos-janitor/org/repos/openlogix/.github/topics
-1Lines changed: 0 additions & 1 deletion
This file was deleted.
Collapse file

‎tests/repos-janitor/org/repos/openlogix/logix-catalog/files/.github/logix-repo-metadata.jsonc‎

Copy file name to clipboard
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// This repo's Open Logix type.
2+
{
3+
"$schema": "https://www.openlogix.org/schemas/logix-repo-metadata-v1.json",
4+
"type": "dependency"
5+
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.