[codex] standardise front matter contracts#1016
Conversation
|
Warning Review limit reached
More reviews will be available in 13 minutes and 46 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. 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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (39)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
✅ Template check passed after update. Thanks for fixing the PR description. |
Metadata governance
|
🎨 Mermaid Diagram Validation✅ All Mermaid diagram checks passed.
|
🔍 Reviewer Summary for PR #1016CI Status: ❌ Recommendations
|
There was a problem hiding this comment.
Code Review
This pull request standardizes the repository's front matter contract, ensuring Markdown issue templates use name and about while pull request templates use title and description. It updates the schema, validators, documentation, and adds a new test suite to enforce these rules. The review feedback suggests adding a null/undefined guard in the validator to prevent crashes, making the test's front matter parser robust against Windows line endings, aligning the test's key-presence check with the validator's logic, and documenting this migration in /docs/MIGRATION.md.
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.
| if ( | ||
| fileType === "issue_template" && | ||
| Object.prototype.hasOwnProperty.call(frontmatter, "description") | ||
| ) { | ||
| this.logger.error( | ||
| "Issue template frontmatter must use `about` instead of `description` to match GitHub's Markdown issue template contract.", | ||
| filePath, | ||
| ); | ||
| this.stats.errors++; | ||
| } | ||
|
|
||
| if ( | ||
| fileType === "pull_request_template" && | ||
| Object.prototype.hasOwnProperty.call(frontmatter, "about") | ||
| ) { | ||
| this.logger.error( | ||
| "Pull request template frontmatter must use `description` instead of `about` to keep repo-local template metadata consistent.", | ||
| filePath, | ||
| ); | ||
| this.stats.errors++; | ||
| } |
There was a problem hiding this comment.
If frontmatter is null or undefined (which can happen if the YAML block is empty or invalid), calling Object.prototype.hasOwnProperty.call(frontmatter, ...) will throw a TypeError and crash the validation script. Adding a guard at the beginning of this block ensures the validator reports the schema validation error gracefully instead of crashing.
if (!frontmatter || typeof frontmatter !== "object") {
return;
}
if (
fileType === "issue_template" &&
Object.prototype.hasOwnProperty.call(frontmatter, "description")
) {
this.logger.error(
"Issue template frontmatter must use 'about' instead of 'description' to match GitHub's Markdown issue template contract.",
filePath,
);
this.stats.errors++;
}
if (
fileType === "pull_request_template" &&
Object.prototype.hasOwnProperty.call(frontmatter, "about")
) {
this.logger.error(
"Pull request template frontmatter must use 'description' instead of 'about' to keep repo-local template metadata consistent.",
filePath,
);
this.stats.errors++;
}|
|
||
| function readFrontmatter(filePath) { | ||
| const content = fs.readFileSync(filePath, "utf8"); | ||
| const match = content.match(/^---\n([\s\S]*?)\n---/); |
There was a problem hiding this comment.
The regex ^---\n expects exactly \n after ---. If the file has Windows line endings (\r\n), this match will fail and throw an error. Using \r?\n makes the frontmatter extraction robust across different operating systems.
| const match = content.match(/^---\n([\s\S]*?)\n---/); | |
| const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/); |
|
|
||
| const violations = templateFiles.filter((file) => { | ||
| const frontmatter = readFrontmatter(path.join(templateDir, file)); | ||
| return !frontmatter.about || Boolean(frontmatter.description); |
There was a problem hiding this comment.
Using Boolean(frontmatter.description) will not flag cases where description is present but has a falsy value (like an empty string "" or false). However, the actual validators use hasOwnProperty and will reject those files. Aligning the test check with the validator's logic ensures consistent enforcement.
| return !frontmatter.about || Boolean(frontmatter.description); | |
| return !frontmatter.about || "description" in frontmatter; |
| Update every affected file so the repository uses one canonical front matter contract: | ||
|
|
||
| - Markdown issue templates in `.github/ISSUE_TEMPLATE/*.md` use `name` + `about` | ||
| - PR templates use `title` + `description` | ||
| - Documentation, instructions, and prompts keep `description` as the summary field |
There was a problem hiding this comment.
According to the repository's general rules, migration maps and notes should be documented in a central /docs/MIGRATION.md file. Please ensure that this front matter contract migration is documented there so contributors can easily follow the migration rules.
References
- Document migration maps and notes in a central
/docs/MIGRATION.mdfile to ensure contributors can follow migration rules mentioned in README files across the repository.
Chore Pull Request
Linked issues
Closes #1012
Closes #1015
Summary
name+aboutand remove the duplicateddescriptionfield.Changes
aboutas the canonical front matter field.descriptionand PR templates reject duplicatedabout.Impact / Compatibility
Verification
Risk & Rollback
Changelog
Added
Changed
aboutand updated validation, workflow, and documentation references.Fixed
descriptionfields and aligned PR template front matter with the repo’s template contract.Removed
Checklist (Global DoD / PR)