Skip to content

feat(standards): require -reusable.yml naming suffix for pure reusables - #627

Merged
don-petry merged 4 commits into
mainfrom
feat/reusable-naming-suffix
Jul 9, 2026
Merged

don-petry merged 4 commits into
mainfrom
feat/reusable-naming-suffix

Conversation

@don-petry

@don-petry don-petry commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

What

Follow-up to #626 (merged). Layers a naming convention on top of the just-landed "pure reusable workflows must be disabled" standard: a pure reusable (on: workflow_call only) MUST be named *-reusable.yml.

This was reviewed and approved as part of #626's discussion but landed after that PR auto-merged, so it comes in as its own small PR.

Why

The -reusable.yml suffix makes the "this is a library, safe to disable, never runnable on its own" property legible from the filename — no need to open the file and parse on:. The suffix is a readability aid, not the detection mechanism: the compliance check still classifies by triggers, never by name (a name can lie — exactly how the pr-review.yml engine hid as a pure reusable).

Changes

  • standards/ci-standards.md — add the naming requirement + rationale to the "Pure reusable workflows must be disabled" section; document the grandfathered pr-review.yml exception.
  • scripts/compliance-audit.sh — check_reusable_workflows_disabled() now also emits a separate reusable-naming-<wf> warning for any pure reusable lacking the suffix, independent of the disabled-state finding. pr-review.yml is grandfathered until its rename lands.

Grandfather / follow-up

