Skip to content

feat(scripts): add review-sync one-shot script#187

Merged
keinstn merged 3 commits into
developfrom
agent/keinstn__baton-185
Jun 24, 2026
Merged

feat(scripts): add review-sync one-shot script#187
keinstn merged 3 commits into
developfrom
agent/keinstn__baton-185

Conversation

@keinstn

@keinstn keinstn commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds scripts/review-sync/config.ts to parse YAML frontmatter from a REVIEW_SYNC.md config file
  • Adds scripts/review-sync/index.ts with the main logic: resolve project metadata, page issues in source states, evaluate linked PR review threads, and move issues accordingly
  • Issues with any unresolved review thread on an open linked PR → moved to in_progress_state
  • Issues where all open linked PR threads are resolved → moved to in_review_state
  • Issues with no linked open PRs, or open PRs with no threads → skipped
  • --dry-run flag logs planned moves without executing mutations
  • All column/state names are configurable via YAML frontmatter

Closes #185

Test plan

  • npm run typecheck passes
  • npm run lint passes
  • npm run test passes (357 tests)
  • Manual: run with --dry-run against a real project to verify output

🤖 Generated with Claude Code

Adds scripts/review-sync/ with config.ts and index.ts following the
two-file pattern of scripts/triage/. The script scans GitHub Projects
v2 issues in configurable source states, inspects linked open PR review
threads (via timelineItems CROSS_REFERENCED_EVENT + reviewThreads), and
moves issues to in_progress_state when any thread is unresolved or to
in_review_state when all threads are resolved. Issues with no linked
open PRs or no review threads are skipped. Supports --dry-run.

Closes #185

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@keinstn

keinstn commented Jun 24, 2026

Copy link
Copy Markdown
Owner Author

[Baton Reviewer] Review complete: no actionable findings in the current diff. Ready for human review.

Managed by Baton; do not edit the marker line manually.

@keinstn keinstn left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added 3 inline comments covering field-value pagination robustness, non-zero exit signaling on partial failure, and targeted tests for transition branches.

Comment thread scripts/review-sync/index.ts
Comment thread scripts/review-sync/index.ts
Comment thread scripts/review-sync/index.ts
keinstn and others added 2 commits June 25, 2026 08:41
…, exit code, and tests

- Increase fieldValues page size from 10 to 50 to avoid silently missing
  the Status field on projects with many fields
- Extract classifyItem into classify.ts (pure function, exported for testing)
- Set process.exitCode = 1 when errors > 0 so partial failures surface in automation
- Add test/review-sync.test.ts covering all transition branches and config parsing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@keinstn keinstn self-assigned this Jun 24, 2026
@keinstn
keinstn merged commit 9d776c2 into develop Jun 24, 2026
4 checks passed
@keinstn
keinstn deleted the agent/keinstn__baton-185 branch June 24, 2026 23:51
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.

feat(scripts): add review-sync one-shot script

1 participant