posting waifu pictures to discord
  • Python 98.8%
  • Dockerfile 1.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
rs 5801923780
All checks were successful
/ lint-and-test (push) Successful in 38s
/ validate (push) Successful in 39s
/ build-image (push) Successful in 2m41s
Merge pull request 'fix/lintcheck' (#18) from fix/lintcheck into main
Reviewed-on: #18
2026-10-31 21:21:46 +00:00
.forgejo/workflows ci: use builder-kube v1.1.0 and call kustomize/kube-linter directly 2026-10-31 22:20:56 +01:00
argocd feat: build without helm on top of commit sha 2026-10-25 19:55:04 +01:00
deploy chore: bump test version 2026-10-31 21:57:34 +01:00
docs feat(tracing): export run traces over OTLP and propagate traceparent to the tagger 2026-10-31 21:47:27 +01:00
tests feat(tracing): export run traces over OTLP and propagate traceparent to the tagger 2026-10-31 21:47:27 +01:00
waifu feat(tracing): export run traces over OTLP and propagate traceparent to the tagger 2026-10-31 21:47:27 +01:00
.gitignore test: add unit test suite and run it in CI 2026-10-24 20:29:15 +02:00
Dockerfile feat(tracing): export run traces over OTLP and propagate traceparent to the tagger 2026-10-31 21:47:27 +01:00
main.py feat(tracing): export run traces over OTLP and propagate traceparent to the tagger 2026-10-31 21:47:27 +01:00
pyproject.toml test: add unit test suite and run it in CI 2026-10-24 20:29:15 +02:00
README.md feat(tracing): export run traces over OTLP and propagate traceparent to the tagger 2026-10-31 21:47:27 +01:00
requirements-dev.txt test: add unit test suite and run it in CI 2026-10-24 20:29:15 +02:00
requirements.txt bumped requirements to latest version 2026-09-01 22:37:39 +02:00

Acid Waifu

Waifu posting automation for a better future

Selects posts from waifu.im and posts waifus on discord.

  • main.py: thin entrypoint that boots the application
  • waifu/: package containing config, image api client, tagger client, discord bot, metrics, tracing, and logging setup

Deployment

You need:

  • Discord bot token
  • Discord channel id to post in (the bot needs post access to it)

You have two options for deployment: single container or helm chart.

  • Single container: build the image with Dockerfile and run main.py.
  • Helm chart: install the chart in chart/acidwaifu/. See the chart values.yaml for the configurable options (schedule, image, and all behavioural tunables).

The application is configured entirely through environment variables — see waifu/config.py for the full list.

Development

Install the development dependencies and run the same checks as CI:

python3 -m venv .venv
.venv/bin/pip install -r requirements-dev.txt
.venv/bin/black .
.venv/bin/mypy .
.venv/bin/pytest

Releasing

Two environments are declared in app/argocd.yaml and synced by Argo CD.

  • test renders chart/acidwaifu from main and runs the mutable :latest image. Merging to main is the deployment: CI validates the commit and builds :latest, and Argo CD renders the new chart.
  • prod tracks stable packaged charts with targetRevision: "4.*". The chart version and image tag are coupled through the chart's appVersion.

Create a production release by tagging a commit that is on main:

git tag v4.1.0
git push origin v4.1.0

CI then:

  1. rejects non-vX.Y.Z tags and tags that are not reachable from main,
  2. runs black, mypy, and pytest,
  3. builds git.pr0.tech/rs/acidwaifu:v4.1.0,
  4. publishes chart 4.1.0 with appVersion: v4.1.0,
  5. Argo CD syncs prod to the newest 4.* chart, which renders the matching image tag.

Release tags never move :latest; that tag belongs to main and to the test environment.

Rollback

A deploy or rollback affects the next CronJob run; an already running job keeps the image it started with. Automatic sync disables argocd app rollback, so roll back in git by pinning prod to the previous chart version in app/argocd.yaml:

targetRevision: "4.0.0"

Commit that change, verify prod, then restore targetRevision: "4.*" to resume automatic stable releases.