Repository navigation
Remove pervasive as any casts in projects page - #731
Conversation
3e7bc6d to
bbfdce2
Compare
4943e40 to
fec09da
Compare
Reason: Review comment on src/app/projects/page.tsx:4 Latest note: foreman fix Workload prfix-misospace-dispatch-731 succeeded but PR is still not mergeable after 3/3 attempts Posted automatically by Dispatch on 2026-08-06T20:30:07.014Z |
e45c88a to
984abd1
Compare
984abd1 to
a6fa404
Compare
a6fa404 to
2a353fc
Compare
2a353fc to
8419f60
Compare
Superseded by a newer automated review for this pull request.
8419f60 to
45c2dd2
Compare
78c9938 to
2deb9f8
Compare
2deb9f8 to
d8f26ec
Compare
d8f26ec to
6b85f8e
Compare
6b85f8e to
d487f2b
Compare
d487f2b to
b07d371
Compare
b07d371 to
64b80b8
Compare
Replace untyped `any` casts in src/app/projects/page.tsx with the new
IssueWithRepo interface. The IssueWithRepo type extends Issue with a full
Repository relation (including `name` required by groupIssuesByProject),
matching the actual Prisma return shape when issues are fetched with
`include: { repository: true }`.
- Add IssueWithRepo interface to src/types/index.ts using Omit<Issue,
"repository"> + Repository
- Import IssueWithRepo in projects page and type filter/map callbacks
- Remove unused STATUS_LABELS import from constants
Fixes #620
Signed-off-by: Saffron <263493777+itsmiso-ai@users.noreply.github.com>
64b80b8 to
a5102cb
Compare
Superseded by a newer automated review for this pull request.
There was a problem hiding this comment.
AI Automated Review
Full PR review.
Analysis engine: dsv4f@https://litellm.jory.dev/v1 (openai) — primary route
Recommendation: Approve
This is a small, focused type-safety cleanup that directly matches its linked issue (PR 620). Both any casts in src/app/projects/page.tsx are removed in favor of a new IssueWithRepo type, and all CI checks (Build, Typecheck, Lint, Tests, Docker Build, npm audit) are green on head commit a5102cb. No behavioral change.
Change-by-change findings
-
src/types/index.ts— AddsIssueWithRepo extends Omit<Issue, "repository"> { repository: Repository }. Structurally sound:Repositorysupplies thefullName/namefields required bygroupIssuesByProject, andOmit<Issue, "repository">avoids a conflicting duplicate key with the baseIssue.repositorypartial shape ({ fullName: string }). The JSDoc accurately describes the projects page fetch withinclude: { repository: true }. -
src/app/projects/page.tsx— Adds a type-only import and annotates the filter/map callbacks asIssueWithRepo, replacing(i: any) => getProjectIssueStatus(i as any) === column.idand(statusIssues as any).map((issue: any) => ...).IssueWithReposatisfies the{ labels: string[]; state: string }parameter type ofgetProjectIssueStatus, so theas anycasts are no longer needed. The file is now free ofanycasts (the remainingRecord<string, unknown>ingetProjectsisunknown, notany).
- CI verification: The
Typecheckcheck succeeded on this exact commit. Under strict function typing, that also structurally validates that the Prisma payload fromissue.findMany({ include: { repository: true } })is assignable toIssueWithRepo— including the fullRepositoryshape (id,name,owner,fullName,enabled).
Sources
src/app/projects/page.tsx(full file read)src/types/index.ts(full file read)src/lib/projects.ts(getProjectIssueStatus,groupIssuesByProjectsignatures)- CI status for commit
a5102cb(Docker Build, Build, Typecheck, Lint, Tests, npm audit, review — all success) - GitHub issue PR 620 body (acceptance criteria)
Standards Compliance
- AGENTS.md requires lint/typecheck to pass and blocks CI on them — both are green here.
- The new type is imported with
import type, matching the convention that types with no runtime existence are type-only imports. - No schema, migration, environment-variable, or secret-related changes; the change is UI/type-only, so the Prisma and environment conventions in AGENTS.md are unaffected.
- Label/status helpers (
BOARD_COLUMNS,STATUS_LABELS,getProjectIssueStatus) are reused as-is; no duplicated or hardcoded label logic was introduced.
Linked Issue Fit
Issue PR 620 ("Remove pervasive as any casts in projects page"):
- Problem statement: the issue cites
(i: any) => getProjectIssueStatus(i as any)and(statusIssues as any).map((issue: any) => ...)— both cited casts are removed by this diff. - Acceptance criteria: "Replace all
anyreferences with a properly typedIssueWithRepoor comparable interface, verified bynpx tsc --noEmit." — the PR introduces exactlyIssueWithRepo(the issue-suggested name), applies it to both call sites, and the repository's Typecheck CI step passes on the head commit. - The issue is labeled
status/in-review, consistent with this PR being reviewable; no acceptance criterion is missing or misinterpreted.
Note (non-blocking): the PR description says it imports Issue and types the callbacks as Issue, but the diff actually introduces and uses IssueWithRepo. The code is aligned with the issue's acceptance criteria; only the PR body text is stale.
| import { Badge } from "@/components/ui/badge"; | ||
| import { BOARD_COLUMNS, STATUS_LABELS } from "@/types"; | ||
| import type { IssueWithRepo } from "@/types"; | ||
| import { applyRenovateIssueExclusion, buildVisibleIssueWhere } from "@/lib/issue-filters"; |
There was a problem hiding this comment.
Info (docs): PR description states the change imports and uses Issue, but the diff actually introduces and uses IssueWithRepo; the code matches issue PR 620's acceptance criteria, so only the PR body text is stale.
Automated finding from AI PR review.
What
Replaces all untyped
anycasts insrc/app/projects/page.tsxwith the properly typedIssueinterface from@/types. Specifically: importsIssue, types filter/map callback parameters asIssue, and removesi as anyand(statusIssues as any)casts.Why
T…
Fixes #620
Opened by foreman on review GO (workload wl-misospace-dispatch-620).