Skip to content

fix(gitlab): remove reactions beyond the first award page - #30700

Open
Jo2234 wants to merge 1 commit into
pingdotgg:mainfrom
Jo2234:fix/gitlab-reaction-removal-pagination
Open

Jo2234 wants to merge 1 commit into
pingdotgg:mainfrom
Jo2234:fix/gitlab-reaction-removal-pagination

Conversation

@Jo2234

@Jo2234 Jo2234 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Removing a GitLab reaction could report success without deleting it when the viewer’s award was beyond the first returned page. This affects both merge requests and note comments.

Page through the existing award endpoint until the matching name/viewer award is found or an empty raw page establishes exhaustion, then delete that award by ID. Preserve host/cwd routing, decoding errors and the add-reaction path. Ignored malformed entries do not terminate pagination.

Verification:

  • The extended existing service regression fails before the fix because the later-page DELETE is missing.
  • Both changed-module suites pass: 94 tests. Coverage includes award 101, absent awards, malformed entries, MR/note subjects and nondefault hosts.
  • Exact-base VITEST_MAX_WORKERS=1 vp run check:changed 567a105705bc7c8e963387f69c484178e0d8ae55 --concurrency 1 passes all stages, 11 package typechecks and 109 selected tests.
  • Runtime transcript through the actual service with an injected CLI boundary verifies removal of award 21 for an MR and note; the service regression separately proves traversal beyond 100 awards.

No live GitLab/glab account operation was performed. This is a focused correction to an established paginated API workflow, within the small obvious-bug exception.

Implementation: GPT-6 Astra in Codex. Completion verification and independent exact-head review: GPT-6.1 Sol in Codex.

Walk award pages until the viewer match or an empty raw page, preserving ownership checks and host routing.

Implemented by GPT-6 Astra through the Codex harness.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 4, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 48f3c18

Macroscope's review found this PR approvable — GitLab reaction removal now searches later award pages while retaining viewer and emoji matching before deletion. The change is limited to the requested reaction-removal action and leaves product defaults and reaction creation unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

GitLab reaction removal now searches award-emoji results in pages of 100. The decoder returns a matching award ID and an empty-list flag. Tests cover paginated results, matching award positions, and request details.

Changes: GitLab award removal

Layer / File(s) Summary
Award decoder result
packages/source-control-gitlab/src/server/gitLabMergeRequestJson.ts, packages/source-control-gitlab/src/server/gitLabMergeRequestJson.test.ts
decodeOwnAwardIdJson now returns an award ID and an empty-list flag. The test expects the updated result shape.
Paginated award removal
packages/source-control-gitlab/src/server/GitLabPullRequestCli.ts, packages/source-control-gitlab/src/server/GitLabPullRequestCli.test.ts
setReaction requests pages of 100 awards until it finds the viewer’s matching award or receives an empty page. It deletes a match by ID. Tests cover note IDs, award positions, and request details.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#23695: Adds selected-host propagation to GitLab CLI and API operations. This change passes the supplied host for award-page requests and deletion.

Suggested reviewers: parmartejass, juliusmarminge, macroscopeapp

Merge Risk: Minimal · up to 48f3c

Reaction removal now searches later award pages. No merge-blocking issue was identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title "fix(gitlab): remove reactions beyond the first award page" matches the main change. The PR makes GitLab reaction removal page through award results, so it finds and deletes the viewer's awa…
Description check Passed The description covers the problem (reaction removal reports success without deleting when the viewer's award is beyond the first page, for merge requests and notes), the change (paging through the aw…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(gitlab): remove reactions beyond the first award page" matches the main change. The PR makes GitLab reaction removal page through award results, so it finds and deletes the viewer's award when it is not on the first page. The title follows conventional commit form and names the affected platform and the core behavior.

Full details: Description check

Explanation

The description covers the problem (reaction removal reports success without deleting when the viewer's award is beyond the first page, for merge requests and notes), the change (paging through the award endpoint and deleting by ID), and verification (a failing-before-fix regression test, 94 module tests, a changed-check run, and a runtime transcript). The Scope and approval section is present and invokes the small obvious-bug exception with a reason, which the template allows. Minor gaps: the Scope section does not link a triaged issue or maintainer approval, and the Problem section lacks explicit reproduction steps. The description also does not name a specific issue number. These gaps are non-critical, so the description is mostly complete.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 8b44f42 and 48f3c18.

Files selected for processing: 4
  • packages/source-control-gitlab/src/server/GitLabPullRequestCli.test.ts
  • packages/source-control-gitlab/src/server/GitLabPullRequestCli.ts
  • packages/source-control-gitlab/src/server/gitLabMergeRequestJson.test.ts
  • packages/source-control-gitlab/src/server/gitLabMergeRequestJson.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

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

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant