Skip to content

feat: PR Creation Agent — Skill 3: validate-and-apply-labels (Complete) - #1981

Merged
ashleyshaw merged 1 commit into
developfrom
feat/validate-and-apply-labels
Aug 18, 2026
Merged

feat: PR Creation Agent — Skill 3: validate-and-apply-labels (Complete)#1981
ashleyshaw merged 1 commit into
developfrom
feat/validate-and-apply-labels

Conversation

@ashleyshaw

@ashleyshawashleyshaw commented Aug 17, 2026

Copy link
Copy Markdown
Member

Summary

Complete implementation of label validation and application skill for PR Creation Agent Phase 3.

Deliverables

  • validate-and-apply-labels.js (~220 LOC): Validates and applies labels based on branch type and template context
  • validate-and-apply-labels.test.js: 33 tests, 100% passing, 97.5% code coverage
  • Integration: Works with Skill 1 (branchType) and Skill 2 (templateMetadata)

Features

  • Label mapping for 30+ branch types (feat, fix, docs, hotfix, refactor, chore, ci, test, security, design, a11y, ux, release, research, revert, i18n, ops, perf, build, deps, proto, ds, api, schema, telemetry, content, seo, config, migrate, qa, uat, audit)
  • Template context labels automatically added:
    • meta:needs-more-info when template missing required sections
    • meta:ready-for-review when all sections present
  • Canonical label validation against 30+ built-in labels
  • Custom configuration support for label mappings
  • WordPress-specific label support (wp:plugin, wp:theme, wp:block-plugin, wp:block-theme)
  • Helpful warnings for bare type labels

Test Coverage

  • 33 unit tests covering:
    • Input validation (branchType, templateFile required)
    • Branch-to-label mapping for all 30+ types
    • Context labels based on template metadata
    • Canonical label validation
    • Custom configuration support
    • WordPress-specific labels
    • Error handling and edge cases
  • 97.5% statement coverage, 100% branch & function coverage
  • All 30+ branch types tested
  • Edge cases: empty metadata, special characters, very long labels

Phase Progress

  • Phase 3: 3/6 skills complete (50%)
  • Skill 1 (validate-branch-name): ✅ 39 tests
  • Skill 2 (route-pr-template): ✅ 23 tests
  • Skill 3 (validate-and-apply-labels): ✅ 33 tests
  • Total: 95 tests, 97.88% coverage
  • Skills 4-6: Ready for implementation

Integration Pipeline

  1. Skill 1: validate-branch-name → returns branchType
  2. Skill 2: route-pr-template → returns templateFile + metadata
  3. Skill 3: validate-and-apply-labels → applies labels based on type + metadata
  4. Skills 4-6: (coming next)

Linked issues

Closes#1870

Changelog

Added

  • Label validation and application skill with support for 30+ branch types
  • Template context-aware label assignment
  • WordPress-specific label support
  • Comprehensive label mapping configuration

Changed

  • Enhanced PR orchestrator to support automatic label application

Checklist (Global DoD / PR)

  • All AC met and demonstrated
  • Tests added/updated (unit/E2E as appropriate)
  • Docs/readme/changelog updated (if user-facing)
  • Code/design reviews approved
  • CI green; linked issues closed; release notes prepared (if shipping)

@coderabbitai

coderabbitaiBot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@ashleyshaw, you've reached your PR review limit, so we couldn't start this review.

Next review available in:56 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 6bbfe078-d4bc-4dbb-bb60-0b2fcee31bd0

📥 Commits

Reviewing files that changed from the base of the PR and between 930cfb9 and b9cf6f2.

⛔ Files ignored due to path filters (1)
  • agents/pr-creation-agent/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • CHANGELOG.md
  • agents/pr-creation-agent/__tests__/unit/route-pr-template.test.js
  • agents/pr-creation-agent/__tests__/unit/validate-and-apply-labels.test.js
  • agents/pr-creation-agent/skills/route-pr-template.js
  • agents/pr-creation-agent/skills/validate-and-apply-labels.js

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.

@github-actions

github-actionsBot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

✅ Template check passed after update. Thanks for fixing the PR description.

@github-actions

Copy link
Copy Markdown
Contributor

❌ Branch Name Validation Failed

The branch name feat/validate-and-apply-labels does not follow the LightSpeed branching strategy.

Required Format

{type}/{scope}-{short-title}
  • type: one of the allowed prefixes (lowercase)
  • scope: lowercase, hyphens only (no underscores or uppercase)
  • title: lowercase, hyphens only (no underscores or uppercase)

Allowed Branch Types

