ai-cfia / ai-cfia/insect-project

Migrate mailing list persistence from GitHub Secrets to Postgres

Aberta
#46 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
0
Forks
0
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

# Outcome

Use Postgres as the source of truth for report mailing list subscribers. GitHub Actions fetch recipients at runtime via the subscription manager; no recipient data is stored in GitHub Secrets.

# Acceptance criteria

- A `subscribers` table exists with unique `email` and a status field (`subscribed`, `unsubscribed`, `bounced`) plus timestamps.
- Existing recipients (from current GH secret/env var) are migrated into Postgres; the secret no longer contains recipient emails.
- Subscription Manager exposes an authenticated endpoint to list current subscribers (e.g., GET /api/subscribers?status=subscribed) returning plain emails.
- GitHub workflows use the endpoint to obtain recipients at runtime; supports dry-run.
- Unsubscribe/bounce states are respected when returning recipients.
- Basic audit logging for subscribe/unsubscribe/migration is in place.
- A short runbook documents migration steps, rollback, and how to add/remove subscribers post-migration.

# Notes

Minimal schema:

```sql
create table subscribers (
id uuid primary key default gen_random_uuid(),
email text not null unique,
status text not null check (status in ('subscribed','unsubscribed','bounced')),
subscribed_at timestamptz not null default now(),
unsubscribed_at timestamptz,
last_delivery_at timestamptz,
source text,
created_by text,
updated_at timestamptz not null default now()
);
create index on subscribers (status, email);
```

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.