Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
self-hosted-runner:
labels: [hetzner, ci-general, t16, gaming]
63 changes: 63 additions & 0 deletions .github/workflows/devvit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: Devvit app

"on":
push:
branches: [main]
paths:
- 'devvit/**'
- 'modlog_wiki_publisher.py'
- '.github/workflows/devvit.yml'
pull_request:
branches: [main]
paths:
- 'devvit/**'
- 'modlog_wiki_publisher.py'
- '.github/workflows/devvit.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
test:
runs-on: [self-hosted, Linux, X64, hetzner]
timeout-minutes: 15
defaults:
run:
working-directory: devvit
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: devvit/.nvmrc
cache: npm
cache-dependency-path: devvit/package-lock.json

- name: Install
run: npm ci --no-fund --no-audit

- name: Type-check
run: npm run type-check

- name: Test
run: npm test

- name: Build
run: npm run build

- name: Set up uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0

- name: Python parity golden is current
run: |
uv run --no-project --python 3.13 --with praw==8.0.3 \
python -I test/parity/python_render.py test/parity/fixture.json "$GITHUB_WORKSPACE" > "$RUNNER_TEMP/golden.md"
diff -u test/parity/golden.md "$RUNNER_TEMP/golden.md"
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ repos:
files: \.json$
- id: check-merge-conflict
- id: end-of-file-fixer
exclude: ^devvit/test/parity/golden\.md$
- id: trailing-whitespace
exclude: ^devvit/test/parity/golden\.md$
- id: no-commit-to-branch
args: ['--branch', 'main']
- id: check-added-large-files
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Automatically publishes Reddit moderation logs to a subreddit wiki page with modmail inquiry links.

> **🧪 Devvit migration in progress.** A re-platform of this bot to a Reddit-hosted [Devvit](https://developers.reddit.com/) app (no self-hosting, no bot password, no SQLite) is being scaffolded under [`devvit/`](devvit/) with requirements, research, and architecture docs in [`devvit-migration/docs/`](devvit-migration/). The Python app documented below remains the supported version. See [`devvit-migration/README.md`](devvit-migration/README.md) for status.
> **🧪 Devvit migration in progress.** A re-platform of this bot to a Reddit-hosted [Devvit](https://developers.reddit.com/) app (no self-hosting, no bot password, no SQLite) lives under [`devvit/`](devvit/) as the Devvit Web app `autowikimod`, with design docs in [`devvit-migration/docs/`](devvit-migration/). The Python app documented below remains the supported version. See [`devvit-migration/README.md`](devvit-migration/README.md) for status.

## Features

Expand Down
10 changes: 4 additions & 6 deletions devvit-migration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Re-platforming the Python/PRAW **Reddit Modlog Wiki Publisher** into a **Devvit*
| --- | --- |
| `subreddit.mod.log(limit=N)` | `reddit.getModerationLog({ subredditName, type?, limit })` |
| `subreddit.wiki[page].edit()` | `reddit.getWikiPage` / `reddit.updateWikiPage` (512 KB cap unchanged) |
| SQLite dedup + retention + hash-cache | `context.redis` (strings for dedup, sorted-set by timestamp for retention, hash for wiki-hash cache) |
| Continuous daemon (`update_interval`) | `Devvit.addSchedulerJob` + cron (1-min min granularity) + optional `onModAction` trigger |
| SQLite dedup + retention + hash-cache | `redis` from `@devvit/web/server` (hashes for rows, dedup and hash cache; sorted sets by timestamp for retention) |
| Continuous daemon (`update_interval`) | `devvit.json` scheduler task, cron `*/20 * * * *` |
| `config.json` / env / CLI (19 options) | Devvit app + per-install settings (`anonymize_moderators` hardcoded true) |
| Docker / s6 / systemd | Reddit-hosted (serverless, free); publish via app review |

Expand All @@ -21,10 +21,8 @@ Re-platforming the Python/PRAW **Reddit Modlog Wiki Publisher** into a **Devvit*
- [`docs/04-architecture.md`](docs/04-architecture.md) — module layout, Redis key schema, execution model, settings schema, phased plan, gap list
- [`docs/STATUS.md`](docs/STATUS.md) — what is scaffolded vs. TODO, mapped to the parity matrix
- [`docs/reddit-api/`](docs/reddit-api/) — stored Devvit API reference snippets
- [`../devvit/`](../devvit/) — the Devvit app scaffold (TypeScript; compiles clean via `tsc --noEmit`)
- [`../devvit/`](../devvit/) — the Devvit Web app (`autowikimod`)

## Status

Scaffold stage: requirements + research + architecture complete; component modules (`storage`, `modlog`, `render`, `wiki`, `settings`, `menu`, `main`) written and type-checking clean. Not yet `devvit upload`-tested against a live test subreddit. See [`docs/STATUS.md`](docs/STATUS.md).

This scaffold was produced by a multi-agent scrum (requirements → research → architecture → per-component implementation → scaffold). Treat the generated TypeScript as a reviewed starting point, not a shipped app — every Devvit API call should be validated in `devvit playtest` before publishing.
Ported to Devvit Web; type-check, tests, build and Python parity pass offline. Awaiting upload and a live run on r/OpenSignups. See [`docs/STATUS.md`](docs/STATUS.md). `docs/01..04` describe the earlier classic-model design.
Loading
Loading