Skip to content

feat(api-workflows): review and workflow state features - #6038

Merged
brunozoric merged 19 commits into
bruno/feat/workflows-umbrellafrom
bruno/feat/workflows-api-workflows-features-review
Oct 27, 2026
Merged

brunozoric merged 19 commits into
bruno/feat/workflows-umbrellafrom
bruno/feat/workflows-api-workflows-features-review

Conversation

@brunozoric

@brunozoric brunozoric commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review and workflow-state features: request, approve, reject and reassign reviews; track the state of each entry.

Part of the workflows split (195 files). Merges into bruno/feat/workflows-umbrella; builds only together with the other parts.

🤖 Generated with Claude Code

Split from bruno/refactor/workflows-flow for review.

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

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. 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: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 29e940ca-59cd-4317-bda5-e44796586ad3

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

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🚓 Slop Cop

✅ Nothing worth flagging. The diff looks consistent with the PR's stated intent and the code-style rules.

Large but coherent slice of the workflows split; diff matches the stated intent and no integrity or style issues were found.

Automated, non-blocking heads-up from an LLM. It can be wrong — use your judgment. Regenerates on every push.

brunozoric and others added 11 commits October 21, 2026 16:35
ReviewRepository.save read the entry and created it when missing, so a review deleted between a load and its save (content trashed while an approve or the stuck-step check was in flight) came back as an active review. The repository now has create and update; update fails with ReviewNotFoundError for a missing review, and ReviewSaver creates only a review whose facts include requested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The save block and the publish rules looked the review up with GetTargetReviewUseCase, which runs stuck detection and can fail and save the step, sync the target and notify, all from inside an entry or page before-event. GetActiveTargetReviewUseCase reads the active review as stored and never writes; GetTargetReviewUseCase keeps stuck detection for the target review wrappers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e in cancel and delete

The running task (the current step's task while it is in review) and the task of every attempt are rules about the review's own data. Review.getRunningTaskId and Review.getTaskIds now hold them; CancelReview and DeleteTargetReviews call them instead of each repeating the running-task rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wUseCase in RequestReview

RequestReview listed workflows by model itself, the same lookup GetBoundWorkflowUseCase does for the save block and the publish rule. It now uses that use case, so the binding rule lives in one place.

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

Callers reach the abstraction through ReviewTargetEditor.Interface; nothing imported the raw interface.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The review list cursor kept a repository page cursor and a row offset into it. When a row earlier on that page left the list between calls (an approve, a reassign), the rows after it shifted up and the next call skipped one. The cursor now holds the lastChangedOn of the last examined row and the ids examined at exactly that time; the next call resumes there with lastChangedOn_gte (ascending) or _lte (descending) and leaves those ids out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stead of per-row queries

Part of removing queries in loops (docs/.bruno/plans/2026-10-21-workflows-no-n-plus-one.md, Phase 1 and Phase 2 item 1). The review lists turn the viewer's read access into query filters (readable models, own-only models by author, denied folders) built once per request, confirm each storage page with one batch read, and never read a target per row. Folder rules load only for models with active reviews (one distinct-values query).

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

Part of removing queries in loops (docs/.bruno/plans/2026-10-21-workflows-no-n-plus-one.md, Phase 1 item 5 and Phase 2 items 2-6): routing candidates read the target and the folder record once and reuse the listed users; blocking reviews, delete-multiple and delete-workflow paths use one batch call; candidateTeams goes through a request-scoped team loader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of removing queries in loops (docs/.bruno/plans/2026-10-21-workflows-no-n-plus-one.md, Phase 3): the delete cascade lists all records of a batch of reviews at once and deletes in batches with one task-abort call; assignment records are written with a concurrency limit; least-loaded ties read one userId_in list; cancel-for-delete no longer lists twice; saving a workflow reads its user targets with one ListUsers call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of removing queries in loops (docs/.bruno/plans/2026-10-21-workflows-no-n-plus-one.md, Phase 3): the review and assignment repositories delete with CMS DeleteMultipleEntriesUseCase in chunks of 50 instead of one delete per entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… review events per feature

Review of #6038: abstractions imported under a bare UseCase/Abstraction alias are now aliased XAbstraction, and the review events live in one events.ts per feature (shared payload, union and the step-failed event in shared/events.ts) instead of one file with all eleven. Event names, types and handler tokens are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brunozoric added a commit that referenced this pull request Oct 22, 2026
Review of #6038: abstractions imported under a bare UseCase/Abstraction alias are now aliased XAbstraction, and the review events live in one events.ts per feature (shared payload, union and the step-failed event in shared/events.ts) instead of one file with all eleven. Event names, types and handler tokens are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brunozoric added a commit that referenced this pull request Oct 22, 2026
Review of #6038: abstractions imported under a bare UseCase/Abstraction alias are now aliased XAbstraction, and the review events live in one events.ts per feature (shared payload, union and the step-failed event in shared/events.ts) instead of one file with all eleven. Event names, types and handler tokens are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brunozoric added a commit that referenced this pull request Oct 22, 2026
… features

Review of #6038: abstractions imported under a bare UseCase/Abstraction alias are now aliased XAbstraction, and the review events live in one events.ts per feature (shared payload, union and the step-failed event in shared/events.ts) instead of one file with all eleven. Event names, types and handler tokens are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brunozoric and others added 7 commits October 23, 2026 10:31
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…implementation

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

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

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

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brunozoric
brunozoric merged commit 3ed8cd6 into bruno/feat/workflows-umbrella Oct 27, 2026
15 of 17 checks passed
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