Skip to content

fix(ci): implement issue #419 labeler hardening - #427

Merged
ashleyshaw merged 5 commits into
developfrom
codex/issue-419-labeler-hardening
May 27, 2026
Merged

fix(ci): implement issue #419 labeler hardening#427
ashleyshaw merged 5 commits into
developfrom
codex/issue-419-labeler-hardening

Conversation

@ashleyshaw

@ashleyshawashleyshaw commented May 27, 2026

Copy link
Copy Markdown
Member

Closes#419

What changed

  • Removed the dormant actions/labeler@v5 execution path from .github/workflows/labeling.yml
  • Added fail-fast config schema validation before labeling execution
  • Added scripts/validation/validate-labeling-configs.cjs for labels.yml, issue-types.yml, and labeler.yml
  • Updated workflow/governance/migration docs to reflect unified labeling runtime

Validation

  • node scripts/validation/validate-labeling-configs.cjs
  • npx spectral lint .github/workflows/labeling.yml --ruleset .spectral-workflows.cjs
  • npx markdownlint-cli2 docs/WORKFLOWS.md docs/AUTOMATION_GOVERNANCE.md docs/MIGRATION.md

Summary by CodeRabbit

  • Chores

    • Enhanced labeling workflow with automated configuration validation at runtime to ensure consistency and prevent misconfigurations.
    • Removed deprecated labeling action in favor of a unified labeling agent approach.
  • Documentation

    • Updated automation governance and workflow documentation to reflect the refined labeling process and new validation requirements.
    • Added migration notes documenting the labeling workflow improvements.

Review Change Stack

@coderabbitai

coderabbitaiBot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

More reviews will be available in 49 minutes and 7 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 99270b8e-c89c-4c85-848d-71ee4c157db5

📥 Commits

Reviewing files that changed from the base of the PR and between 7f2349c and 7928c71.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • docs/MIGRATION.md
  • package.json

Note

.coderabbit.yml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized keys: "auto_labels", "auto_assign", "auto_review"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

The PR hardens the labeling automation by introducing a Node.js schema validator that enforces YAML structure constraints on three canonical configuration files, integrates this validator as a CI fail-fast gate in the labeling workflow before label assignment, removes the deprecated actions/labeler action, and documents the workflow changes.

Changes

Labeling Workflow Hardening with Schema Validation

Layer / File(s)Summary
Configuration schema validator implementation
scripts/validation/validate-labeling-configs.cjs
New CLI script validates .github/labels.yml, .github/issue-types.yml, and .github/labeler.yml schemas: labels and issue-types require specific array shapes with name/label fields; labeler.yml enforces each rule set contains at least one of head-branch or changed-files. Fails with exit code 1 on parse or validation errors.
Workflow validation gate and labeler cleanup
.github/workflows/labeling.yml
Adds a "Validate labeling config schema" step that runs the new validator after npm ci, establishing a fail-fast CI gate. Removes the previously disabled actions/labeler@v5 step, leaving only the unified labeling.agent.js for label assignment.
Documentation of workflow hardening and migration notes
docs/WORKFLOWS.md, docs/AUTOMATION_GOVERNANCE.md, docs/MIGRATION.md
WORKFLOWS.md documents the pre-label validation guardrail. AUTOMATION_GOVERNANCE.md removes the actions/labeler@v5 reference. MIGRATION.md adds a dated entry (2026-05-27) explaining the retirement of actions/labeler@v5, unified runtime location, and new CI validation gate.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Description check⚠️ WarningThe PR description covers key changes and validation steps but lacks critical sections from the template like Risk Assessment, How to Test, and Checklist items required for release automation.Add Risk Assessment (level and impact), How to Test section with prerequisites and test steps, and complete the global DoD checklist to meet template requirements.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately reflects the main change: implementing issue #419 labeler hardening by removing the dormant actions/labeler step and adding schema validation.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-419-labeler-hardening

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.

