Skip to content

fix: guard GitLab task deletion on the tasks.destroy event - #10

Merged
vermorag merged 1 commit into
mainfrom
fix/issue-5-task-destroy-event
Nov 4, 2026
Merged

vermorag merged 1 commit into
mainfrom
fix/issue-5-task-destroy-event

Conversation

@amazing-cat

@amazing-cat amazing-cat commented Nov 3, 2026 •

Copy link
Copy Markdown

Closes #5

  • Renamed the subscribed event to event.before.action.tasks.destroy, matching the core route name, so taskDeletion() runs and returns 403 for GitLab-linked tasks.

Not verified: no end-to-end run against the Cattr core.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Task deletion handling now responds to the task-destruction event, including actions affecting multiple tasks. This helps ensure the expected deletion behavior is applied consistently.

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

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The task deletion observer now subscribes to event.before.action.tasks.destroy instead of the singular event name. The callback remains taskDeletion.

Changes: Task deletion subscription

Layer / File(s) Summary
Update task deletion event subscription
backend/Subscribers/EventObserver.php
The subscription key changes to the plural task deletion event name. The callback remains taskDeletion.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: vermorag

Merge Risk: Minimal · up to 40da4

The subscription now matches the reported task-deletion event name. No actionable defect was found; end-to-end deletion behavior still requires confirmation against Cattr core.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change to the deletion handling for GitLab tasks, which matches the single-line diff. The diff changes the subscribed event from event.before.action.task.destroy to `event.before…
Linked Issues check Passed [#5] The objective is to rename the subscribed event key from event.before.action.task.destroy to event.before.action.tasks.destroy. The whole-PR diff (mergeBase 6dced24 to head 40da405) changes e…
Out of Scope Changes check Passed The PR changes one line in backend/Subscribers/EventObserver.php, the event key in subscribe(). The change implements the single objective of [#5]. No unrelated files or hunks appear in the whole-…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Title check

Explanation

The title names the change to the deletion handling for GitLab tasks, which matches the single-line diff. The diff changes the subscribed event from event.before.action.task.destroy to event.before.action.tasks.destroy in backend/Subscribers/EventObserver.php. The linked objectives confirm the aim: the core route is tasks.destroy, and the old key kept taskDeletion() from running. The title uses the fix: prefix, which fits a bug correction. It does not say that the fix is a change of event name, but it still names the main effect, so the title passes.

Full details: Linked Issues check

Explanation

[#5] The objective is to rename the subscribed event key from event.before.action.task.destroy to event.before.action.tasks.destroy. The whole-PR diff (mergeBase 6dced24 to head 40da405) changes exactly this key in backend/Subscribers/EventObserver.php::subscribe(), mapped to taskDeletion. The handler taskDeletion(mixed $taskId) is unchanged. It aborts with 403 when gitlab_tasks_relations has a row for task_id = $taskId, which matches the issue's acceptance criterion for GitLab-linked tasks. Other tasks take no new check, so they are deleted as before. The runtime 403 depends on the Cattr core dispatching event.before.action.tasks.destroy for POST /api/tasks/remove. That core route is not in this repository. The PR author also states that no end-to-end run was done. The core route name is taken from issue #5, not verified here. No automated test was added. The issue lists no test requirement.

Full details: Out of Scope Changes check

Explanation

The PR changes one line in backend/Subscribers/EventObserver.php, the event key in subscribe(). The change implements the single objective of [#5]. No unrelated files or hunks appear in the whole-PR diff. The AI-generated summary and the observed diff agree: +1/-1, no declaration changes.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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
Recent review info
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: 5e1e65e8-8076-4df3-804d-5a3603b0341f
Commits

Reviewing files that changed from the base of the PR and between 6dced24 and 40da405.

Files selected for processing: 1
  • backend/Subscribers/EventObserver.php

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

@cattr-cla

cattr-cla Bot commented Nov 3, 2026

Copy link
Copy Markdown

Contributor License Agreement

✅ Every human contributor has accepted Cattr CLA version 1.

CLA SHA-256: 68cb254dc87c899f320d5a8977e7e380fd8f6cf6f9388e51d07d936f3a8ce38b

@vermorag
vermorag marked this pull request as ready for review November 4, 2026 08:42
@vermorag
vermorag requested a review from a team November 4, 2026 08:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T08:43:37.186570Z 40da405 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@vermorag

vermorag commented Nov 4, 2026

Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@vermorag
vermorag merged commit 905900f into main Nov 4, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Deletion guard for GitLab-linked tasks never runs: wrong event name task.destroy

2 participants