Repository navigation
feat(api): change rules and rule actions - #622
Open
ccf-lisa[bot] wants to merge 2 commits into
Open
ccf-lisa[bot] wants to merge 2 commits into
ccf-lisa[bot] wants to merge 2 commits into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
ccf-lisa
Bot
force-pushed
the
effectors/22c-rule-changes
branch
from
December 2, 2026 12:07
1dd66eb to
e66c7ba
Compare
This was referenced Dec 2, 2026
GET /api/rules (paginated), PUT /api/rules/{id}, PUT
/api/rules/{id}/enabled, DELETE /api/rules/{id} and the rule action
routes (POST, GET, PUT, DELETE /api/rules/{id}/actions/{actionId}),
each change applied to effects through the rule lifecycle in the same
transaction.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ccf-lisa
Bot
force-pushed
the
effectors/22c-rule-changes
branch
from
December 2, 2026 14:45
e66c7ba to
95a138d
Compare
This was referenced Dec 2, 2026
This was referenced Dec 2, 2026
gusfcarvalho
approved these changes
Dec 2, 2026
gusfcarvalho
left a comment
Contributor
There was a problem hiding this comment.
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 was referenced Dec 2, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Rule routes, part 2: everything that lists or changes a saved rule, each change applied to its effects through the rule lifecycle (#612) in the transaction that saves it.
GET /api/rulessource,enabled(true/false, else 400)PUT /api/rules/{id}when/forre-evaluates (RuleTriggerChanged) and a changedwhenclears its errorsPUT /api/rules/{id}/enabledRuleDisabled/RuleEnabled; the same state again is a no-opDELETE /api/rules/{id}RuleDeleted: effects cleared as removed)POST /api/rules/{id}/actionsactions[i].prefix);ActionCreatedGET /api/rules/{id}/actions/{actionId}PUT /api/rules/{id}/actions/{actionId}ActionRepointed(agent or effector action),ActionChanged(target or timing),ActionParamsChanged(only params: redelivered); errors cleared when the target changesDELETE /api/rules/{id}/actions/{actionId}ActionDeletedChanging a rule or its actions needs the source read like creating one; deleting doesn't.
Why
Plan: stack 3, PR 22 (second part).
Test evidence
rule_changes_integration_test.go: pagination and the enabled filter (400 on another value), create disabled (no lifecycle), ambiguous agent name, stale agent saved degraded, 403s without the source read (update, enable, add action; delete allowed), trigger update (name only: nothing;when: re-evaluated, errors cleared, actions kept; 422/404), enable/disable/delete (soft-deleted actions kept), action create/get/timing change/repoint/no-op/422/delete with the change kinds in order, params on the action routes (paths, params-only change, same params no-op, params with timing, clearing params, locked field, schema removed).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 testpass;make swagno diff (regenerateddocs/committed here);go mod tidyno diff;go test -tags integration -p 1on./internal/api/handler/...pass.Size
Counted: 810 lines (added + removed, tests included;
docs/docs.goanddocs/swagger.*excluded).🤖 Generated with Claude Code