Repository navigation
Fix CodeFactor duplication in CLI and SDK primitives - #380
Conversation
Single-source create/update unset metadata, mutation option keys, and SDK bulk mutation filter contracts to remove CodeFactor-reported duplicate tables from shipped CLI/SDK code. Scope CodeFactor away from generated package runtime loaders, generated plugin MCP launchers, and tests that are already enforced by repository gates; update the CodeFactor docs pointer to the current file-ignore documentation. PM evidence: pm-92if, pm-fmjy, and pm-arzz record GitHub/security/changelog/Sentry/telemetry findings plus verification. Passed pnpm build, targeted 254-test suite, pnpm contracts:check, pnpm quality:static, pnpm typecheck, pnpm security:scan, pnpm changelog:pm:check, sentry-telemetry gate, manual isolated temp-dir smoke, and full coverage 100/100/100/100 across 5133 tests.
Reviewer's GuideSingle-sources CLI create/update unset-field metadata and common mutation option keys, deduplicates SDK bulk mutation filter contracts, tightens CodeFactor scope to authored code, and records associated PM evidence files. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
@codex review |
📝 WalkthroughWalkthroughUpdated PM tracking artifacts and CodeFactor exclusions, then refactored shared CLI metadata for unset fields, create/update option keys, and bulk mutation filter contracts. ChangesShared CLI metadata and contract cleanup
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
|
To use Codex here, create a Codex account and connect to github. |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The use of
COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR.slice(0, 1)and.slice(1)is a bit opaque; consider replacing the magic indices with named constants or explicit arrays to make the ordering contract between create/update more obvious and less fragile to future edits. - Since
COMMON_MUTATION_COMMAND_OPTION_KEYSand the shared unset-field definitions conceptually describe the same logical field set, consider documenting or centralizing their relationship so future changes to one can’t silently drift from the other.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The use of `COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR.slice(0, 1)` and `.slice(1)` is a bit opaque; consider replacing the magic indices with named constants or explicit arrays to make the ordering contract between create/update more obvious and less fragile to future edits.
- Since `COMMON_MUTATION_COMMAND_OPTION_KEYS` and the shared unset-field definitions conceptually describe the same logical field set, consider documenting or centralizing their relationship so future changes to one can’t silently drift from the other.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request refactors several files to address CodeFactor complexity and duplication issues. Specifically, it extracts shared unset-field metadata into a new helper module, consolidates common mutation command option keys, and deduplicates bulk mutation filter option contracts. Additionally, it updates the CodeFactor configuration to exclude generated files and tests. A review comment suggests simplifying the definition of UPDATE_UNSET_FIELD_DEFINITIONS in src/cli/commands/update.ts to avoid fragile .slice calls.
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.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify 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 @.codefactor.yml:
- Around line 14-16: The `tests/**` ignore rule in the CodeFactor config may now
hide test-file issues from static analysis, so verify the `static-quality-gate`
path in `scripts/release/static-quality-gate.mjs` explicitly includes `tests/`
when running in CI. Update that gate or its invocation from `package.json` so it
still scans and reports on test files even though CodeFactor no longer does,
while keeping the generated artifact exclusions intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 507b9b38-8f09-4954-923f-ac38b5add976
📒 Files selected for processing (13)
.agents/pm/epics/pm-92if.toon.agents/pm/extensions/.managed-extensions.json.agents/pm/history/pm-92if.jsonl.agents/pm/history/pm-arzz.jsonl.agents/pm/history/pm-fmjy.jsonl.agents/pm/tasks/pm-arzz.toon.agents/pm/tasks/pm-fmjy.toon.codefactor.ymlsrc/cli/commands/create.tssrc/cli/commands/shared-unset-fields.tssrc/cli/commands/update.tssrc/core/item/type-registry.tssrc/sdk/cli-contracts/tool-option-contracts.ts
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Replace slice-based update unset ordering with named shared groups around close-reason and document the core/CLI alignment boundary for mutation option keys. Addresses Sourcery and Gemini feedback on PR #380. Verified with pnpm build, pnpm quality:static, pnpm contracts:check, and targeted create/update/SDK tests.
|
@codex review Review loop update: pushed 4acf9af addressing Sourcery/Gemini feedback by replacing slice-based unset ordering with named groups and documenting core/CLI alignment. Please review the current head. |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
To use Codex here, create a Codex account and connect to github. |
|
✅ Action performedFull review finished. |
Record PR #380 merge evidence and release the active CodeFactor remediation claims after the merged current-head checks and AI review loop passed.
Summary
--unsetfield metadata inshared-unset-fields.tsand reuse it from both command handlers.pm-92if,pm-fmjy, andpm-arzz, including GitHub/dependency/security/changelog/Sentry/telemetry findings.Verification
pnpm buildnode scripts/run-tests.mjs test -- tests/unit/commands/create-command.spec.ts tests/unit/commands/update-command.spec.ts tests/unit/packages/runtime-loaders.spec.ts tests/unit/scripts/gen-package-runtime-loaders.spec.ts tests/unit/scripts/gen-plugin-mcp-wrappers.spec.ts tests/unit/plugins/pm-mcp-server.spec.ts tests/unit/packages/package-manifest.spec.ts(7 files, 254 tests)pnpm contracts:checkpnpm quality:staticpnpm typecheckpnpm security:scannode scripts/run-tests.mjs coverage(256 files, 5133 tests, 100% statements/branches/functions/lines)pnpm changelog:pm:check(pm-changelog 2026.6.20, CHANGELOG.md unchanged)PM_PATH/PM_GLOBAL_PATH: init, create, update--unset, package install todos, package doctor deep, contracts, healthnode scripts/release/sentry-telemetry-gate.mjs --json --telemetry-mode best-effortpm telemetry stats --jsonGitHub / release notes
RELEASE_PATin the release environment; this branch does not require code changes for that failure.Summary by Sourcery
Deduplicate shared CLI unset-field metadata and bulk mutation option/filter contracts while tightening CodeFactor analysis scope and recording associated PM evidence.
Enhancements:
Build:
Chores:
Summary by cubic
Dedupes CLI and SDK primitives flagged by CodeFactor by single-sourcing unset field metadata, shared mutation option keys, and bulk filter contracts. Updates
.codefactor.ymlto ignore generated loaders/launchers and tests so reports focus on shipped code; no behavior changes.src/cli/commands/shared-unset-fields.tsand reused increate.ts/update.ts; replaced slice-based update ordering with named groups aroundclose-reason; keptauthorplacement for create.COMMON_MUTATION_COMMAND_OPTION_KEYSinsrc/core/item/type-registry.tsand reused across create/update; documented core↔CLI alignment boundary.TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACTS, reused by update-many and close-many..codefactor.ymldocs link and excludedpackages/**/runtime-loader.ts,plugins/**/scripts/pm-mcp-server.mjs, andtests/**from analysis.Written for commit 4acf9af. Summary will update on new commits.