| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Fixes #613
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting. Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe repository metadata generator now fetches all configured repositories in one GraphQL request. It matches results by generated IDs and writes each repository directly to a showcase Markdown file. Repository metadata uses branch for README branch selection. The GitHub Pages workflow uses GH_TOKEN. ChangesShowcase generation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Generator as gen-files.ts
participant GitHub as GitHub GraphQL API
participant Showcase as Showcase Markdown files
Generator->>GitHub: Request metadata and README content for all repositories
GitHub-->>Generator: Return aliased repository results
Generator->>Generator: Match results by generated repository ID
Generator->>Showcase: Write each repository README to its showcase file
Possibly related issues
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. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
npm i https://pkg.pr.new/unplugin@614 commit: 12da52a |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agentsVerify 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/.vitepress/data/gen-files.ts`: - Around line 49-72: Update the generator flow around Promise.allSettled and repoMeta so any rejected fetchRepo result is detected and causes an error to be thrown before writeFileSync or either consola.success call executes. Preserve metadata generation only for fully successful repository fetches; do not filter rejected results into partial repository.json output.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6f51fdde-1ca5-4b3d-9f68-f9032d979328
📥 CommitsReviewing files that changed from the base of the PR and between 9542f2d and 4f2f3a2.
📒 Files selected for processing (1)
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agentsVerify 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/.vitepress/data/gen-files.ts`: - Around line 80-81: Remove the console.log(results) debug statement from the GraphQL result handling in gen-files.ts. Do not log the full results object; if logging is required, use consola with only the repository name and status.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 770bda2c-20dd-4897-ab13-029cc99aa127
📥 CommitsReviewing files that changed from the base of the PR and between 7dcceb9 and d46198a.
📒 Files selected for processing (1)
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agentsVerify 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/.vitepress/data/gen-files.ts`: - Around line 32-39: Validate the GraphQL response before iterating in the repository generation flow: surface resp.errors with a clear failure, and reject any null aliased repository result with an error naming its key before calling writeReadme. Remove the unsafe Record<string, Repository> assumption or narrow it after validation, while preserving the existing metadata lookup and writeReadme behavior for valid repositories. - Around line 17-20: Update the GraphQL query template in the repository query construction to remove the empty parentheses from the repositoryQuery operation header, preserving the existing generated field selections and formatting.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4cf6dccf-b299-4389-9e3d-ad39abb9b1d6
📥 CommitsReviewing files that changed from the base of the PR and between d46198a and 3ccb359.
📒 Files selected for processing (3)
Sorry, something went wrong.
| const gql = `#graphql | ||
| query repositoryQuery() { | ||
| ${repositoryMeta.map(repository => buildRepoQuery(repository)).join('\n ')} | ||
| }` |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain🌐 Web query:
Does GitHub's GraphQL API accept a query operation with empty parentheses like "query repositoryQuery() { ... }" when no variables are declared, or does it reject it as a syntax error?
💡 Result:
GitHub's GraphQL API will reject a query operation defined with empty parentheses, such as query repositoryQuery {... }, as a syntax error [1][2]. According to the official GraphQL specification, the parentheses following an operation name are specifically reserved for the VariablesDefinition [1][2]. If an operation defines no variables, the parentheses must be omitted entirely; including them when there are no variables is syntactically invalid [1][2]. To correctly format your query, you should either remove the empty parentheses or use the shorthand syntax if the operation is unnamed and has no variables [1][2]: Valid options: 1. Named query without variables: query repositoryQuery {... } 2. Unnamed shorthand: {... } If you must include the parentheses, they are only permitted when they contain at least one variable declaration [1][2].
Citations:
🌐 Web query:
GraphQL spec OperationDefinition variableDefinitions empty parentheses query repositoryQuery() syntax error
💡 Result:
The GraphQL specification defines VariableDefinitions as an optional, non-empty list of variable definitions enclosed in parentheses [1][2]. Specifically, the grammar is defined as: VariablesDefinition: ( VariableDefinition+) [1][3] Because the grammar requires at least one VariableDefinition (indicated by the + quantifier in EBNF notation), providing empty parentheses () for variable definitions is syntactically invalid [1][4]. If you encounter a syntax error like repositoryQuery(), it is likely due to the inclusion of empty parentheses where no variables are defined, or a misunderstanding of how the operation name and variables are structured. To resolve this: 1. If your query requires no variables, simply omit the parentheses entirely [2]. 2. If you are attempting to name your query, the correct syntax is query RepositoryName { ... } [2]. 3. If you see code like repositoryQuery() in a client-side library (such as JavaScript/TypeScript SDKs), it is likely a function call in your code, not a GraphQL query string. Ensure you are passing the correct arguments to the function and that the actual GraphQL query string contained within it follows the valid query { ... } or query Name { ... } syntax [5][6][7]. In summary, () cannot be used in a GraphQL document to represent an empty variable definition block; if no variables are required, the parentheses must be removed [1][2].
Citations:
🌐 Web query:
GitHub GraphQL API error message "Syntax Error" "query..." empty parentheses
💡 Result:
The "Syntax Error: Expected Name, found)" error when using empty parentheses in a GraphQL query occurs because the GraphQL specification does not permit empty argument lists [1][2]. In GraphQL, if a field or query does not require arguments, you must omit the parentheses entirely rather than leaving them empty [3][1][2]. If you are encountering this error while querying the GitHub GraphQL API, check your query for any fields that include empty parentheses like field() and remove them to simply use field [3][2]. For example: - Incorrect: query { repository(name: "example") { issues {... } } } - Correct: query { repository(name: "example") { issues {... } } } If you intend to provide arguments, ensure they are correctly formatted within the parentheses. If you are dealing with dynamic query generation (where arguments might sometimes be absent), you must adjust your logic to conditionally omit the parentheses when no arguments are provided, rather than defaulting to an empty set [1].
Citations:
Remove the empty parentheses from the query header.
query repositoryQuery() { is invalid GraphQL because the VariableDefinitions block is optional when no variables are used, and parentheses cannot be empty. Use query repositoryQuery { so GitHub’s GraphQL API does not reject the generated document during showcase generation.
Proposed fix const gql = `#graphql
-query repositoryQuery() {
+query repositoryQuery {
${repositoryMeta.map(repository => buildRepoQuery(repository)).join('\n ')}
}`‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const gql = `#graphql | |
| query repositoryQuery() { | |
| ${repositoryMeta.map(repository => buildRepoQuery(repository)).join('\n ')} | |
| }` | |
| const gql = `#graphql | |
| query repositoryQuery { | |
| ${repositoryMeta.map(repository => buildRepoQuery(repository)).join('\n ')} | |
| }` |
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/.vitepress/data/gen-files.ts` around lines 17 - 20, Update the GraphQL query template in the repository query construction to remove the empty parentheses from the repositoryQuery operation header, preserving the existing generated field selections and formatting.
Sorry, something went wrong.
| const data = resp.data as Record<string, Repository> | ||
| for (const [key, repo] of Object.entries(data)) { | ||
| const meta = repositoryMeta.find(meta => getRepoId(meta) === key) | ||
| if (!meta) { | ||
| throw new Error(`Repository meta not found for ${key}`) | ||
| } | ||
| writeReadme(repo, meta) | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Check for GraphQL errors and null repository results before writing files.
resp.data is cast to Record<string, Repository> without checking resp.errors. GitHub's repository field is nullable. If a configured repository is renamed, moved, or otherwise inaccessible, its aliased field resolves to null while the HTTP response still returns 200 with an errors entry describing the field failure. The loop at Line 33 then passes repo === null into writeReadme, which crashes at Line 65 (repo.name) with an uninformative TypeError instead of a clear error naming the failing repository.
This is exactly the class of failure (renamed/inaccessible repos causing 404s) the PR is meant to fix. Surface it explicitly instead of letting it crash blindly.
Proposed fix const data = resp.data as Record<string, Repository>
+if (resp.errors?.length) {
+ throw new Error(`GraphQL errors: ${JSON.stringify(resp.errors)}`)
+}
for (const [key, repo] of Object.entries(data)) {
const meta = repositoryMeta.find(meta => getRepoId(meta) === key)
if (!meta) {
throw new Error(`Repository meta not found for ${key}`)
}
+ if (!repo) {
+ throw new Error(`Repository data not found for ${meta.owner}/${meta.name} (possibly renamed or inaccessible)`)
+ }
writeReadme(repo, meta)
}‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const data = resp.data as Record<string, Repository> | |
| for (const [key, repo] of Object.entries(data)) { | |
| const meta = repositoryMeta.find(meta => getRepoId(meta) === key) | |
| if (!meta) { | |
| throw new Error(`Repository meta not found for ${key}`) | |
| } | |
| writeReadme(repo, meta) | |
| } | |
| const data = resp.data as Record<string, Repository> | |
| if (resp.errors?.length) { | |
| throw new Error(`GraphQL errors: ${JSON.stringify(resp.errors)}`) | |
| } | |
| for (const [key, repo] of Object.entries(data)) { | |
| const meta = repositoryMeta.find(meta => getRepoId(meta) === key) | |
| if (!meta) { | |
| throw new Error(`Repository meta not found for ${key}`) | |
| } | |
| if (!repo) { | |
| throw new Error(`Repository data not found for ${meta.owner}/${meta.name} (possibly renamed or inaccessible)`) | |
| } | |
| writeReadme(repo, meta) | |
| } |
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/.vitepress/data/gen-files.ts` around lines 32 - 39, Validate the GraphQL response before iterating in the repository generation flow: surface resp.errors with a clear failure, and reject any null aliased repository result with an error naming its key before calling writeReadme. Remove the unsafe Record<string, Repository> assumption or narrow it after validation, while preserving the existing metadata lookup and writeReadme behavior for valid repositories.
Sorry, something went wrong.
There was a problem hiding this comment.
.github/workflows/gh-pages.yml (1)🤖 Prompt for all review comments with AI agents25-25: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win
Add GH_TOKEN to the workflow docs or keep GITHUB_TOKEN.
This workflow now reads secrets.GH_TOKEN, but repository docs only document setting GITHUB_TOKEN for docs generation. Add a GH_TOKEN setup step or update .docs/.env.example and docs/README.md to use GH_TOKEN, so deploy runs do not fail due to a missing token.
🤖 Prompt for AI AgentsVerify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/gh-pages.yml at line 25, Align the token name used by the workflow with the documented configuration: either change the GITHUB_TOKEN assignment in the workflow to use secrets.GITHUB_TOKEN, or update .docs/.env.example and docs/README.md to document GH_TOKEN consistently. Ensure docs deployment uses the same token name everywhere.
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Nitpick comments: In @.github/workflows/gh-pages.yml: - Line 25: Align the token name used by the workflow with the documented configuration: either change the GITHUB_TOKEN assignment in the workflow to use secrets.GITHUB_TOKEN, or update .docs/.env.example and docs/README.md to document GH_TOKEN consistently. Ensure docs deployment uses the same token name everywhere.
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: cb7be91a-619c-4c20-9f85-60e7b53f31d6
📥 CommitsReviewing files that changed from the base of the PR and between 3ccb359 and b09c2e8.
📒 Files selected for processing (1)
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #613
Summary by CodeRabbit