Publishing commits to divan-data git; public names only; 'last edited' on poems #56

Merged
anas merged 1 commits from feature/git-publishing into main 2026-10-08 22:44:07 +00:00
Owner

Closes #34.

Publishing → git: every published version is a commit in the divan-data checkout:

  • author: the moderator, by public name (their profile name, else "موڈریٹر ") with a placeholder email;
  • message: <title>: <edit summary> (ورژن N);
  • trailers: Reviewed-by: (the L1), Approved-by: (the admin), Divan-Revision:, Divan-Version:;
  • exactly the work's .dtx and .json.

The commit id is stored with the version. DIVAN_GIT_PUSH=1 pushes after each commit; otherwise the daily sync or a release pushes (the open question in the roadmap). If DIVAN_DATA_DIR is not a git checkout, publishing still works, just without a commit.

Privacy fix in what was merged with #54: published files recorded moderators' email addresses, and divan-data is public. Now only public names are written, in the files and in git.

Poem pages show, for works with a Divan version: "دیوان کا ورژن ۲ · ترمیم: … · جائزہ: … · اشاعت: … · date · تبدیلی دیکھیں". The last part links to the commit diff (DIVAN_DATA_COMMIT_URL, default the Gitea commit page).

Daily sync: deploy/sync.sh now pulls with --rebase, so commits made by publishing are kept.

Admins are super moderators (owner): edit, review and publish any work without grants. This was already so; it is now documented.

Tested: npm test 35 pass. The pipeline test runs against a temporary git repository and checks:

  • the commit exists, with the author's public name and placeholder email;
  • the version is in the message, and the reviewer and approver are in the trailers;
  • only the two files are committed;
  • the stored commit id matches;
  • no email address appears in the files or in git.

🤖 Generated with Claude Code

Closes #34. **Publishing → git**: every published version is a commit in the divan-data checkout: - author: the moderator, **by public name** (their profile name, else "موڈریٹر <number>") with a placeholder email; - message: `<title>: <edit summary> (ورژن N)`; - trailers: `Reviewed-by:` (the L1), `Approved-by:` (the admin), `Divan-Revision:`, `Divan-Version:`; - exactly the work's `.dtx` and `.json`. The commit id is stored with the version. `DIVAN_GIT_PUSH=1` pushes after each commit; otherwise the daily sync or a release pushes (the open question in the roadmap). If `DIVAN_DATA_DIR` is not a git checkout, publishing still works, just without a commit. **Privacy fix** in what was merged with #54: published files recorded moderators' **email addresses**, and divan-data is public. Now only public names are written, in the files and in git. **Poem pages** show, for works with a Divan version: "دیوان کا ورژن ۲ · ترمیم: … · جائزہ: … · اشاعت: … · date · **تبدیلی دیکھیں**". The last part links to the commit diff (`DIVAN_DATA_COMMIT_URL`, default the Gitea commit page). **Daily sync**: `deploy/sync.sh` now pulls with `--rebase`, so commits made by publishing are kept. **Admins are super moderators** (owner): edit, review and publish any work without grants. This was already so; it is now documented. **Tested**: `npm test` 35 pass. The pipeline test runs against a temporary git repository and checks: - the commit exists, with the author's public name and placeholder email; - the version is in the message, and the reviewer and approver are in the trailers; - only the two files are committed; - the stored commit id matches; - no email address appears in the files or in git. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
anas added 1 commit 2026-10-08 22:37:41 +00:00
- api/src/git.ts: each published version is a commit in the divan-data checkout (queued, one at a
  time): the moderator as author by public name with a placeholder email, the summary and version
  in the message, Reviewed-by / Approved-by / Divan-Revision / Divan-Version trailers;
  DIVAN_GIT_PUSH=1 pushes. The commit id is kept with the revision.
- Privacy fix: published files and commits carry public names (profile name, else 'موڈریٹر <id>'),
  never email addresses (divan-data is public).
- Poem pages: 'دیوان کا ورژن …' with who edited, reviewed and published, the date, and a link to
  the commit diff (DIVAN_DATA_COMMIT_URL).
- deploy/sync.sh: pull --rebase so publishing commits are kept.
- Admins are super moderators (documented).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anas merged commit 271d826fc2 into main 2026-10-08 22:44:07 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: anas/divan#56
No description provided.