📝 Add docstrings to remediation/hyperplan-audit-fixes - #43
BillyOutlast merged 1 commit into
Conversation
Docstrings generation was requested by @BillyOutlast. * #42 (comment) The following files were modified: * `server/server/internal/tasks/index.ts` * `server/server/internal/tasks/registry/objects.ts` * `torrential/src/downloads/download.rs` * `torrential/src/server/mod.rs`
|
Important Review skippedThis PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note
|
|
Greptile SummaryThis PR adds and improves documentation comments across four files in response to a docstring generation request: two TypeScript task files get new/refined JSDoc, and two Rust files in the
Confidence Score: 3/5The Rust changes in The duplicate comment on Files Needing Attention: Important Files Changed
|
| /** | ||
| Uses the waitmap to wait for a response from a query | ||
| */ | ||
| /// Waits for a response associated with a message ID and parses its payload. |
There was a problem hiding this comment.
Duplicate doc comment left on
wait_for_message_id
The old /** Uses the waitmap to wait for a response from a query */ block comment (lines 118–120) was kept alongside the new /// line doc. In Rust, both /** */ and /// comments desugar to #[doc = "..."] attributes, so rustdoc will render them concatenated — the function will show a short, now-incomplete legacy description immediately before the detailed new one, making the published documentation confusing and redundant. The old block comment should be removed.
Prompt To Fix With AI
This is a comment left during a code review.
Path: torrential/src/server/mod.rs
Line: 118-121
Comment:
**Duplicate doc comment left on `wait_for_message_id`**
The old `/** Uses the waitmap to wait for a response from a query */` block comment (lines 118–120) was kept alongside the new `///` line doc. In Rust, both `/** */` and `///` comments desugar to `#[doc = "..."]` attributes, so rustdoc will render them concatenated — the function will show a short, now-incomplete legacy description immediately before the detailed new one, making the published documentation confusing and redundant. The old block comment should be removed.
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| /// Creates a version backend using the filesystem location specified by the version data. | ||
|
|
||
| /// | ||
|
|
||
| /// Returns an internal server error when the backend configuration is invalid, the version | ||
|
|
||
| /// path does not exist, or the backend cannot be constructed. Panics if the backend type is | ||
|
|
||
| /// absent from `version_data.source`. | ||
|
|
||
| /// | ||
|
|
||
| /// # Examples | ||
|
|
||
| /// | ||
|
|
||
| /// ```no_run | ||
|
|
||
| /// # let version_data: &VersionResponse = todo!(); | ||
|
|
||
| /// let backend = create_backend(version_data)?; | ||
|
|
||
| /// # Ok::<(), StatusCode>(()) | ||
|
|
||
| /// ``` | ||
|
|
||
| /// | ||
|
|
||
| /// # Errors | ||
|
|
||
| /// | ||
|
|
||
| /// Returns `StatusCode::INTERNAL_SERVER_ERROR` when the backend configuration, version path, | ||
|
|
||
| /// or backend construction is invalid. | ||
|
|
||
| /// | ||
|
|
||
| /// # Panics | ||
|
|
||
| /// | ||
|
|
||
| /// Panics if `version_data.source.backend` is `None`. |
There was a problem hiding this comment.
Non-idiomatic blank lines interspersed in doc comment
Every /// doc comment line is separated by a blank (non-///) line — e.g. /// Creates..., blank, ///, blank, /// Returns.... Idiomatic Rust uses only /// separator lines for blank lines within a doc block. The non-/// blank lines will be silently ignored by rustdoc, so the paragraphs render correctly by accident, but cargo fmt will not normalise them, and the pattern is inconsistent with the rest of the codebase. Each empty separator should be a /// line, not a bare blank line.
Prompt To Fix With AI
This is a comment left during a code review.
Path: torrential/src/downloads/download.rs
Line: 52-94
Comment:
**Non-idiomatic blank lines interspersed in doc comment**
Every `///` doc comment line is separated by a blank (non-`///`) line — e.g. `/// Creates...`, blank, `///`, blank, `/// Returns...`. Idiomatic Rust uses only `///` separator lines for blank lines within a doc block. The non-`///` blank lines will be silently ignored by `rustdoc`, so the paragraphs render correctly by accident, but `cargo fmt` will not normalise them, and the pattern is inconsistent with the rest of the codebase. Each empty separator should be a `///` line, not a bare blank line.
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| /// # Examples | ||
|
|
||
| /// | ||
|
|
||
| /// ```no_run | ||
|
|
||
| /// # let version_data: &VersionResponse = todo!(); | ||
|
|
||
| /// let backend = create_backend(version_data)?; | ||
|
|
||
| /// # Ok::<(), StatusCode>(()) | ||
|
|
||
| /// ``` |
There was a problem hiding this comment.
Doctest example references a private function
create_backend has no pub visibility, so the no_run doctest example calls a function that can never be imported in the doctest harness's generated module. While no_run prevents compilation errors today, the example is misleading to readers and would silently fail if the annotation were ever removed. Consider removing the # Examples section from a private function's doc, or replacing it with a prose description of the typical call site in create_download_context.
Prompt To Fix With AI
This is a comment left during a code review.
Path: torrential/src/downloads/download.rs
Line: 64-76
Comment:
**Doctest example references a private function**
`create_backend` has no `pub` visibility, so the `no_run` doctest example calls a function that can never be imported in the doctest harness's generated module. While `no_run` prevents compilation errors today, the example is misleading to readers and would silently fail if the annotation were ever removed. Consider removing the `# Examples` section from a private function's doc, or replacing it with a prose description of the typical call site in `create_download_context`.
How can I resolve this? If you propose a fix, please make it concise.4d0ba58
into
remediation/hyperplan-audit-fixes
* remediation: Phase 1 config + Phase 2 quick fixes (hyperplan audit) Phase 1 — Config hygiene: - Pin vue/vue-router from 'latest' to concrete versions (server, desktop, base) - Dependabot npm interval: weekly → daily - Add fallow.txt/fallow.json to .gitignore - Remove redundant server/.editorconfig (subset of root) - Remove commented-out arktype generator in schema.prisma - Remove 7 commented-out code blocks across server/ - Fix CLAUDE.md:35 (pre-commit falsehood: says pnpm test, actual is typecheck) - Fix CLAUDE.md:79 (dead path reference to server/.husky/pre-commit) - Create fallow.toml with Nuxt path excludes - Switch CodeQL build-mode: none → autobuild for JS/TS + Rust Phase 2 — Correctness quick fixes: - Fix torrential download.rs:57 double unwrap chain (P0) - Fix torrential server/mod.rs:134 inner unwrap defeating error return (P0) - Fix Promise boolean at session/index.ts:195: add await (P1) - Fix 3 pre-existing type errors (settings InputEvent, IGDBID, igdb ratingCoverUrl) * remediation: Phase 2-3 remaining items (hyperplan audit) P1-3: Add @@index([userId]) on Client + Session, @@index([expiresAt]) on Session - Prevents full table scans on every user lookup and session cleanup P1-4: Fix N+1 query in objects.ts findUnreferencedStrings - Replaced per-object-per-model queries with batched findMany per model - Reduces DB queries from O(objects × models) to O(models) PROC-2: Narrow drop/no-prisma-delete ESLint rule to entity allowlist - Allow hard-delete on join tables (companyGame, gameTag) - Allow hard-delete on auth tokens (apiToken, session, certificate, invitation) - Allow hard-delete on auth mechanisms (linkedAuthMec, linkedMFAMec) - Entities requiring soft-delete (game, user, library, etc.) still blocked PROC-4: Add pre-commit Rust fmt check - Detects changed .rs files and runs cargo fmt --check - Covers torrential, cli, and desktop/src-tauri workspaces * remediation: P1-5 replace console.error with structured logger - oidc/index.ts: replace console.warn + 3x console.error with logger.warn/error - webauthn/finish.post.ts: add logger import, replace console.error - desktop/composables/game.ts: remove debug console.log OIDC logout failures now produce structured log entries with error context instead of bare stderr output. Production errors become visible to monitoring. * remediation: fix lint errors, add missing migration, fix pre-commit hook - Fix 10 import/first ESLint errors in test files (vi.mock hoisting) - Fix no-explicit-any: type systemACLs as SystemACL in confused-deputy test - Add Prisma migration for @@index on Session(userId, expiresAt) and Client(userId) - Filter pre-commit cargo fmt by workspace prefix to avoid cross-workspace checks * Update torrential/src/server/mod.rs Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * 📝 Add docstrings to `remediation/hyperplan-audit-fixes` (#43) Docstrings generation was requested by @BillyOutlast. * #42 (comment) The following files were modified: * `server/server/internal/tasks/index.ts` * `server/server/internal/tasks/registry/objects.ts` * `torrential/src/downloads/download.rs` * `torrential/src/server/mod.rs` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: apply CodeRabbit auto-fixes Fixed 7 file(s) based on 10 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai> * fix: restore Rust fmt check in pre-commit, set CodeQL Rust build-mode to none - Restore Rust formatting check stripped by CodeRabbit autofix - Change CodeQL Rust build-mode from autobuild to none (avoids CI failures) - Restore @ts-expect-error comments needed for Prisma dynamic access * fix: format test file, fix torrential recieve_loop unwrap - Format dependency-pinning.test.ts (prettier) - Fix message.type_.unwrap() in recieve_loop to use ok_or_else (Greptile finding) - Note: pre-commit cargo fmt skipped (proto files not generated locally) * fix: correct SonarCloud org mapping, enable in-code resolution - Update SonarCloud org from heretek-drop to billyoutlast - Update project key from Heretek-Drop_drop to BillyOutlast_drop - Enable sonar.issues.issueResolution.enabled for SONAR-RESOLVE - Add missing exclusions to editorconfig CI * test: add coverage for OIDC logout and session signout - Add oidc-logout.test.ts covering handleLogout error paths - Add signout tests to session-fixation.test.ts - Covers 5 previously uncovered lines (codecov/patch) * fix: address CodeRabbit review #4781108218 - Pin vue/vue-router to exact versions, allow standard ^ ranges for others - Use hasSome instead of per-id has predicates in objects.ts * fix: set CodeQL JS/TS build-mode to none JS/TS doesn't need compilation for CodeQL analysis. autobuild is for compiled languages only. * refactor: split extractReferencedIds into helpers, use Set for O(1) lookups - Extract extractScalarReferences and extractArrayReferences - Use Set<string> instead of Array.includes for validIds - Reduces cognitive complexity from 22 to under 15 * fix: editorconfig violations - Add final newlines to sonarcloud-issues.json, game.test.ts, vitest.config.ts - Remove trailing whitespace in nginx.conf * chore: remove sonarcloud-issues.json dump file * style: run prettier and eslint --fix across codebase - Format Vue components and TypeScript files - Remove unused eslint-disable directives - Fix session-fixation.test.ts formatting * chore: trigger CI after disabling SonarCloud automatic analysis * ci: update SonarCloud to recommended config v8.1.0 - Update action to v8.1.0 - Remove continue-on-error - Remove args (using sonar-project.properties) * ci: make pnpm audit non-blocking npm registry endpoint is returning malformed URLs. Making audit step non-blocking so CI can proceed. * fix: add sonar.organization to sonar-project.properties * ci: optimize SonarCloud configuration - Add sonar.tests for proper test code separation - Add sonar.qualitygate.wait=true to fail CI on quality gate failure - Add sonar.qualitygate.timeout=600 for larger projects - Optimize exclusions (add .nuxt, .output) - Add SonarQube cache to CI workflow * fix: remove sonar.tests to prevent double indexing sonar.sources= overlaps with sonar.tests, causing test files to be indexed twice. Use exclusions instead. --------- Co-authored-by: John Smith <you@example.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: CodeRabbit <noreply@coderabbit.ai>



Docstrings generation was requested by @BillyOutlast.
The following files were modified:
server/server/internal/tasks/index.tsserver/server/internal/tasks/registry/objects.tstorrential/src/downloads/download.rstorrential/src/server/mod.rsThese file types are not supported
.github/dependabot.yml.github/workflows/codeql.yml.gitignore.husky/pre-commit.omo/plans/remediation-plan.md.omo/review/agent-hooks-audit.md.omo/review/ci-cd-audit.md.omo/review/code-quality-audit.md.omo/review/cross-attack-high-effort.md.omo/review/documentation-audit.md.omo/review/sonarqube-audit.md.omo/review/test-coverage-audit.mdAGENTS.mdCLAUDE.mddesktop/main/package.jsonfallow.tomllibraries/base/package.jsonserver/components/UserFooter.vueserver/package.jsonserver/pages/account/security.vueserver/pages/admin/settings.vueserver/pages/admin/settings/index.vueserver/pages/library/game/[id]/index.vueserver/pages/store/[id]/index.vueserver/prisma/models/auth.prismaserver/prisma/models/client.prismaserver/prisma/schema.prismaℹ️ Note