feat, fix, hotfix, release, refactor, chore, docs, test, perf, ci, build, deps, security, revert, research, design, a11y, ux, i18n, ops, proto, ds, api, schema, telemetry, content, seo, config, migrate, qa, uat, audit, codex

Valid Examples

  • feat/branch-naming-enforcement
  • fix/validation-script-bug
  • chore/update-dependencies
  • docs/branching-strategy-guide
  • hotfix/critical-security-patch

Invalid Examples

  • claude/my-branch (type "claude" not allowed)
  • Feature/MyBranch (uppercase not allowed)
  • fix-bug (missing type prefix)
  • feat/my_feature (underscores not allowed)
  • feat/MyFeature (uppercase not allowed)

Solution

Rename your branch to follow the pattern and update the PR.

For more information, see docs/BRANCHING_STRATEGY.md.

@github-actions

github-actionsBot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #1981

CI Status:success
Files changed: 6
Risk Distribution: 0 critical, 0 high, 2 medium, 4 low

Recommendations

  • Ready to proceed pending human review

@ashleyshaw
ashleyshaw enabled auto-merge (squash) August 18, 2026 04:34
…e Implementation)
Complete implementation of label validation and application skill for PR Creation Agent Phase 3.
- **validate-and-apply-labels.js** (~220 LOC): Validates and applies labels based on branch type and template context
- **validate-and-apply-labels.test.js**: 33 tests, 100% passing, 97.5% code coverage
- **Integration**: Works with Skill 1 (branchType) and Skill 2 (templateMetadata)
- Label mapping for 30+ branch types (feat, fix, docs, hotfix, refactor, etc.)
- Template context labels (meta:needs-more-info, meta:ready-for-review)
- Canonical label validation with 30+ built-in labels
- Custom configuration support for label mappings
- WordPress-specific label support (wp:plugin, wp:theme, etc.)
- Helpful warnings for bare type labels
- 33 unit tests covering input validation, branch-to-label mapping, context labels, validation, custom config, WordPress labels, error handling, and integration
- 97.5% statement coverage, 100% branch & function coverage
- All 30+ branch types tested
- Edge cases: empty metadata, special characters, very long labels
- Phase 3: 3/6 skills complete (50%)
- Skill 1 (validate-branch-name): ✅ 39 tests
- Skill 2 (route-pr-template): ✅ 23 tests
- Skill 3 (validate-and-apply-labels): ✅ 33 tests
- Total: 95 tests, 97.88% coverage
- Skills 4-6: Ready for implementation
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@ashleyshaw
ashleyshawforce-pushed the feat/validate-and-apply-labels branch from 49d9b87 to b9cf6f2CompareAugust 18, 2026 05:57
@ashleyshaw
ashleyshaw merged commit 3e42d3d into developAug 18, 2026
25 of 30 checks passed
@ashleyshaw
ashleyshaw deleted the feat/validate-and-apply-labels branch August 18, 2026 05:58
@github-actionsgithub-actionsBot added status:needs-review Awaiting code review type:feature Feature or enhancement priority:normal Default priority area:documentation Docs & guides area:tests Test suites & harnesses lang:js JavaScript/TypeScript lang:md Markdown content/docs lang:json JSON config/content type:chore Chore / small hygiene change meta:needs-changelog Requires a changelog entry before merge labels Aug 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Milestone Allocation

✅ 2026-08-18T05:59:12.983Z [main] Starting allocation...
✅ 2026-08-18T05:59:13.299Z [main] Allocating PR #1981...
✅ 2026-08-18T05:59:14.167Z [allocate-pr] Allocated PR #1981 to milestone #76
✅ 2026-08-18T05:59:14.433Z [main] Allocating 1 linked issue(s)...
[@octokit/request] "PATCH https://api.github.com/repos/lightspeedwp/.github/issues/1870" is deprecated. It is scheduled to be removed on Fri, 10 Mar 2028 00:00:00 GMT. See https://docs.github.com/en/rest/about-the-rest-api/api-versions
✅ 2026-08-18T05:59:15.374Z [allocate-issue] Allocated issue #1870 to milestone #76
✅ 2026-08-18T05:59:15.374Z [summary] Allocation complete. | Allocated: 1 PR(s), 1 issue(s) | Skipped: 0 | Errors: 0

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

Labels

area:documentationDocs & guidesarea:testsTest suites & harnesseslang:jsJavaScript/TypeScriptlang:jsonJSON config/contentlang:mdMarkdown content/docsmeta:needs-changelogRequires a changelog entry before mergepriority:normalDefault prioritystatus:needs-reviewAwaiting code reviewtype:choreChore / small hygiene changetype:featureFeature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@ashleyshaw