Conversation
7e03b42 to
3b83c30
Compare
dd35670 to
18191c5
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
aaac102 to
af9fec5
Compare
af9fec5 to
0d49ae0
Compare
45b6883 to
fd8d40d
Compare
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
5e4a69a to
1b87569
Compare
1e97afc to
8f27f9c
Compare
04aaf0c to
21a9590
Compare
[db] Add expires_at column to pipeline_requests table [db] Add idx_pipeline_requests_retention_marking index (org_id, inserted_at WHERE expires_at IS NULL) [db] Add idx_pipeline_requests_retention_deletion index (expires_at WHERE expires_at IS NOT NULL) [db] Split migrations into 3 files for safer deployment [worker] Add PolicyApplier module with batched mark/unmark operations (default 10k batch size) [worker] Add PolicyConsumer to handle RabbitMQ retention policy events [config] Add RETENTION_GRACE_PERIOD_DAYS env var (default 15, min 7) [config] Add RETENTION_APPLIER_BATCH_SIZE env var (default 10000) [docs] Add commit format guidelines to AGENTS.md
[worker] Move retention worker startup to Application [config] Add RETENTION_CONSUMER_ENABLED env var (default false)
[worker] Combine SELECT and UPDATE into single query
[config] Move retention worker config to runtime.exs [config] Add default exchange (usage_internal_api) [config] Add default routing_key (usage.apply_organization_policy)
[worker] Fix record_deleter to use id instead of ppl_artefact_id [test] Add integration test for retention deletion
21a9590 to
d3ab56f
Compare
d3ab56f to
1e6a60a
Compare
## 📝 Description This PR implements retention policy support in plumber. When the usage service applies a retention policy, plumber marks pipeline records for expiration with a configurable grace period, allowing corrections before data is deleted. - Added `expires_at` column to `pipeline_requests` table to track when records should be deleted - Created `PolicyConsumer` to receive retention policy events from usage service via RabbitMQ - Created `PolicyApplier` to mark/unmark pipeline records based on the cutoff date - Records older than cutoff are marked with `expires_at = now + grace_period` (default 15 days) - Records newer than the cutoff have `expires_at` cleared, allowing policy corrections to "save" mistakenly marked records - Grace period is configurable via `RETENTION_GRACE_PERIOD_DAYS` env var (min: 7 days) - Record Deleter Worker - Added a GenServer that periodically deletes expired records in batches ## ✅ Checklist - [x] I have tested this change - [ ] This change requires documentation update
📝 Description
This PR implements retention policy support in plumber. When the usage service applies a retention policy, plumber marks pipeline records for expiration with a configurable grace period, allowing corrections before data is deleted.
expires_atcolumn topipeline_requeststable to track when records should be deletedPolicyConsumerto receive retention policy events from usage service via RabbitMQPolicyApplierto mark/unmark pipeline records based on the cutoff dateexpires_at = now + grace_period(default 15 days)expires_atcleared, allowing policy corrections to "save" mistakenly marked recordsRETENTION_GRACE_PERIOD_DAYSenv var (min: 7 days)✅ Checklist