feat(ci): add unique PR identity - #205
Conversation
|
Warning
|
| Layer / File(s) | Summary |
|---|---|
Pull request title update API .github/scripts/helpers/api.cjs |
Adds and exports updatePullRequest, with title validation, GitHub REST API updates, success logging, and structured error handling. |
Labeler identity title flow .github/scripts/pr-labeler.cjs |
Detects module-qualified KDM titles, builds titles from the matched module, type, and pull request number, and continues labeling when updates fail. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Sequence Diagram(s)
sequenceDiagram
participant Labeler as pr-labeler
participant Builder as buildPRIdentityTitle
participant Helper as updatePullRequest
participant GitHub as GitHub REST API
Labeler->>Builder: Matched module, type, PR number, current title
Builder-->>Labeler: Standardized identity title or null
Labeler->>Helper: Update title when it differs
Helper->>GitHub: Update pull request title
GitHub-->>Helper: Success or structured error
Helper-->>Labeler: Update result
Labeler->>Labeler: Log failure and continue labeling
Possibly related PRs
- KDM-cli/kdm-cli#148: The PR labeler and shared API helper changes extend code introduced or modified by this PR.
Suggested reviewers: utkarsh232005
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly summarizes the main change: adding unique pull request identity generation. |
| Description check | ✅ Passed | The description directly describes standardized PR titles, identity generation, API updates, and validation results. |
| Linked Issues check | ✅ Passed | The changes implement the unique PR identity and standardized title requirements described in issue #107. |
| Out of Scope Changes check | ✅ Passed | The changed files and functionality directly support the unique PR identity and title-standardization objectives. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
📋 Issue Planner
Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
View plan for ticket: #107
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 @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 @.github/scripts/pr-labeler.cjs:
- Around line 98-100: Update detectType() and the cleanedTitle expression to
share parsing for the emitted [KDM-CONFIG-FIX-123] format, while retaining
support for and removing the legacy [KDM-123-FIX] prefix during migration.
Ensure typeKey extraction and subsequent title processing work on either
supported format.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: QUIET
Plan: Pro Plus
Run ID: dc5d2158-32fd-4274-a9a2-5c4377d0b17b
📒 Files selected for processing (2)
.github/scripts/helpers/api.cjs.github/scripts/pr-labeler.cjs
There was a problem hiding this comment.
No application code in the PR — skipped Code Health checks.
See analysis details in CodeScene
Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
|
Hi @utkarsh232005, I’ve addressed the CodeRabbit review comment and pushed the fix in the latest commit. CodeRabbit has now approved the changes with no actionable comments. Could you please review the PR when you get a chance? Thanks! |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The code is clean, and the tests passed successfully. Great work! I'll go ahead and merge this as is. |
|
@Akanshagore Thank you for the contribution! We look forward to seeing more from you in the future. Please feel free to check out the other open issues in the repository as well. |
|
@all-contributors please add @Akanshagore for code |
|
I've put up a pull request to add @Akanshagore! 🎉 |
|
Thank you so much for the review and for merging the PR! 🙌 Really appreciate the feedback and guidance. Looking forward to contributing more to KDM-cli! 🚀 |
Summary
[KDM-MODULE-TYPE-ID]updatePullRequestAPI helperChanges
updatePullRequest()to.github/scripts/helpers/api.cjs.github/scripts/pr-labeler.cjsValidation
node --check .github/scripts/helpers/api.cjs✅node --check .github/scripts/pr-labeler.cjs✅git diff --check✅npm test✅Closes #107