refactor: more enhance functionality #6
Conversation
- Add server/src/types/express.d.ts with Express module augmentation for actor property - Fix nullable type mismatches in issues.ts, access.ts, and plugins.ts routes - Enables successful Docker build
- Added missing hermesExecuteMock in adapter-registry.test.ts - Mapped 'taskcore' GitHub owner to 'khulnasoft' in CLI and updated tests - Renamed @pap to @task in MarkdownEditor.test.tsx - Stabilized skill matching in feedback-service.test.ts - Forced javascript backup engine in worktree.ts to ensure portability - Increased test and hook timeouts in several slow server tests - Disabled slow permission checks in opencode-local-adapter-environment.test.ts
Reviewer's GuideRefines request actor typing and usage, updates GitHub import owner normalization, tightens plugin/company handling, adjusts test timeouts and expectations, and removes CODEOWNERS. Class diagram for updated Express Request actor typing and usageclassDiagram
class ExpressRequest {
+RequestActor actor
}
class RequestActor {
+string type
+string source
+string userId
+string userName
+string userEmail
+string companyId
+string companyIds
+Membership memberships
+bool isInstanceAdmin
+string keyId
+string runId
+string agentId
}
class Membership {
+string companyId
+string membershipRole
+string status
}
class IssueRoutes {
+handleListIssues(ExpressRequest req)
}
class AccessRoutes {
+revokeCurrentBoardApiKey(ExpressRequest req)
}
class PluginRoutes {
+getAccessibleCompanyIds(ExpressRequest req)
}
ExpressRequest --> RequestActor : actor
RequestActor "*" --> Membership : memberships
IssueRoutes --> ExpressRequest : reads actor
AccessRoutes --> ExpressRequest : reads actor
PluginRoutes --> ExpressRequest : reads actor
Flow diagram for normalizeGithubImportSource owner normalizationflowchart TD
A[Input source string] --> B[Trim input]
B --> C{Is GitHub shorthand?}
C -- Yes --> D[Split owner and repo]
D --> E{owner equals taskcore?}
E -- Yes --> F[Set owner to khulnasoft]
E -- No --> G[Keep original owner]
F --> H[Build GitHub URL]
G --> H[Build GitHub URL]
C -- No --> I{Is valid GitHub URL?}
I -- No --> J[Throw Invalid GitHub URL error]
I -- Yes --> K[Parse URL path parts]
K --> L{First path part equals taskcore?}
L -- Yes --> M[Set owner to khulnasoft]
L -- No --> N[Set owner to first path part]
M --> O[Build normalized URL with owner]
N --> O[Build normalized URL with owner]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (18)
WalkthroughThis pull request consolidates multiple improvements across infrastructure, type safety, and testing. It removes repository ownership mappings, remaps GitHub organization references from "taskcore" to "khulnasoft," adds TypeScript type augmentation for Express request actors, normalizes route parameter handling, increases test timeouts for reliability, and updates test assertions to match refactored code. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ 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 |
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The hardcoded owner remapping from "taskcore" to "khulnasoft" in
normalizeGithubImportSourceappears in two places; consider centralizing this mapping in a small helper or config constant to avoid duplication and make future changes easier. - In
adapter-registry.test.ts,hermesExecuteMockis declared but never used; consider removing it or wiring it into the relevant tests to keep the test setup minimal and reduce noise.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The hardcoded owner remapping from "taskcore" to "khulnasoft" in `normalizeGithubImportSource` appears in two places; consider centralizing this mapping in a small helper or config constant to avoid duplication and make future changes easier.
- In `adapter-registry.test.ts`, `hermesExecuteMock` is declared but never used; consider removing it or wiring it into the relevant tests to keep the test setup minimal and reduce noise.
## Individual Comments
### Comment 1
<location path="server/src/__tests__/agent-adapter-validation-routes.test.ts" line_range="5" />
<code_context>
import { beforeEach, describe, expect, it, vi } from "vitest";
+
+vi.setConfig({ testTimeout: 30_000 });
import { models as codexFallbackModels } from "@taskcore/adapter-codex-local";
import { models as cursorFallbackModels } from "@taskcore/adapter-cursor-local";
</code_context>
<issue_to_address>
**suggestion (testing):** Consider centralizing per-file testTimeout configuration
Multiple files in this PR call `vi.setConfig({ testTimeout: 30_000 })` directly. To keep timeouts consistent and easier to maintain, consider moving this to a shared Vitest config or setup file. If this suite truly requires a different timeout, please add a brief comment explaining why 30s is needed.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| import request from "supertest"; | ||
| import { beforeEach, afterEach, describe, expect, it, vi } from "vitest"; | ||
|
|
||
| vi.setConfig({ testTimeout: 30_000 }); |
There was a problem hiding this comment.
suggestion (testing): Consider centralizing per-file testTimeout configuration
Multiple files in this PR call vi.setConfig({ testTimeout: 30_000 }) directly. To keep timeouts consistent and easier to maintain, consider moving this to a shared Vitest config or setup file. If this suite truly requires a different timeout, please add a brief comment explaining why 30s is needed.
Thinking Path
What Changed
Verification
Risks
Model Used
Checklist
Summary by Sourcery
Refine request actor handling, GitHub import mapping, and plugin/company access behavior while tightening test reliability and type safety.
Bug Fixes:
Enhancements:
Tests:
Summary by CodeRabbit
Bug Fixes
Tests