@gemini-code-assistgemini-code-assistBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request retires the native actions/labeler@v5 in favor of a unified labeling agent runtime, and introduces a fail-fast validation script (validate-labeling-configs.cjs) to verify configuration schemas before execution. The feedback suggests strengthening the validation script by adding type checks for optional label fields (such as color, description, and aliases) and verifying that head-branch and changed-files are strings or arrays of strings to prevent runtime issues.

Comment on lines +20 to +30
function assertLabelConfig(labels) {
if (!Array.isArray(labels)) {
fail(".github/labels.yml must be an array");
}
labels.forEach((item, index) => {
if (typeof item === "string") return;
if (!item || typeof item !== "object" || typeof item.name !== "string") {
fail(`Invalid labels.yml entry at index ${index}`);
}
});
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The current validation for labels.yml only checks the presence of the name field. However, label definitions can also include color, description, and aliases (as seen in docs/AUTOMATION_GOVERNANCE.md).

Adding type checks for these fields prevents runtime issues in the labeling agent. Specifically, validating that color is a string is crucial because unquoted numeric hex colors (e.g., 123456) are parsed as numbers by js-yaml, which can corrupt the hex value.

function assertLabelConfig(labels) {
if (!Array.isArray(labels)) {
fail(".github/labels.yml must be an array");
}
labels.forEach((item, index) => {
if (typeof item === "string") return;
if (!item || typeof item !== "object" || typeof item.name !== "string") {
fail("Invalid labels.yml entry at index " + index);
}
if (item.color !== undefined && typeof item.color !== "string") {
fail("color in labels.yml entry at index " + index + " must be a string (wrap in quotes if numeric)");
}
if (item.description !== undefined && typeof item.description !== "string") {
fail("description in labels.yml entry at index " + index + " must be a string");
}
if (item.aliases !== undefined) {
if (!Array.isArray(item.aliases) || item.aliases.some(a => typeof a !== "string")) {
fail("aliases in labels.yml entry at index " + index + " must be an array of strings");
}
}
});
}

Comment on lines +46 to +71
function assertLabelerConfig(labeler) {
if (!labeler || typeof labeler !== "object" || Array.isArray(labeler)) {
fail(".github/labeler.yml must be an object map");
}

for (const [label, rules] of Object.entries(labeler)) {
if (!rules || typeof rules !== "object" || Array.isArray(rules)) {
fail(`Rule for '${label}' must be an object`);
}

const hasHeadBranch = Object.prototype.hasOwnProperty.call(
rules,
"head-branch",
);
const hasChangedFiles = Object.prototype.hasOwnProperty.call(
rules,
"changed-files",
);

if (!hasHeadBranch && !hasChangedFiles) {
fail(
`Rule for '${label}' must include at least one of 'head-branch' or 'changed-files'`,
);
}
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The current validation for labeler.yml only checks for the presence of head-branch or changed-files keys, but does not validate their types. If these fields are misconfigured (e.g., set to a boolean, number, or an array containing non-string values), it could cause runtime errors or unexpected behavior in the labeling agent.

Adding type validation ensures that both fields are either a string or an array of strings.

function assertLabelerConfig(labeler) {
if (!labeler || typeof labeler !== "object" || Array.isArray(labeler)) {
fail(".github/labeler.yml must be an object map");
}
for (const [label, rules] of Object.entries(labeler)) {
if (!rules || typeof rules !== "object" || Array.isArray(rules)) {
fail("Rule for '" + label + "' must be an object");
}
const hasHeadBranch = Object.prototype.hasOwnProperty.call(
rules,
"head-branch"
);
const hasChangedFiles = Object.prototype.hasOwnProperty.call(
rules,
"changed-files"
);
if (!hasHeadBranch && !hasChangedFiles) {
fail(
"Rule for '" + label + "' must include at least one of 'head-branch' or 'changed-files'"
);
}
if (hasHeadBranch) {
const val = rules["head-branch"];
if (typeof val !== "string" && !Array.isArray(val)) {
fail("head-branch in rule for '" + label + "' must be a string or an array");
}
if (Array.isArray(val) && val.some(v => typeof v !== "string")) {
fail("head-branch array in rule for '" + label + "' must contain only strings");
}
}
if (hasChangedFiles) {
const val = rules["changed-files"];
if (typeof val !== "string" && !Array.isArray(val)) {
fail("changed-files in rule for '" + label + "' must be a string or an array");
}
if (Array.isArray(val) && val.some(v => typeof v !== "string")) {
fail("changed-files array in rule for '" + label + "' must contain only strings");
}
}
}
}

@ashleyshawashleyshaw added the meta:no-changelog No changelog needed label May 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #427

CI Status:pending
Files changed: 7

Recommendations

  • CI checks not green

@github-actionsgithub-actionsBot added status:needs-review Awaiting code review priority:normal Default priority type:chore Chore / small hygiene change type:bug Bug or defect labels May 27, 2026

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 `@docs/MIGRATION.md`:
- Around line 94-95: Update the prose to UK English by replacing the phrase
"labeling workflow" with "labelling workflow" while keeping code identifiers
unchanged (leave `actions/labeler@v5`, `labeler.yml` and filenames like
`labeling.agent.js` intact); edit the sentence containing "actions/labeler@v5
execution was retired from the labeling workflow..." so it reads "...retired
from the labelling workflow..." and ensure no other code tokens are modified.
🪄 Autofix (Beta)

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: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: da8d6596-8c03-4180-9c43-7007fb267a1d

📥 Commits

Reviewing files that changed from the base of the PR and between 6c41bab and 7f2349c.

📒 Files selected for processing (5)
  • .github/workflows/labeling.yml
  • docs/AUTOMATION_GOVERNANCE.md
  • docs/MIGRATION.md
  • docs/WORKFLOWS.md
  • scripts/validation/validate-labeling-configs.cjs

Comment threaddocs/MIGRATION.md
Comment on lines +94 to +95
- `actions/labeler@v5` execution was retired from the labeling workflow due to
persistent schema incompatibility with the canonical `labeler.yml` structure.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use UK English in prose for consistency.

Please change “labeling workflow” to “labelling workflow” in this sentence (keep code identifiers like labeling.agent.js unchanged).

As per coding guidelines, "Keep wording in UK English."

🤖 Prompt for 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.
In `@docs/MIGRATION.md` around lines 94 - 95, Update the prose to UK English by
replacing the phrase "labeling workflow" with "labelling workflow" while keeping
code identifiers unchanged (leave `actions/labeler@v5`, `labeler.yml` and
filenames like `labeling.agent.js` intact); edit the sentence containing
"actions/labeler@v5 execution was retired from the labeling workflow..." so it
reads "...retired from the labelling workflow..." and ensure no other code
tokens are modified.

@github-actionsgithub-actionsBot removed the type:chore Chore / small hygiene change label May 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #427

CI Status:success
Files changed: 7

Recommendations

  • Ready to proceed pending human review

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #427

CI Status:pending
Files changed: 7

Recommendations

  • CI checks not green

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #427

CI Status:pending
Files changed: 5

Recommendations

  • CI checks not green

@ashleyshaw
ashleyshaw merged commit bd7627f into developMay 27, 2026
11 of 12 checks passed
@ashleyshaw
ashleyshaw deleted the codex/issue-419-labeler-hardening branch May 27, 2026 13:44
@ashleyshawashleyshaw self-assigned this May 27, 2026
@ashleyshawashleyshaw removed the meta:no-changelog No changelog needed label May 28, 2026
@github-actionsgithub-actionsBot added the meta:needs-changelog Requires a changelog entry before merge label May 28, 2026
ashleyshaw added a commit that referenced this pull request Jul 24, 2026
…ssues
Enhanced all 76 changelog entries to include both PR and issue references per
explicit requirements. Added issue links to 34 PRs that have linked issues:
- PR #331, #376, #377, #411, #412, #413, #421, #426, #427, #433, #438, #439,
#440, #450, #451, #453, #454, #458, #497, #499, #500, #502, #534, #574,
#696, #699, #769, #856, #857, #858, #860, #862, #865, #873
Format: ([PR #N](url), [#issue1](url), [#issue2](url), ...)
All 76 entries now have complete PR + issue cross-references following GitHub
linking conventions.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
ashleyshaw added a commit that referenced this pull request Jul 24, 2026
* chore(changelog): rebuild entries from phase 1 (40+ PRs, may 24 — jul 24)
Consolidated [Unreleased] section with entries from 40+ merged PRs spanning
May 24 — July 24, 2026. Properly organized into canonical order (Added, Fixed,
Changed) per Keep a Changelog 1.1.0 standard. Added Contributors section
recognizing team effort. Resolves Phase 2 rebuild milestone (Epic #1271).
- Removed duplicate section headers (was: 3x Added, 2x Fixed, 2x Changed)
- Consolidated 40+ PR entries into single organized [Unreleased] section
- Applied CHANGELOG_GUIDELINES.md formatting standards to all entries
- Added Contributors/Credits section
- All entries validated against Keep a Changelog format
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* fix(changelog): remove duplicate branch-cleanup and dependabot entries
Removed two duplicates from [Unreleased] Changed section:
- Dependabot auto-merge fix (PR #1020) already in [0.6.0] section
- Branch cleanup automation (PR #1067) already in Fixed section
Addresses CodeRabbit feedback on duplicate entries.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* chore(changelog): comprehensive recovery of all 76 PR entries (may 24 — jul 24)
Recovered ALL changelog entries from 76 merged PRs spanning May 24 — July 24, 2026.
Previous rebuild was incomplete (only 40 of 76 PRs). This comprehensive rebuild
includes all user-facing changes from the complete timeframe:
- 11 Added entries (new features, components, automation)
- 9 Fixed entries (bug fixes, workflow corrections)
- 56 Changed entries (updates, documentation, dependencies)
All entries properly categorized, formatted per Keep a Changelog 1.1.0 standard,
with direct PR links and issue references where applicable.
Resolves incomplete Phase 2 rebuild across PRs #1277 and #1281.
Addresses Epic #1271 scope correction (76 PRs, not 40).
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* chore(changelog): add issue links to all 34 PR entries with related issues
Enhanced all 76 changelog entries to include both PR and issue references per
explicit requirements. Added issue links to 34 PRs that have linked issues:
- PR #331, #376, #377, #411, #412, #413, #421, #426, #427, #433, #438, #439,
#440, #450, #451, #453, #454, #458, #497, #499, #500, #502, #534, #574,
#696, #699, #769, #856, #857, #858, #860, #862, #865, #873
Format: ([PR #N](url), [#issue1](url), [#issue2](url), ...)
All 76 entries now have complete PR + issue cross-references following GitHub
linking conventions.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* fix(changelog): remove Contributors section from [Unreleased] to resolve validation schema conflict
The Contributors section is not part of Keep a Changelog 1.1.0 standard and conflicts with the changelog validation schema. Moved outside [Unreleased] section to resolve P1 validation blocking issue.
Addresses: PR #1281 review feedback (Codex P1 comment)
Co-Authored-By: Claude Code <noreply@anthropic.com>
* fix(changelog-validation): remove unused inEntry variable
Removed the unused local variable declaration that was flagged by code quality analysis.
Co-Authored-By: Claude Code <noreply@anthropic.com>
* chore: merge develop into changelog-phase-2-rebuild (resolve workflow consolidation)
Phase 2 automation hardening (validation, testing, guidelines) ready for merge.
Accepting develop's changelog version which contains correct [Unreleased] entries
for changes since v1.0.0 release (June 3). Workflow consolidation (Phase 1B)
merged into develop while Phase 2 rebuild was in progress.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
@coderabbitaicoderabbitaiBot mentioned this pull request Aug 6, 2026
12 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta:needs-changelogRequires a changelog entry before mergepriority:normalDefault prioritystatus:needs-reviewAwaiting code reviewtype:bugBug or defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Build/CI] Re-enable actions/labeler with canonical schema-compatible config

1 participant

@ashleyshaw