Skip to content

ops: enforce branch strategy and add config governance guide#793

Open
ashleyshaw wants to merge 1 commit into
developfrom
ops/branch-governance-guardrails
Open

ops: enforce branch strategy and add config governance guide#793
ashleyshaw wants to merge 1 commit into
developfrom
ops/branch-governance-guardrails

Conversation

@ashleyshaw
Copy link
Copy Markdown
Member

Summary

  • enforce branch naming inside the required Validation job
  • add a reusable branch-name validator for local and CI use
  • document the agent branch protocol in repo-local instructions and the branching strategy
  • add the canonical configs interdependencies guide to docs

Validation

  • npm run validate:branch-name -- --branch ops/branch-governance-guardrails
  • npm run lint:md
  • npm run lint:workflows
  • npm run lint:pkg-json
  • npm run validate:frontmatter

Add a reusable branch-name validator, wire it into the required Validation job, document the agent branch protocol, and add the canonical configs guide.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

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 38 minutes and 10 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: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 1dc203a1-4b69-4445-a6ef-08b680c800e0

📥 Commits

Reviewing files that changed from the base of the PR and between f62305a and c6eac4f.

📒 Files selected for processing (6)
  • .github/custom-instructions.md
  • .github/workflows/checks.yml
  • docs/BRANCHING_STRATEGY.md
  • docs/CANONICAL_CONFIGS_GUIDE.md
  • package.json
  • scripts/validation/validate-branch-name.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ops/branch-governance-guardrails

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.

@github-actions github-actions Bot added area:ci Build and CI pipelines area:dependencies Composer/npm dependency work area:documentation Docs & guides area:scripts Scripts & tooling lang:js JavaScript/TypeScript lang:md Markdown content/docs lang:json JSON config/content status:needs-review Awaiting code review labels Jun 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

🔍 Reviewer Summary for PR #793

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

Recommendations

  • ⚠️ 1 critical-risk file(s) modified (workflows, secrets)
  • ⚠️ Security-sensitive files modified (review carefully)

@github-actions github-actions Bot added priority:normal Default priority type:chore Chore / small hygiene change type:documentation Documentation meta:needs-changelog Requires a changelog entry before merge labels Jun 3, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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 branch name validation via a new script (validate-branch-name.js) integrated into package.json, updates the branching strategy documentation, and adds a new guide (CANONICAL_CONFIGS_GUIDE.md) mapping the interdependencies of canonical configuration files. The review feedback suggests improving the branch validation script to gracefully handle tag/release workflows and detached HEAD states, and recommends using relative paths instead of absolute URLs for local documentation links to ensure portability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +105 to +113
function main() {
const branchName = resolveBranchName();

if (!branchName) {
console.error(
"No branch name provided. Use --branch or set BRANCH_NAME, GITHUB_HEAD_REF, or GITHUB_REF_NAME.",
);
process.exit(1);
}
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.

high

To prevent CI failures during tag/release workflows (where GITHUB_REF_TYPE is 'tag') and to provide a better developer experience locally when in a detached HEAD state, we should handle these cases gracefully instead of exiting with an error code.

Suggested change
function main() {
const branchName = resolveBranchName();
if (!branchName) {
console.error(
"No branch name provided. Use --branch or set BRANCH_NAME, GITHUB_HEAD_REF, or GITHUB_REF_NAME.",
);
process.exit(1);
}
function main() {
if (process.env.GITHUB_REF_TYPE === "tag" || (process.env.GITHUB_REF && process.env.GITHUB_REF.startsWith("refs/tags/"))) {
console.log("Running on a tag. Skipping branch name validation.");
process.exit(0);
}
const branchName = resolveBranchName();
if (!branchName) {
console.warn(
"No active branch detected (possibly detached HEAD). Skipping branch name validation."
);
process.exit(0);
}

Comment on lines +110 to +114
- [docs/ISSUE_FIELDS.md](https://github.com/lightspeedwp/.github/blob/HEAD/docs/ISSUE_FIELDS.md)
- [docs/ISSUE_TYPES.md](https://github.com/lightspeedwp/.github/blob/HEAD/docs/ISSUE_TYPES.md)
- [docs/LABEL_STRATEGY.md](https://github.com/lightspeedwp/.github/blob/HEAD/docs/LABEL_STRATEGY.md)
- [docs/LABELING.md](https://github.com/lightspeedwp/.github/blob/HEAD/docs/LABELING.md)
- [docs/BRANCHING_STRATEGY.md](https://github.com/lightspeedwp/.github/blob/HEAD/docs/BRANCHING_STRATEGY.md)
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

Using absolute GitHub URLs for repository-local documentation links makes the files less portable (e.g., when viewed in forks or offline). It is highly recommended to use relative paths instead.

Suggested change
- [docs/ISSUE_FIELDS.md](https://github.com/lightspeedwp/.github/blob/HEAD/docs/ISSUE_FIELDS.md)
- [docs/ISSUE_TYPES.md](https://github.com/lightspeedwp/.github/blob/HEAD/docs/ISSUE_TYPES.md)
- [docs/LABEL_STRATEGY.md](https://github.com/lightspeedwp/.github/blob/HEAD/docs/LABEL_STRATEGY.md)
- [docs/LABELING.md](https://github.com/lightspeedwp/.github/blob/HEAD/docs/LABELING.md)
- [docs/BRANCHING_STRATEGY.md](https://github.com/lightspeedwp/.github/blob/HEAD/docs/BRANCHING_STRATEGY.md)
- [docs/ISSUE_FIELDS.md](./ISSUE_FIELDS.md)
- [docs/ISSUE_TYPES.md](./ISSUE_TYPES.md)
- [docs/LABEL_STRATEGY.md](./LABEL_STRATEGY.md)
- [docs/LABELING.md](./LABELING.md)
- [docs/BRANCHING_STRATEGY.md](./BRANCHING_STRATEGY.md)
References
  1. Documentation and governance files in the docs/ directory must use UPPERCASE naming with underscores (e.g., GOVERNANCE_REVISION_LOG.md).

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6eac4fba2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +39 to +43
"config",
"migrate",
"qa",
"uat",
];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep existing labelled branch prefixes allowed

In this repo, .github/labeler.yml already maps ai/* and automation/* branches to canonical labels, and the AI ops/automation issue templates instruct contributors to use those prefixes. Because the new checks.yml Validation job runs this allow-list on every PR targeting develop, those existing ai/... and automation/... PR branches will now fail before they can merge. Add the supported prefixes here, or update the labeler/templates in the same change if those branch types are being retired.

Useful? React with 👍 / 👎.

@ashleyshaw ashleyshaw added meta:no-changelog No changelog needed and removed meta:needs-changelog Requires a changelog entry before merge labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci Build and CI pipelines area:dependencies Composer/npm dependency work area:documentation Docs & guides area:scripts Scripts & tooling lang:js JavaScript/TypeScript lang:json JSON config/content lang:md Markdown content/docs meta:no-changelog No changelog needed priority:normal Default priority status:needs-review Awaiting code review type:chore Chore / small hygiene change type:documentation Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant