Skip to content

feat(api): effect views and redeliver - #624

Open
ccf-lisa[bot] wants to merge 1 commit into
effectors/23-rule-editorfrom
effectors/24-effects-routes
Open

ccf-lisa[bot] wants to merge 1 commit into
effectors/23-rule-editorfrom
effectors/24-effects-routes

Conversation

@ccf-lisa

@ccf-lisa ccf-lisa Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

What

Effect views (rule:read) and redelivery (rule:update):

  • GET /api/rules/{id}/effects: paginated, by state, with their subjects.
  • GET /api/effects/{id}: the effect with the document the agent would get now; /history and /deliveries (last 24h).
  • POST /api/effects/{id}/redeliver: an active or finished effect gets a new generation with transition redelivered (409 otherwise); its delivery is written to the outbox with the generation, then enqueued and marked processed, so a failed enqueue leaves it for the dispatcher. 503 when effect deliveries aren't running.
  • effector.Jobs gains EnqueueEffectDeliver (its first caller); the worker scheduler implements it.

Why

Plan: stack 3, PR 23 (effect views).

Test evidence

effects_integration_test.go: rule effects with subjects and the state filter, the effect with its document (apply, effect type, subject title, entered), history, deliveries, 404/400; redeliver (generation 2, redelivered, delivery enqueued, history row, 409 for an inactive effect, 404), redeliver durable (outbox row processed when enqueued, left pending with generation 3 when enqueuing fails), 503 without jobs, pagination.

Gate on this branch: go build ./... pass; go vet -tags integration ./... pass; golangci-lint v2.15.0 (shared CI config, incl. unconvert) 0 new issues; make test pass; make swag no diff (regenerated docs/ committed here); go mod tidy no diff; go test -tags integration -p 1 on ./internal/api/handler/..., ./internal/service/effector/..., ./internal/service/worker/... pass.

Size

Counted: 674 lines (added + removed, tests included; docs/docs.go and docs/swagger.* excluded).

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 75a5451c-aa41-443e-b8ba-3ccb7b756dae

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

GET /api/rules/{id}/effects (paginated), GET /api/effects/{id} with its
document, history and deliveries, and POST /api/effects/{id}/redeliver,
which writes the new generation's delivery to the outbox and enqueues
it (effector.Jobs gains EnqueueEffectDeliver).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@gusfcarvalho gusfcarvalho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ccf-review: APPROVE

no findings.

Stack (gh stack 604): #592 → #593 → #594 → #595 → #596 → #597 → #598 → #599 → #600 → #601 → #602 → #603 → #605 → #606 → #607 → #608 → #609 → #610 → #611 → #612 → #613 → #614 → #615 → #616 → #617 → #618 → #619 → #620 → #621 → #622 → #623 → #624 → #625 → #626 → #627 → #628 → #629 → #630

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant