Implement label state and issue-label routes in the GitHub simulator#38
Merged
Conversation
Copilot
AI
changed the title
Implement GitHub labels domain support
Implement label state and issue-label routes in the GitHub simulator
May 30, 2026
Copilot created this pull request from a session on behalf of
pmcelhaney
May 30, 2026 20:48
View session
There was a problem hiding this comment.
Pull request overview
This PR implements stateful repository and issue label behavior in the GitHub API simulator, replacing random label route responses with context-backed state and seeded data.
Changes:
- Adds repository label storage and issue-label helpers in the repos context, with root-context forwarding.
- Implements label CRUD and issue-label route handlers with missing-resource handling.
- Seeds default labels and adds context, route, and scenario coverage for label behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
github/routes/repos/_.context.ts |
Adds label state, CRUD helpers, issue-label mutation, and label resolution. |
github/routes/_.context.ts |
Forwards label methods from root context to repos context. |
github/routes/repos/{owner}/{repo}/labels.ts |
Implements list/create repository label routes. |
github/routes/repos/{owner}/{repo}/labels/{name}.ts |
Implements get/update/delete repository label routes. |
github/routes/repos/{owner}/{repo}/issues/{issue_number}/labels.ts |
Implements list/add/replace/remove-all issue label routes. |
github/routes/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}.ts |
Implements remove-one-label-from-issue route. |
github/scenarios/index.ts |
Seeds default labels before issues. |
github/test/repos.context.test.ts |
Adds repos-context label behavior tests. |
github/test/routes.test.ts |
Adds route-level label lifecycle and 404 tests. |
github/test/scenarios.test.ts |
Verifies seeded labels in scenario tests. |
.github/todo/labels-v2.md |
Removes completed labels task description. |
Comment on lines
+1168
to
+1175
| const nextLabel: label = { | ||
| ...existing, | ||
| ...patch, | ||
| name: nextName, | ||
| url: `${API_URL}/repos/${owner}/${repo}/labels/${encodeURIComponent(nextName)}`, | ||
| description: patch.description ?? existing.description ?? "", | ||
| default: existing.default, | ||
| }; |
pmcelhaney
requested changes
May 31, 2026
Contributor
pmcelhaney
left a comment
There was a problem hiding this comment.
@copilot address the comments
Contributor
Author
Addressed in |
pmcelhaney
approved these changes
May 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The GitHub simulator was still returning random responses for repository and issue label endpoints, leaving the Issues surface incomplete for tooling that depends on label lifecycle behavior. This change adds stateful label support in the repo domain and wires the affected routes to that state.
Repo label state
routes/repos/_.context.tsadd,remove,replace,list)Route implementation
GET/POST /repos/{owner}/{repo}/labelsGET/PATCH/DELETE /repos/{owner}/{repo}/labels/{name}GET/POST/PUT/DELETE /repos/{owner}/{repo}/issues/{issue_number}/labelsDELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}Seed data
bug,enhancement,documentation,question) forcounterfact/platform-apienhancementto the existing open issue so seeded issue data exercises the new pathsCoverage