Host on Gitea: forge.yaml, Gitea workflows, host-neutral links
- forge.yaml: the repository's host (Gitea at git.kenschiano.net, limited visibility); the "Report a run" collector, the page's links (data/public/links.json, filled in by site/build.js) and the dataset metadata read it - collection/etl/forge.py: issues, pull requests (merge when checks succeed) and labels for Gitea and GitHub; `python -m collection forge ...` - .gitea/workflows: CI and the daily update (pushes a branch, opens a pull request that merges itself, opens an issue when a source breaks); .github/workflows kept for GitHub - docs: Gitea setup (REPO_SETTINGS), the bot reading atlas files from the repository Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8713ccff1a
commit
614bfcda7c
+14
-1
@@ -9,7 +9,20 @@ Data flows both ways:
|
||||
└──────────── collection --source bot + PR ◄┘
|
||||
```
|
||||
|
||||
## Without GitHub: swapping zips
|
||||
## From the Atlas's Gitea repository
|
||||
|
||||
Both repositories live on git.kenschiano.net. The bot can read the atlas files straight from the repository with a
|
||||
Gitea token that can read it (the repository is "limited": signed-in users only), instead of a zip:
|
||||
|
||||
```
|
||||
https://git.kenschiano.net/<owner>/threshing-atlas/raw/branch/main/data/public/policy.json
|
||||
https://git.kenschiano.net/<owner>/threshing-atlas/raw/branch/main/core/solver.js
|
||||
https://git.kenschiano.net/<owner>/threshing-atlas/raw/branch/main/core/graph.js
|
||||
```
|
||||
|
||||
(header `Authorization: token <token>`). Keep the three files together: solver.js reads the game from policy.json.
|
||||
|
||||
## Without a shared repository: swapping zips
|
||||
|
||||
When GitHub Pages is not available, the same files travel as zips:
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ Rules every part of the project follows. If a change would break one, stop and a
|
||||
|
||||
## Run reports
|
||||
|
||||
"Report a run" creates a public GitHub issue. The pipeline keeps only the issue number, the date and the answers
|
||||
"Report a run" creates an issue on the Atlas's repository (forge.yaml), visible to everyone who can see it. The pipeline keeps only the issue number, the date and the answers
|
||||
(`data/public/reports.json`); GitHub usernames are dropped. The form asks people not to include account names. A
|
||||
report closed as "not planned" or labelled `invalid` or `duplicate` is left out of the data.
|
||||
|
||||
|
||||
@@ -1,5 +1,51 @@
|
||||
# Repository settings
|
||||
|
||||
The Atlas is hosted on Gitea (`forge.yaml`: git.kenschiano.net). The GitHub repository and its GitHub Pages site are
|
||||
paused while that account is suspended; their workflows stay in `.github/workflows/` for when it is back.
|
||||
|
||||
## Gitea: setting up the repository (once)
|
||||
|
||||
1. **Your account** on git.kenschiano.net (ask Ken), with 2FA on and your SSH key added (Settings → SSH / GPG Keys).
|
||||
2. **Create the repository** `threshing-atlas` under your account, visibility **limited** (only people signed in to
|
||||
the server), empty (no README or licence: they come from the push). Put your username in `forge.yaml` (`repo:`),
|
||||
then `python -m collection build` and commit.
|
||||
3. **Push** from your Mac copy:
|
||||
|
||||
```
|
||||
cd ~/PycharmProjects/threshing-atlas
|
||||
git remote rename origin github # keep the GitHub address for later
|
||||
git remote add origin git@git.kenschiano.net:<you>/threshing-atlas.git
|
||||
git push -u origin main
|
||||
```
|
||||
|
||||
4. **Turn on Actions** (repository Settings → Units → Actions) and ask Ken which runner label the server has. The
|
||||
workflows use `ubuntu-latest`; change `runs-on:` in `.gitea/workflows/*.yml` if it is different.
|
||||
5. **Secrets** (Settings → Actions → Secrets):
|
||||
|
||||
| Secret | What it is | How to make it |
|
||||
|---|---|---|
|
||||
| `ATLAS_BOT_TOKEN` | lets the daily update push its branch, open the pull request and issues | your Settings → Applications → Generate token; permissions: repository read and write, issue read and write |
|
||||
| `RAW_ARCHIVE_KEY` | encrypts the private raw store kept in the Actions cache between runs | any long random string (`openssl rand -base64 32`); keep a copy |
|
||||
| `REDDIT_CLIENT_ID`, `REDDIT_CLIENT_SECRET` | optional: read the megathreads through the Reddit API | see "Data collection secrets" below |
|
||||
|
||||
6. **Protect main** (Settings → Branches → Add rule for `main`): require a pull request, enable status checks and
|
||||
require the check from the CI workflow (it shows up as `CI / test` after its first run), and allow
|
||||
"merge when checks succeed". Leave required approvals at 0 so the daily update can merge itself.
|
||||
7. **The label** for reports: `python -m collection forge ensure-label --name "run report"` (with
|
||||
`ATLAS_BOT_TOKEN` set), or create it under Issues → Labels.
|
||||
|
||||
The daily update then runs at 10:23 UTC; run it by hand from the Actions tab (workflow "Check sources for new data").
|
||||
Locally, `python -m collection refresh` does the same.
|
||||
|
||||
## The page
|
||||
|
||||
The page is built by `node site/build.js` and viewed locally or published as a Claude artifact; Gitea has no Pages.
|
||||
Its links (the repository, "Report a run") come from `forge.yaml` through `data/public/links.json`.
|
||||
|
||||
## GitHub (paused)
|
||||
|
||||
# Repository settings
|
||||
|
||||
Some settings live on GitHub, not in the code. Only the repository owner (ekcSchiano) can change them.
|
||||
They go together: the ruleset makes CI a gate on `main`, auto-merge lets a pull request merge itself once
|
||||
it passes, and the token lets the daily data update do that on its own.
|
||||
|
||||
Reference in New Issue
Block a user