Repository navigation
Conversation
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
<!-- coderabbit-ai-generated:v1 -->
…on-builder/fb051f5c Prevent GraphQL injection in docs review project updates
<!-- coderabbit-ai-generated:v1 -->
…parsers/f720c066 Restrict frontmatter parsing to safe YAML formats
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Resolved conflicts in: - src/content-render/tests/move-by-content-type.ts (unmerged) - src/frame/lib/read-frontmatter.ts (unmerged) Co-authored-by: CodeRabbit <noreply@coderabbit.ai> CodeRabbit-Task-Id: 0d1cc25f-093e-44ff-9f53-0de2c3e25501
|
Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines. |
|
This pull request may have been opened accidentally. I'm going to close it now, but feel free to check out our contribution guidelines, or raise an issue. |
1 similar comment
|
This pull request may have been opened accidentally. I'm going to close it now, but feel free to check out our contribution guidelines, or raise an issue. |
|
This pull request may have been opened accidentally. I'm going to close it now, but feel free to check out our contribution guidelines, or raise an issue. |
1 similar comment
|
This pull request may have been opened accidentally. I'm going to close it now, but feel free to check out our contribution guidelines, or raise an issue. |
|
👋 Hi there! It looks like you've modified some files that we can't accept as contributions:
You'll need to raise a new PR that doesn't include those files, before we can review. The complete list of files we can't accept are:
We also can't accept contributions to files in the content directory with frontmatter |
How to review these changes 👓Thank you for your contribution. To review these changes, choose one of the following options: A Hubber will need to deploy your changes internally to review. Table of review linksNote: Please update the URL for your staging server or codespace. This pull request contains code changes, so we will not generate a table of review links. 🤖 This comment is automatically generated. |
There was a problem hiding this comment.
🟡 Changes recommended
A critical parsing bug reparses already-separated body content, causing valid Markdown thematic breaks to be misinterpreted as frontmatter and potentially throwing or stripping content.
1 open issue
What changed in this PR
This PR replaces selected gray-matter usage with shared YAML/JSON frontmatter parsing, parameterizes ProjectV2 GraphQL mutations, and strengthens content migration filesystem safety.
Changes:
- Adds centralized frontmatter parsing and serialization with handling for BOMs, line endings, labels, and malformed input.
- Migrates workflows, data utilities, linting, and article API transformers to the shared parser and parsed Markdown content.
- Uses GraphQL variables for user-derived ProjectV2 values and adds safer path, symlink, write, and cleanup behavior to content migration.
| File | Description |
|---|---|
| src/workflows/tests/projects.ts | Adds tests for variable-based ProjectV2 mutations and GraphQL-safe values. |
| src/workflows/ready-for-docs-review.ts | Passes generated ProjectV2 mutation variables through the GraphQL request. |
| src/workflows/projects.ts | Builds parameterized ProjectV2 mutations with fixed field names and request variables. |
| src/workflows/fr-add-docs-reviewers-requests.ts | Updates reviewer-request workflow calls to use the new mutation variables API. |
| src/workflows/fm-utils.ts | Uses the shared frontmatter parser for workflow content-type checks. |
| src/versions/scripts/update-versioning-in-files.ts | Removes an obsolete TypeScript suppression related to serialization options. |
| src/frame/tests/read-frontmatter.ts | Adds coverage for frontmatter parsing, labeling, errors, and serialization. |
| src/frame/lib/read-frontmatter.ts | Replaces gray-matter integration with shared parsing and YAML serialization. |
| src/frame/lib/parse-yaml-frontmatter.ts | Adds centralized secure YAML/JSON frontmatter parsing and validation. |
| src/data-directory/tests/get-data.ts | Tests labeled, malformed, translated, and fallback reusable frontmatter behavior. |
| src/data-directory/README.md | Documents reusable Markdown frontmatter conventions and parsing behavior. |
| src/data-directory/lib/get-data.ts | Uses the shared parser for data and reusable Markdown loading. |
| src/data-directory/lib/data-directory.ts | Uses shared parsing when loading Markdown data files. |
| src/content-render/tests/move-by-content-type.ts | Adds tests for migration safety, symlinks, writes, cleanup, and malformed frontmatter. |
| src/content-render/scripts/move-by-content-type.ts | Adds path validation, symlink checks, safer writes, and conservative cleanup behavior. |
| src/content-linter/lib/helpers/utils.ts | Uses the shared parser for linter frontmatter extraction. |
| src/article-api/transformers/webhooks-transformer.ts | Uses already-stripped page Markdown for manual content. |
| src/article-api/transformers/rest-transformer.ts | Extracts manual content directly from the parsed page Markdown. |
| src/article-api/transformers/github-apps-transformer.ts | Uses already-stripped page Markdown for GitHub Apps content. |
| src/article-api/transformers/audit-logs-transformer.ts | Extracts manual content directly from the parsed page Markdown. |
| src/article-api/lib/graphql-helpers.ts | Simplifies manual content extraction from parsed page Markdown. |
Review effort: Lite

Why:
Closes:
What's being changed (if available, include any code snippets, screenshots, or gifs):
Check off the following: