Skip to content

t3667: refactor supervisor cron.sh — extract _should_skip_task helper and fix parent_ids extraction#4653

Closed
marcusquinn wants to merge 1 commit intomainfrom
bugfix/t3667-cron-guard-helper
Closed

t3667: refactor supervisor cron.sh — extract _should_skip_task helper and fix parent_ids extraction#4653
marcusquinn wants to merge 1 commit intomainfrom
bugfix/t3667-cron-guard-helper

Conversation

@marcusquinn
Copy link
Copy Markdown
Owner

Summary

Addresses medium review feedback from PR #1616 (Gemini Code Assist + CodeRabbit).

Changes

1. Fix parent_ids extraction bug in Strategy 4 (cron.sh:821-822)

The previous pipeline:

grep -E '...' | grep -oE 't[0-9]+' | sort -u

extracted all tNNN tokens from each matching line — including IDs embedded in descriptions (e.g. blocked-by:t1234, see t999). This could cause non-parent task IDs to be treated as parents, leading to spurious subtask lookups.

Fixed by replacing the second grep -oE with a targeted sed that extracts only the leading task ID after the checklist prefix:

grep -E '...' | sed -E 's/^[[:space:]]*- \[[ ]\] (t[0-9]+).*/\1/' | sort -u

2. Extract _should_skip_task() helper (cron.sh:482-537)

The guard sequence (assignee/started → blocked-by → -needed blockers → DB lookup → cross-repo guard → merged-PR check) was copy-pasted across Strategies 1, 2, and 4 (~60 lines of duplication). Centralised into a single _should_skip_task() helper with a check_needed_blockers flag:

  • "true" — Strategies 1 & 2 (top-level tasks, check -needed blocker tags)
  • "false" — Strategy 4 subtasks (parent already passed that gate)

Strategy 3 retains its own guards due to its different logic flow (subtask-existence check before any guard, no assignee/blocked-by checks).

Net: -50 lines (91 insertions, 141 deletions).

Verification

  • ShellCheck: zero violations (only pre-existing SC1091 info note on sourced file)
  • Behaviour: identical to before — all guard logic preserved, only structure changed

Closes #3667

…_ids extraction

t3667: Address medium review feedback from PR #1616 (Gemini + CodeRabbit).

Two changes:
1. Fix parent_ids extraction bug in Strategy 4 — the previous pipeline used
   'grep -oE t[0-9]+' which grabbed ALL task IDs in a line (including those
   embedded in descriptions like 'blocked-by:t1234'). Replace with sed to
   extract only the leading task ID after the checklist prefix.

2. Extract _should_skip_task() helper — the guard sequence (assignee/started
   check → blocked-by check → -needed blocker check → DB lookup → cross-repo
   guard → merged-PR check) was duplicated across Strategies 1, 2, and 4
   (~60 lines of copy-paste). Centralise into a single helper with a
   check_needed_blockers flag (true for Strategies 1 & 2, false for Strategy 4
   subtasks). Strategy 3 retains its own guards due to different logic flow.

Closes #3667
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 14, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • no-review

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

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6b8d5a25-f176-4976-a8ff-7b5c8df901bd

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/t3667-cron-guard-helper
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

@alex-solovyev
Copy link
Copy Markdown
Collaborator

PR is CONFLICTING after recent merges. Closing — issue #3667 will be relabeled status:available for re-dispatch with a fresh branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Auto-created from TODO.md tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quality-debt: PR #1616 review feedback (medium)

2 participants