Skip to content

feat(api): add defaultBranch, isFork, and isArchived to /api/repos response [SOU-514]#905

Merged
brendan-kellam merged 4 commits intomainfrom
brendan/list-repos-additional-fields
Feb 18, 2026
Merged

feat(api): add defaultBranch, isFork, and isArchived to /api/repos response [SOU-514]#905
brendan-kellam merged 4 commits intomainfrom
brendan/list-repos-additional-fields

Conversation

@brendan-kellam
Copy link
Contributor

@brendan-kellam brendan-kellam commented Feb 18, 2026

Summary

  • Added defaultBranch, isFork, and isArchived fields to the /api/repos endpoint response
  • Updated getRepos in actions.ts to include the new fields
  • Updated the MCP list_repos tool to expose the new fields

Test plan

  • Verify /api/repos response includes defaultBranch, isFork, and isArchived
  • Verify MCP list_repos tool output includes the new fields

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Repository listings now include three new metadata fields: default branch, fork status, and archive status for enhanced repository information visibility.
  • Refactor

    • Improved type consistency and data handling in repository endpoints.

…sponse

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

This comment has been minimized.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

Walkthrough

Three new fields—defaultBranch, isFork, and isArchived—are added to repository response schemas across both MCP and web packages. Changes include schema definitions, type assertions in API endpoints, and CHANGELOG documentation updates.

Changes

Cohort / File(s) Summary
Changelog Documentation
CHANGELOG.md, packages/mcp/CHANGELOG.md
Added entries documenting the three new repository fields in the public API responses and MCP list_repos tool.
MCP Package Schemas
packages/mcp/src/schemas.ts, packages/mcp/src/index.ts
Extended repositoryQuerySchema with three new fields (defaultBranch, isFork, isArchived) and updated the list_repos tool output to include these fields in the repository response.
Web Package Schema Definition
packages/web/src/lib/schemas.ts
Added three new fields to repositoryQuerySchema: defaultBranch (optional string), isFork (boolean), and isArchived (boolean).
Web Package API Endpoints
packages/web/src/actions.ts, packages/web/src/app/api/.../listReposApi.ts
Replaced runtime schema validation with direct object construction and type assertions (satisfies RepositoryQuery). Updated imports to use RepositoryQuery type instead of repositoryQuerySchema. Added the three new fields to returned repository objects sourced from underlying repo data.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • msukkari
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly describes the main change: adding three specific fields (defaultBranch, isFork, and isArchived) to the /api/repos endpoint response, which aligns with the changeset modifications across schemas, types, and API implementations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch brendan/list-repos-additional-fields

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

brendan-kellam and others added 3 commits February 18, 2026 15:07
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/mcp/src/schemas.ts`:
- Around line 159-160: The schema makes isFork and isArchived required which
breaks parsing responses from older servers; update the listReposResponseSchema
entries for isFork and isArchived (in packages/mcp/src/schemas.ts) to use
z.boolean().default(false) so missing keys gracefully default to false when
parsed by the MCP client (used by client.ts when calling list repos).

@brendan-kellam brendan-kellam merged commit 6823a6a into main Feb 18, 2026
12 checks passed
@brendan-kellam brendan-kellam deleted the brendan/list-repos-additional-fields branch February 18, 2026 23:28
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.

1 participant

Comments