pr-review.yml is the one pure reusable (15/16 already comply) without the suffix; renaming it is entangled with its caller path + 10 pr-review/* release-channel tags. Tracked separately in petry-projects/.github-private#1127; suppressed in the check until then.

Validation

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved compliance checks for reusable workflows by adding a naming-suffix validation (pure workflow_call-only workflows must end with -reusable.yml).
    • The check emits warnings when the suffix is missing, while preserving a grandfathered exception for the legacy PR review workflow.
  • Documentation

    • Updated CI standards to document the -reusable.yml naming requirement and the required manual disablement in the GitHub Actions UI.
  • Tests

    • Added coverage for compliant and non-compliant filenames, including the exception behavior.

Layer a naming convention on top of the disable standard: a pure reusable
(workflow_call-only) MUST be named `*-reusable.yml` so its "library, safe to
disable, never runnable on its own" nature is legible from the filename without
opening the file. The suffix is a readability aid, NOT the detection mechanism —
the compliance check still classifies by triggers, never by name (a name can
lie, which is exactly how the pr-review.yml engine hid as a pure reusable).

- ci-standards.md: add the naming requirement + rationale to the "Pure reusable
  workflows must be disabled" section; document the grandfathered pr-review.yml
  exception (tracked in .github-private#1127).
- compliance-audit.sh: check_reusable_workflows_disabled() now also emits a
  separate `reusable-naming-<wf>` warning for any pure reusable lacking the
  suffix, independent of the disabled-state finding. pr-review.yml is
  grandfathered until its rename lands (#1127).

15/16 pure reusables already comply; simulated across the live fleet, the only
non-compliant name is the grandfathered pr-review.yml (suppressed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@don-petry
don-petry requested a review from a team as a code owner July 9, 2026 02:58
Copilot AI review requested due to automatic review settings July 9, 2026 02:58
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 699b2dab-7a9f-46ca-979c-733f0ebcc972

📥 Commits

Reviewing files that changed from the base of the PR and between 613a1d6 and f5c239e.

📒 Files selected for processing (3)
  • scripts/compliance-audit.sh
  • standards/ci-standards.md
  • test/scripts/compliance-audit/reusable-workflows-disabled.bats

📝 Walkthrough

Walkthrough

This PR adds a suffix-based naming lint for pure workflow_call reusable workflows, keeps a grandfathered pr-review.yml exception, updates the CI standards text, and adds tests for the new compliance behavior.

Changes

Reusable Workflow Naming Rule

Layer / File(s) Summary
Naming rule and standard
scripts/compliance-audit.sh, standards/ci-standards.md
Adds a warning when a pure reusable workflow lacks the -reusable.yml suffix, exempts .github-private/pr-review.yml, and documents the rule, rationale, and exception in the standards file.
Naming rule tests
test/scripts/compliance-audit/reusable-workflows-disabled.bats
Adds helper logic and Bats coverage for compliant suffixes, missing suffixes, grandfathered pr-review.yml, repo-scoped behavior, and .yaml extension handling.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: enforcing the -reusable.yml suffix for pure reusable workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/reusable-naming-suffix

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.

@gemini-code-assist gemini-code-assist Bot 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 introduces a naming standard for pure reusable workflows, requiring them to use the -reusable.yml suffix. This standard is documented in standards/ci-standards.md and enforced via a new lint check in scripts/compliance-audit.sh, with a grandfathered exception for the legacy pr-review.yml workflow. The review feedback suggests improving the Bash script by consistently using double brackets [[ ... ]] for conditional checks to avoid potential word splitting or globbing issues.

Comment thread scripts/compliance-audit.sh Outdated

Copilot AI 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.

Pull request overview

Adds an org-wide naming convention for “pure reusable” GitHub Actions workflows (those with on: workflow_call only), requiring a *-reusable.yml suffix to make “library-only” workflows recognizable at a glance, and extends the compliance audit to emit a separate naming warning (with a documented/suppressed legacy exception for .github-private/pr-review.yml).

Changes:

  • Document *-reusable.yml naming requirement for pure reusables (plus rationale and a grandfathered exception).
  • Extend check_reusable_workflows_disabled() to emit reusable-naming-* warnings when a pure reusable lacks the suffix.
  • Suppress the naming warning for the legacy .github-private/pr-review.yml engine pending its tracked rename.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
standards/ci-standards.md Documents the -reusable.yml naming requirement for pure reusables, including rationale and the pr-review.yml grandfathered exception.
scripts/compliance-audit.sh Adds a naming-lint warning for pure reusable workflows that don’t use the -reusable.yml suffix, with a temporary suppression for .github-private/pr-review.yml.

Comment thread scripts/compliance-audit.sh Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@standards/ci-standards.md`:
- Around line 169-183: The Compliance paragraph is stale and still describes
only active-state workflow findings, so update it to match the current audit
behavior. In the standards/ci-standards.md Compliance section, revise the
description to mention both the new reusable naming check for workflows that
should use the -reusable.yml suffix and the independent reusable-naming-<wf>
warning emitted by the script, so the docs stay aligned with the script’s
current checks and the reusable naming rule referenced elsewhere in the
document.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d0b9be32-936e-4ce2-abde-32fce59b07a2

📥 Commits

Reviewing files that changed from the base of the PR and between 9b27602 and 613a1d6.

📒 Files selected for processing (2)
  • scripts/compliance-audit.sh
  • standards/ci-standards.md

Comment thread standards/ci-standards.md
@don-petry

Copy link
Copy Markdown
Contributor Author

@coderabbitai resolve

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) July 9, 2026 03:07
@don-petry
don-petry disabled auto-merge July 9, 2026 03:07
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) July 9, 2026 03:10
@don-petry
don-petry disabled auto-merge July 9, 2026 03:15
@don-petry
don-petry enabled auto-merge (squash) July 9, 2026 03:17
@don-petry
don-petry disabled auto-merge July 9, 2026 03:18
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
Files changed: None required
Skipped (informational): 0
**Status:** ✅ No actionable issues. SonarCloud Quality Gate passed with no new issues, no security hotspots, and all CI checks passing or skipped. The PR is ready to merge from a quality/security perspective.

@don-petry
don-petry enabled auto-merge (squash) July 9, 2026 03:19

@donpetry-bot donpetry-bot 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.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: 07d8efad364438cc25e7f00dbf06c857c73caad3
Review mode: triage-approved (single reviewer)

Summary

Follow-up to #626 adding a naming convention for pure reusable workflows: warning-level lint in compliance-audit.sh requiring the -reusable.yml suffix, matching standards doc update, and 5 new bats tests. Additive, well-scoped, all CI green, all review threads resolved. Confirms the triage low-risk assessment.

Linked issue analysis

No closing issue linked. The PR is an explicitly documented follow-up to merged #626 (the naming rule was approved in that PR's discussion but landed after auto-merge). The one non-compliant workflow (pr-review.yml) is grandfathered with its rename tracked in petry-projects/.github-private#1127, referenced both in the doc and the script comment.

Findings

  • No blocking findings.
  • scripts/compliance-audit.sh: naming lint is additive (separate warning finding), correctly placed after the hybrid-trigger exemption, and classification remains trigger-based per the stated design. Grandfather match is repo-scoped (.github-private/pr-review.yml) and covered by a dedicated bats test.
  • standards/ci-standards.md: naming requirement, rationale, and grandfathered exception documented; compliance-check section updated to match (the earlier CodeRabbit stale-doc finding was addressed and the thread resolved).
  • test: 5 new bats tests mirror the check, including suffix-compliant, missing suffix, grandfather scoping, and .yaml-vs-.yml edge case.
  • Secret scan: run_secret_scanning MCP tool unavailable in this run; gitleaks CI check passed and the diff contains no secret-like content.
  • Prior CodeRabbit CHANGES_REQUESTED review was dismissed and superseded by a CodeRabbit APPROVED review; all 3 review threads resolved.

CI status

All required checks green: ShellCheck, Lint and bats, CodeQL, Agent Security Scan, Secret scan (gitleaks), SonarCloud (quality gate passed), agent-shield, npm audit. Ecosystem-specific audits skipped (not applicable). An early cancelled dev-lead dispatch run was superseded by a later SUCCESS. Branch is BEHIND main but MERGEABLE.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge July 9, 2026 04:38
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
- SonarCloud quality gate: **PASSED** (all checks green)
- Review threads: **All resolved** (confirmed via GraphQL query)
- Prior CodeRabbit stale-doc finding: **Already addressed** — standards/ci-standards.md lines 222–231 now document both the pure reusable disabled-state check and the separate `-reusable.yml` naming check, matching the implementation in scripts/compliance-audit.sh lines 329–339
- No Tier 1 blockers (no failures, CHANGES_REQUESTED, or other blocking states)
**Files verified:**
- `standards/ci-standards.md` — compliance section updated with reusable naming requirement and grandfathered exception documentation
- `scripts/compliance-audit.sh` — reusable naming lint implemented with proper exemption for legacy `pr-review.yml`
- `test/scripts/compliance-audit/reusable-workflows-disabled.bats` — 5 new tests added covering the naming check
**Issues addressed:** 0 (quality gate passed with no findings)
No changes needed — the PR is ready.

@don-petry
don-petry merged commit 10241b4 into main Jul 9, 2026
21 of 22 checks passed
@don-petry
don-petry deleted the feat/reusable-naming-suffix branch July 9, 2026 04:39
don-petry added a commit that referenced this pull request Aug 7, 2026
…es (#627)

* feat(standards): require -reusable.yml naming suffix for pure reusables

Layer a naming convention on top of the disable standard: a pure reusable
(workflow_call-only) MUST be named `*-reusable.yml` so its "library, safe to
disable, never runnable on its own" nature is legible from the filename without
opening the file. The suffix is a readability aid, NOT the detection mechanism —
the compliance check still classifies by triggers, never by name (a name can
lie, which is exactly how the pr-review.yml engine hid as a pure reusable).

- ci-standards.md: add the naming requirement + rationale to the "Pure reusable
  workflows must be disabled" section; document the grandfathered pr-review.yml
  exception (tracked in .github-private#1127).
- compliance-audit.sh: check_reusable_workflows_disabled() now also emits a
  separate `reusable-naming-<wf>` warning for any pure reusable lacking the
  suffix, independent of the disabled-state finding. pr-review.yml is
  grandfathered until its rename lands (#1127).

15/16 pure reusables already comply; simulated across the live fleet, the only
non-compliant name is the grandfathered pr-review.yml (suppressed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore: dev-lead update (review-changes) [skip ci-relay]

* chore: dev-lead update (review-changes) [skip ci-relay]

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
Co-authored-by: Don Petry Bot <donpetry+bot@gmail.com>
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.

3 participants