github-types.ts: GitHubIssue.repository field is declared but never populated by the search API
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 86/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- api
Research direction
Start by reading src/prompt-generators/github/github-types.ts and src/prompt-generators/github/github.ts, then confirm with a repository-wide search that GitHubRepository is unused and searchIssues calls only /search/issues. Remove the inaccurate unused repository types, or replace the field with repository_url as supported by the issue; done means the types match the endpoint and the project still type-checks.
Written by the indexing model from the issue text.
Description
Observed behavior
GitHubIssue in src/prompt-generators/github/github-types.ts declares an optional nested repository object:
export interface GitHubIssue {
// ...
readonly repository?: GitHubRepository;
readonly [key: string]: unknown;
}
export interface GitHubRepository {
readonly full_name: string;
readonly name?: string;
readonly owner?: GitHubUser;
readonly [key: string]: unknown;
}
But the only endpoint the client actually calls is GET /search/issues (see GitHub.searchIssues in src/prompt-generators/github/github.ts). GitHub's /search/issues response does not include a nested repository object on issue items. It includes repository_url (a string URL). So issue.repository is always undefined at runtime for this code path.
A Grep over the repo confirms GitHubRepository is declared but never consumed:
src/prompt-generators/github/github-types.ts:106: readonly repository?: GitHubRepository;
src/prompt-generators/github/github-types.ts:125:export interface GitHubRepository {
Expected behavior
Either:
- Remove the
repository?: GitHubRepositoryfield (and the unusedGitHubRepositoryinterface) fromgithub-types.tsso the type only documents fields the/search/issuesresponse actually returns; or - Replace it with the field that actually is returned,
repository_url?: string, matching what GitHub sends.
Minimal reproduction
Read src/prompt-generators/github/github-types.ts and src/prompt-generators/github/github.ts; only GET /search/issues is called; the search response does not contain a nested repository object. A code reader who sees the type will reasonably assume that, for example, issue.repository?.full_name is meaningful, but it is always undefined.
Suggested fix
Drop repository?: GitHubRepository from GitHubIssue and delete the GitHubRepository interface, since nothing reads either of them. If a future code path starts using a different endpoint (e.g. /issues or /repos/{owner}/{repo}/issues) that does return a repository object, re-introduce a more accurate type at that point.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from joewalker/loop-the-loop
-
bug S4
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
joewalker/loop-the-loop#88 ·
-
Git exec(): child killed by a signal rejects with new Error('') and loses the signal information Openbug S3
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
joewalker/loop-the-loop#84 ·
-
bug S3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
joewalker/loop-the-loop#83 ·
-
bug S3
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
joewalker/loop-the-loop#82 ·
-
bug S4
Difficulty 1/5 Under an hour Newbie friendliness 90/100
joewalker/loop-the-loop#79 ·
All issues in joewalker/loop-the-loop
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·