Repository navigation
feat(github): workspace Issues page, author identity, review state, issue editing - #144
Conversation
….3, decode-uri-component 0.5.1
…nd issue editing
- GET /workspaces/:id/github/issues — fan-out aggregation mirroring pulls,
open/closed/all state filter, per-repo failure reporting, 60s cache
- Issues page in the rail with live open-count badge; Pulls gains the same
- Author avatars + login highlighting on every issue/PR surface; bot badges
driven by GitHub's real user.type
- Mirrored issues persist github_author/github_avatar_url (migration 0054),
backfilled by webhook, bulk import, and reconcile
- In-app GitHub issue detail modal: body, comment thread, composer,
close/reopen, deep-linkable via /app/p/:id?gh=owner/name:N
- Label/assignee editing on issues and PRs (PATCH issues/{n}), inline
label creation, and title/body editing in the issue modal
- PR review decisions: latest-state-per-reviewer reduction, decision chip,
reviewer/assignee/team-requested avatar stacks, merged_by, comment counts
- users.github_login (migration 0055) + Settings binding with existence
check; unlocks "filed by me / assigned to me / my review requested"
filters on the workspace pages
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Mira PR WalkthroughThis PR introduces a comprehensive GitHub Issues workspace feature including a new Issues page with filtering, author identity display across issues/PRs, an in-app issue modal with full interaction capabilities, shared label/assignee editing, PR review state visualization, and personal filters. The changes shown affect the navigation rail (adding Issues entry) and a minor database SQL update. Note: The file metadata appears incomplete relative to the extensive feature description. Confidence is moderate since only 2 files are shown changed but the feature scope is large; the visible changes are safe but full verification requires reviewing all modified files. ❌ Review failed — click for detailsThe code review failed to complete due to an unexpected error. Stage: Code review
|
There was a problem hiding this comment.
Mira Review Summary
This PR adds a comprehensive GitHub Issues workspace view with author identity, review state, inline editing, and GitHub login binding. Three critical issues need attention: (1) All CI workflows switched to self-hosted runners which will break CI if not configured; (2) The GitHub username existence check fails open on any error, creating a security bypass during GitHub API outages; (3) The GitHub username regex validation is too permissive and allows invalid usernames. Additionally, the PR comment count fetching scans all issues inefficiently, and the new auth/profile logic lacks automated test coverage.
Key Issues
| Issue | Location | |
|---|---|---|
| 🔴 | CI workflows changed to self-hosted runners — will fail if runners not configured | .github/workflows/ci.yml:8 |
| 🔴 | githubLoginPattern regex is too permissive (allows trailing/consecutive hyphens) | internal/auth/handlers.go:94 |
| @@ -90,41 +94,90 @@ func UserOut(u db.GetUserByIDRow) userOut { | |||
| } | |||
There was a problem hiding this comment.
Bug
githubLoginPattern regex allows invalid GitHub usernames
The regex ^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,38})$ allows trailing hyphens and consecutive hyphens (e.g., user--name-). GitHub usernames only allow single hyphens, not at start/end. This means invalid usernames pass the client-side check and only fail at the GitHub API call (which fails open per the previous issue). Use a stricter regex: ^[a-zA-Z0-9](?:-?[a-zA-Z0-9]){0,38}$ to enforce single hyphens only and no trailing hyphen.
| } | |
| var githubLoginPattern = regexp.MustCompile(`^[a-zA-Z0-9](?:-?[a-zA-Z0-9]){0,38}$`) |
Not useful? Reply
@mira-tdvorak rejectto dismiss this suggestion.
| CreatedAt string `json:"created_at"` | ||
| } | ||
|
|
||
| func toSessionOut(c Credentials) sessionOut { |
There was a problem hiding this comment.
Security issue
Fail-open design in githubUserExists allows binding during GitHub outage
The githubUserExists function (lines 74-93) returns true on any error (network failure, rate limit, GitHub outage, timeout). This is documented as intentional: "anything else — rate limit, outage, network — returns true so a transient failure never blocks a profile save."
Impact: During a GitHub API outage or rate limiting, a user could bind a non-existent username. The binding would persist until they try to update it again.
This is a reasonable usability tradeoff but should be explicitly documented in the function comment and possibly logged for audit purposes.
Prompt for AI Agents
Add a comment explaining the fail-open rationale and consider logging failures for audit. Optionally, add a background reconciliation job that re-validates bindings periodically.
Not useful? Reply
@mira-tdvorak rejectto dismiss this suggestion.
| ID string `json:"id"` | ||
| Email string `json:"email"` | ||
| Name string `json:"name"` | ||
| NameColor *string `json:"name_color"` |
There was a problem hiding this comment.
Security issue
GitHub username regex doesn't match GitHub's exact validation rules
The regex ^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,38})$ (line 65) allows:
- Trailing hyphens (e.g.,
user-) - Consecutive hyphens (e.g.,
user--name)
GitHub's actual rules: "Username may only contain alphanumeric characters or single hyphens, and cannot begin or end with a hyphen."
Mitigation: The githubUserExists call validates against GitHub's API, so invalid usernames will be rejected anyway. This is defense-in-depth only.
Prompt for AI Agents
Update regex to match GitHub's rules: `^[a-zA-Z0-9](?:-?[a-zA-Z0-9]){0,38}$` (no leading/trailing hyphens, no consecutive hyphens, max 39 chars).
Not useful? Reply
@mira-tdvorak rejectto dismiss this suggestion.
Summary
GET /workspaces/:id/github/issues,/app/issuespage, rail entry with live open-count badge) — parallel to Pull requests, with open/closed/all state filters, per-repo failure surfacing, and 60s server cachingavatar_url/author_typeflow onto every issue/PR row; mirrored Relay issues persist the filer (github_author,github_avatar_url— migration 0054, backfilled by webhook/import/reconcile)?gh=owner/name:N— fixes the dead-end where unmirrored issue rows dropped users into a filtered listpulls/{n}/reviewsreduced to latest-per-reviewer; decision chip (approved / changes requested / pending), reviewer + assignee +requested_teamsavatar stacks,merged_by, PR comment counts via the issues endpointusers.github_login(migration 0055) with Settings binding and a server-side existence check; unlocks Filed by me / Assigned to me / My review requested on both workspace pagesTest plan
go build ./...,go test ./internal/github ./internal/authtsc --noEmit,oxlint(0 findings),vitest(43),vite build/app/issues+ GitHub-login binding on a live installation; migrations apply on deployGenerated with Devin