feat(provider-review): add reconciled GitLab review actions - #5748
feat(provider-review): add reconciled GitLab review actions#5748iscekic wants to merge 8 commits into
Conversation
| if (current.review.rebase_in_progress === false && current.review.merge_error === null) | ||
| return confirmedReviewEffect(ref); | ||
| } | ||
| if (input.action !== 'inlineComment') sameRevision(intent.revision, current.revision); |
There was a problem hiding this comment.
WARNING: Merged-MR revision drift blocks delete-branch 404 confirmation
merge/enableAutoMerge confirm a completed merge at the admitted source SHA before sameRevision (lines 796–801), and the lost auto-merge test mutates base_sha after merge. deleteBranch only confirms via 404 after this sameRevision call. After merge, drifted or omitted diff_refs make sameRevision throw, and the catch returns reconciliation_unavailable — so a lost delete of an already-gone branch never confirms.
Skip sameRevision for deleteBranch the same way merge completion is handled, or move the 404 confirmation above this line.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (4 files)
Fix these issues in Kilo Cloud Previous Review Summary (commit 6a73012)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 6a73012)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (4 files)
Reviewed by grok-4.6 · Input: 113K · Output: 10.7K · Cached: 355.5K Review guidance: REVIEW.md from base branch |
|
Closing: the owner stopped this workflow section. The branch is retained. |
No new behavior — the new GitLab review actions are not yet available in the app.
Summary
ReviewOperationRequestbinds each non-GitHub action to the caller, organization, actor, resource, revision, and fingerprint;reviewEffectOperationKeygives child effects stable identities.runReviewOperationpreservesReviewEffectResultreceipts through failed persistence or reconciliation, so a reused key cannot repeat an uncertain write.assertReviewTermsAcceptedretains content-write consent, andPR_OPERATION_SETTLED_EVENTrecords individual effects without changing GitHub callers or existing fingerprint bytes.Files
apps/web/src/lib/provider-review/operation.ts— A (added source), 286 lines (+286/-0). Reuses admission, acceptance, settlement, and the analytics outbox in theprdomain with 60-secondreconcile-firstleases. RequiresownerIntegration, validates stored ownership and action bindings, and rejects mismatched operation keys. Derives child keys withuuidv5and resource keys from the existing intent fingerprint plus the effect identity. Checks current Terms acceptance before content writes and returnsPRECONDITION_FAILEDwithterms_requiredwhen absent. Persistsdispatchingbefore execution. Concurrent duplicates cannot dispatch again; settled duplicates return terminal receipts. Retries with the same key only after a stored safe rejection, which it clears before dispatch. Status-only calls require an admitted operation and cannot issue provider writes. Keeps accepted evidence when reconciliation reads fail and keeps confirmations when settlement fails. Stores compact results and provider references belowMAX_CANONICAL_RESULT_BYTES; failed persistence leaves reconciliation required. Uses existing analytics intents for completed, failed, and ambiguous effects; aggregate rows and reversible actions emit no extra events.apps/web/src/lib/provider-review/operation.test.ts— A (added test), 526 lines (+526/-0). Adds the focused ledger suite, including persistence and accepted-result recovery checks.runGitLabReviewOperationrequires freshGitLabReviewAuthorization;statusOnlyreads outcomes without dispatch, andReviewMutationResultreports incomplete batches aspartial.Comments, discussions, reactions, approvals,
mergeRequestRequestChanges, merges, deletion, rebases, and auto-merge use separate effects; target, rebase, and deletion lack atomic revision protection.Auto-merge selects
autoMergeor legacymergeWhenPipelineSucceeds; no public route or mobile control calls this adapter yet.Files
apps/web/src/lib/provider-review/gitlab-write.ts— A (added source), 1,123 lines (+1,123/-0). Implements comments, inline discussions, replies, resolution/reopening, reactions, approval/unapproval, and request-changes state without licensed merge blocking. Checks live grants, capabilities, review identity, revisions, action-specific fields, thread permissions, and reaction ownership. Validates selected paths and exact single-line/range positions; keeps image/file discussions replyable. Publishes up to 100 unique comments or matching owned drafts, then a summary and decision, as separate effects. Stops at unconfirmed effects, returnsunfinished-onlyretries, and preserves original positions. Rejects native drafts with unbound discussion or resolution effects; draft disappearance never proves publication. Applies merge-method and squash policy, uses project squash defaults, and passes supplied commit titles/messages. Guards approval and merge with the source commit; rechecks revision and policy before dispatch. Deletes a source branch only after confirmed merge, using an explicit repository/branch/head binding and excluding default or protected branches. Uses the authorized instance version:autoMergefrom 17.11, otherwisemergeWhenPipelineSucceeds. Documents legacy removal only after old instances, clients, records, and the 30-day ledger window no longer need it. Reconciles auto-merge enable/cancel and recognizes a completed merge at the admitted source commit after a lost response. Retains accepted rebases across unavailable status reads, then confirms completion or reports failure without repeating the rebase. Checks provider receipts and state after writes; ambiguous responses require reconciliation, not blind retries.apps/web/src/lib/provider-review/gitlab-write.test.ts— A (added test), 1,295 lines (+1,295/-0). Adds the GitLab write suite, including accepted-rebase recovery, lost auto-merge responses, and unbound native drafts.Tests: 2 files added —
operation.test.tsandgitlab-write.test.ts; 1,821 added lines and 0 removed lines.Generated: 0 files changed.
Visual Changes
Visual Changes: N/A
Verification
Manual runtime verification has not run. The dispatcher will verify the cumulative stack before marking it human-ready.
Reviewer Notes
Human steps
Automated evidence
Scope and inventory
Kilo-Org/cloud./Users/igor/Projects/.worktrees/mobile-provider-parity-1d93; branch:mobile-provider-parity-1d93.mobile-provider-parity-1d93-s10...mobile-provider-parity-1d93-s11.Stacked PRs — merge bottom to top. Each level shows only its own diff.
Runtime verification (E2E, user advocacy, simplify) runs on the tip PR over every level.
Every level keeps its own checks, its own bot review, and its own threads; each one is answered on its own PR.
Each level is its own deliverable: it builds and passes its own checks alone.
A finding on a level is repaired on that level, then carried upward with stack.sh forward.
mobile-provider-parity-1d93-s1— feat(provider-review): add shared identity and stack checks #5663mobile-provider-parity-1d93-s2— feat(provider-review): define review contracts and vocabulary #5665mobile-provider-parity-1d93-s3— feat(provider-review): add safe provider SDK boundaries #5689mobile-provider-parity-1d93-s4— feat(git-token): authorize exact provider review resources #5692mobile-provider-parity-1d93-s5— feat(cloud-agent): preserve provider identity through checkout #5700mobile-provider-parity-1d93-s6— feat(provider-review): expose exact repositories and branches #5705mobile-provider-parity-1d93-s7— feat(mobile): preserve provider launch and recent identity #5711mobile-provider-parity-1d93-s8— feat(mobile): select exact provider repositories and branches #5729mobile-provider-parity-1d93-s9— feat(provider-review): add authorized GitLab review reads #5738mobile-provider-parity-1d93-s10— feat(provider-review): add authorized Bitbucket review reads #5745mobile-provider-parity-1d93-s11— feat(provider-review): add reconciled GitLab review actions #5748 ← this PRmobile-provider-parity-1d93-s12— feat(provider-review): add Bitbucket review actions and recovery #5756mobile-provider-parity-1d93-s13— feat(provider-review): expose the neutral review facade #5763 (tip)