Skip to content

Commit bb422f4

Browse files
Remove the parked moderator project
The moderator was parked (not deployed, router route pointing at a Lambda that is not maintained). Delete the project, its CI workflow and dependabot entry, and drop it from the docs. The router's button-click route now just acknowledges the request so Slack does not retry, since nothing consumes those payloads anymore.
1 parent aeb55b0 commit bb422f4

19 files changed

Lines changed: 15 additions & 1707 deletions

.github/dependabot.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ updates:
1717
automator-deps:
1818
patterns: ["*"]
1919

20-
- package-ecosystem: "uv"
21-
directory: "/moderator"
22-
schedule:
23-
interval: "weekly"
24-
groups:
25-
moderator-deps:
26-
patterns: ["*"]
27-
2820
# GitHub Actions used by the test/deploy workflows.
2921
- package-ecosystem: "github-actions"
3022
directory: "/"

.github/workflows/test-moderator.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,33 @@ A Slack moderation bot that runs on AWS Lambda. It lets you moderate from your p
44

55
## Repository layout
66

7-
The backend is **three independent Lambda projects**, each self-contained with
7+
The backend is **two independent Lambda projects**, each self-contained with
88
its own source, build scripts, tests, and dependencies (`uv`). There is no
99
shared root package — a change to one project never triggers another's CI.
1010

1111
```
1212
.
1313
├── router/ 🟢 active — Slack entry point; routes events (Test + Deploy Router)
1414
├── automator/ 🟢 active — reaction & FAQ actions (Test + Deploy Automator)
15-
├── moderator/ ⚪ parked — message-rate watch (not deployed) (Test Moderator only)
1615
└── docs/ — shared cross-project docs
1716
1817
each project:
1918
<project>/
2019
├── src/ # Lambda code (handler: lambda_function.lambda_handler)
2120
├── scripts/ # package.sh, deploy.sh (+ publish.sh for router)
2221
├── tests/ # unit tests (+ e2e mocked tests for automator)
23-
├── integration/ # integration tests (moderator only — LocalStack)
2422
├── pyproject.toml # self-contained deps
2523
├── uv.lock
2624
└── README.md
2725
```
2826

2927
CI is per-project and path-filtered (`.github/workflows/test-*.yml` and
30-
`deploy-*.yml`): a project's tests run only when its files change, and the two
31-
active projects deploy only after their own tests pass on `main`.
28+
`deploy-*.yml`): a project's tests run only when its files change, and each
29+
project deploys only after its own tests pass on `main`.
3230

3331
## How the AuTomator Works
3432

35-
The backend is split into **three Lambdas**, each with a clear responsibility.
33+
The backend is split into **two Lambdas**, each with a clear responsibility.
3634

3735
### 1. Router — Routes Slack events to the right Lambda
3836

@@ -45,9 +43,9 @@ Its only job is to look at the incoming event and quickly decide where it should
4543
| **Reaction added by admin** | Automator |
4644
| **App mention** | Automator / FAQ Assistant |
4745
| **Message event** | Disabled for now |
48-
| **Button click** (e.g. from an alert) | Moderator |
46+
| **Button click** (e.g. from an alert) | Acknowledged only |
4947

50-
The router and automator are separate on purpose: Slack expects a response within about 3 seconds. The router responds immediately and invokes the automator (or moderator) asynchronously, so longer work doesn’t time out.
48+
The router and automator are separate on purpose: Slack expects a response within about 3 seconds. The router responds immediately and invokes the automator asynchronously, so longer work doesn’t time out.
5149

5250
### 2. Automator — Acts based on emoji reactions by the admin and FAQ mentions
5351

@@ -67,28 +65,16 @@ Examples:
6765

6866
The automator can also send a relevant reply to the author of the message you reacted to, so they get clear feedback.
6967

70-
### 3. Moderator — Watches message activity and helps you react quickly
71-
72-
The moderator **does not** decide what is spam by itself. It:
73-
74-
- Keeps track of how often people post (e.g. messages per user in a time window).
75-
- Notices patterns like “too many messages too quickly.”
76-
- When that happens, **alerts an admin** and provides **buttons** to act immediately.
77-
78-
Those buttons let you **delete recent messages**, **deactivate a user**, or **ignore** the alert—all from Slack, including on your phone. So you get early signals and can intervene quickly without opening a laptop.
79-
80-
For more on the moderator (DynamoDB, thresholds, LocalStack, etc.), see [moderator/README.md](moderator/README.md).
81-
8268
---
8369

8470
## Deployment
8571

8672
Each project is self-contained under its own directory (`src/`, `scripts/`,
87-
`tests/`, `pyproject.toml`). CI deploys the two active projects automatically:
73+
`tests/`, `pyproject.toml`). CI deploys both projects automatically:
8874
each `Deploy *` workflow runs after its `Test *` workflow passes on `main`, and
8975
only when files under that project changed. Deploy in this order:
9076

91-
**1. Router** (active)
77+
**1. Router**
9278

9379
```bash
9480
cd router
@@ -104,7 +90,7 @@ the repository variable `ROUTER_FUNCTION_NAME`; otherwise it defaults to
10490
The AWS credentials used by GitHub Actions need `lambda:UpdateFunctionCode`,
10591
`lambda:GetFunction`, and `lambda:GetFunctionConfiguration` for `slack-test`.
10692

107-
**2. Automator** (active)
93+
**2. Automator**
10894

10995
```bash
11096
cd automator
@@ -115,30 +101,6 @@ bash scripts/deploy.sh
115101
Deployed by `.github/workflows/deploy-automator.yml` after `Test Automator`
116102
passes on `main`.
117103

118-
**3. Moderator** (parked — not deployed)
119-
120-
The moderator is currently parked: its router route is disabled and it has no
121-
deploy workflow. Its tests still run in CI (`Test Moderator`). To deploy it
122-
manually:
123-
124-
```bash
125-
cd moderator
126-
bash scripts/package.sh
127-
bash scripts/deploy.sh
128-
```
129-
130-
---
131-
132-
## Message Moderator (reference)
133-
134-
- Tracks messages per user using **DynamoDB**.
135-
- Configurable threshold (default: 5 messages in 3 minutes).
136-
- Interactive admin alerts with action buttons.
137-
- Bulk message deletion and user deactivation.
138-
- LocalStack support for testing.
139-
140-
See [moderator/README.md](moderator/README.md) and [moderator/SLACK_SETUP.md](moderator/SLACK_SETUP.md) for setup and details.
141-
142104
---
143105

144106
## Application Configuration

automator/tests/test_automator_lambda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
lambda_function = importlib.util.module_from_spec(spec)
1616

1717
# Register in sys.modules so patching works
18-
# This is needed because we load the module dynamically to avoid conflicts with moderator tests
18+
# This is needed because we load the module dynamically to avoid name conflicts with other projects' tests
1919
sys.modules['automator_lambda_function'] = lambda_function
2020

2121
# Add automator to sys.path temporarily for imports within lambda_function

moderator/README.md

Lines changed: 0 additions & 171 deletions
This file was deleted.

0 commit comments

Comments
 (0)