feat(cli): gitpulse:ignore label excludes PRs from publication#58
Conversation
Apply `gitpulse:ignore` to a merged PR to drop its story from the timeline. The label is the durable state — every analyzer run re-reads labels and rebuilds, so retroactive labeling prunes old stories and removing the label re-publishes them (within the bootstrap window). Label name is configurable via `.gitpulse.json` under `labels.ignore`; the object shape leaves room for future actions (group, regenerate) without further schema changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds configurable PR curation via an "ignore" label: schema and defaults, GitHub label fetching and search, an ignore-sweep to remove restored story files, and analyzer integration to skip processing ignored PRs and exclude their SHAs. ChangesPR Label Curation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
|
Vercel preview — built from |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cli/src/github.ts`:
- Around line 137-139: The GraphQL query currently requests labels(first: 20),
which can miss ignore labels and break the per-commit skip check; change that to
labels(first: 100) in the GraphQL query in github.ts so up to 100 labels are
returned, and ensure the per-commit skip check (the commit-skip/ignore logic)
uses the returned nodes { name } as before without truncation.
- Line 306: The interpolated label is used directly in the GitHub search query
and must be escaped to avoid breaking the query when it contains backslashes or
double quotes; before constructing the query string (the line with query:
`repo:${owner}/${repo} is:pr is:merged label:"${label}"`) create a safeLabel by
replacing backslashes with `\\` and double quotes with `\"` (escape backslash
first), then use label:"${safeLabel}" in the query; update the code where
`label` is referenced to use this escaped variable so user-configured labels
cannot break the search.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 896c8eab-4de5-44e8-a399-1e5c1b0b4281
📒 Files selected for processing (9)
cli/src/config.tscli/src/github.test.tscli/src/github.tscli/src/ignore-sweep.test.tscli/src/ignore-sweep.tscli/src/index.tscli/src/labels.tscli/src/project-config.test.tscli/src/project-config.ts
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 2 unresolved review comments. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 1 file(s) based on 2 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Summary
gitpulse:ignorePR label that drops the labelled PR's story from the publication. The label set on GitHub is the source of truth — every analyzer run re-reads labels and rebuilds, so retroactive labelling prunes old stories and removing the label re-publishes them (subject to the bootstrap window)..gitpulse.jsonunderlabels.ignore; defaults togitpulse:ignore. The object shape leaves room forgroup/regeneratelater without another schema migration.ctx.pr.labelscheck insideprocessCommit(handles the edge case where the label landed between sweep and fetch).Usage
```fish
gh label create gitpulse:ignore --color cccccc --description "Excluded from gitpulse publication"
gh pr edit 45 --add-label gitpulse:ignore
```
Or with a custom name in `.gitpulse.json`:
```json
{ "labels": { "ignore": "team:skip" } }
```
Files
Limitations
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests