Skip to content

Remove pervasive as any casts in projects page - #731

Merged
joryirving merged 1 commit into
mainfrom
foreman/wl-misospace-dispatch-620/issue-620
Aug 7, 2026
Merged

joryirving merged 1 commit into
mainfrom
foreman/wl-misospace-dispatch-620/issue-620

Conversation

@itsmiso-ai

Copy link
Copy Markdown
Contributor

What

Replaces all untyped any casts in src/app/projects/page.tsx with the properly typed Issue interface from @/types. Specifically: imports Issue, types filter/map callback parameters as Issue, and removes i as any and (statusIssues as any) casts.

Why

T…

Fixes #620

Opened by foreman on review GO (workload wl-misospace-dispatch-620).

@itsmiso-ai
itsmiso-ai requested a review from joryirving as a code owner August 6, 2026 08:58
its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch 2 times, most recently from 3e7bc6d to bbfdce2 Compare August 6, 2026 16:48
its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch 4 times, most recently from 4943e40 to fec09da Compare August 6, 2026 20:15
@itsmiso-ai itsmiso-ai added the needs-human Human input or decision is required. label Aug 6, 2026
@itsmiso-ai

Copy link
Copy Markdown
Contributor Author

⚠️ This PR fix item has been marked as BLOCKED and needs human attention.

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

its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch from e45c88a to 984abd1 Compare August 7, 2026 03:37
its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch from 984abd1 to a6fa404 Compare August 7, 2026 04:25
its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch from a6fa404 to 2a353fc Compare August 7, 2026 06:00
its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch from 2a353fc to 8419f60 Compare August 7, 2026 06:44
@its-saffron
its-saffron Bot dismissed their stale review August 7, 2026 06:47

Superseded by a newer automated review for this pull request.

its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch from 8419f60 to 45c2dd2 Compare August 7, 2026 07:53
its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch from 78c9938 to 2deb9f8 Compare August 7, 2026 09:58
its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch from 2deb9f8 to d8f26ec Compare August 7, 2026 10:27
its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch from d8f26ec to 6b85f8e Compare August 7, 2026 10:45
its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch from 6b85f8e to d487f2b Compare August 7, 2026 11:27
its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch from d487f2b to b07d371 Compare August 7, 2026 11:56
its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch from b07d371 to 64b80b8 Compare August 7, 2026 13:28
its-saffron[bot]

This comment was marked as outdated.

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>
@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-dispatch-620/issue-620 branch from 64b80b8 to a5102cb Compare August 7, 2026 14:30
@joryirving joryirving added ai-review Request an AI pull request review. and removed needs-human Human input or decision is required. labels Aug 7, 2026
its-saffron[bot]

This comment was marked as outdated.

@its-saffron
its-saffron Bot dismissed their stale review August 7, 2026 14:35

Superseded by a newer automated review for this pull request.

@its-saffron its-saffron Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. src/types/index.ts — Adds IssueWithRepo extends Omit<Issue, "repository"> { repository: Repository }. Structurally sound: Repository supplies the fullName/name fields required by groupIssuesByProject, and Omit<Issue, "repository"> avoids a conflicting duplicate key with the base Issue.repository partial shape ({ fullName: string }). The JSDoc accurately describes the projects page fetch with include: { repository: true }.

  2. src/app/projects/page.tsx — Adds a type-only import and annotates the filter/map callbacks as IssueWithRepo, replacing (i: any) => getProjectIssueStatus(i as any) === column.id and (statusIssues as any).map((issue: any) => ...). IssueWithRepo satisfies the { labels: string[]; state: string } parameter type of getProjectIssueStatus, so the as any casts are no longer needed. The file is now free of any casts (the remaining Record<string, unknown> in getProjects is unknown, not any).

  • CI verification: The Typecheck check succeeded on this exact commit. Under strict function typing, that also structurally validates that the Prisma payload from issue.findMany({ include: { repository: true } }) is assignable to IssueWithRepo — including the full Repository shape (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, groupIssuesByProject signatures)
  • 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 any references with a properly typed IssueWithRepo or comparable interface, verified by npx tsc --noEmit." — the PR introduces exactly IssueWithRepo (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.

Comment thread src/app/projects/page.tsx
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";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@its-saffron its-saffron Bot removed the ai-review Request an AI pull request review. label Aug 7, 2026
@joryirving
joryirving merged commit 629f19c into main Aug 7, 2026
8 checks passed
@joryirving
joryirving deleted the foreman/wl-misospace-dispatch-620/issue-620 branch August 7, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove pervasive as any casts in projects page

2 participants