Skip to content

Conversation

dmartinol
Copy link
Collaborator

Fixes: #1924

@coveralls
Copy link
Collaborator

coveralls commented Sep 17, 2025

Coverage Status

Changes unknown
when pulling fb6083e on dmartinol:registry_githandler
into ** on stacklok:main**.

Copy link

codecov bot commented Sep 17, 2025

Codecov Report

❌ Patch coverage is 72.32472% with 75 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.38%. Comparing base (8f1a7e9) to head (7178bf0).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/thv-operator/pkg/git/client.go 65.55% 21 Missing and 10 partials ⚠️
cmd/thv-operator/pkg/sources/git.go 81.81% 22 Missing and 8 partials ⚠️
...thv-operator/api/v1alpha1/zz_generated.deepcopy.go 0.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1925      +/-   ##
==========================================
+ Coverage   47.11%   47.38%   +0.26%     
==========================================
  Files         231      233       +2     
  Lines       28378    28649     +271     
==========================================
+ Hits        13369    13574     +205     
- Misses      14011    14061      +50     
- Partials      998     1014      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dmartinol dmartinol requested a review from Copilot September 17, 2025 16:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces Git repository support for MCPRegistry sources, allowing registry data to be fetched directly from Git repositories instead of just ConfigMaps. This expands the flexibility of the registry system by enabling declarative management of MCP server registries through Git.

Key changes:

  • Added Git source handler with support for branch, tag, and commit-based checkouts
  • Implemented comprehensive Git client using go-git library
  • Extended MCPRegistry CRD with Git source configuration

Reviewed Changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
go.mod Adds go-git dependency and related Git operation libraries
cmd/thv-operator/api/v1alpha1/mcpregistry_types.go Extends MCPRegistry CRD with GitSource type and validation
cmd/thv-operator/pkg/sources/git.go Implements Git source handler for fetching registry data from repositories
cmd/thv-operator/pkg/git/client.go Core Git client implementation with clone, checkout, and file operations
deploy/charts/operator-crds/templates/toolhive.stacklok.dev_mcpregistries.yaml Updates CRD schema to include Git source configuration
examples/operator/mcp-registries/*.yaml Provides example configurations for Git-based registry sources

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

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

Mostly looks good, some questions about performance, most can be deferred but should be at least tracked.

dmartinol and others added 4 commits September 19, 2025 09:31
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
dmartinol and others added 5 commits September 19, 2025 09:32
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
…mance.

- Add logging for clone duration and repository metrics

Signed-off-by: Daniele Martinoli dmartino@redhat.com
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
@jhrozek
Copy link
Contributor

jhrozek commented Sep 19, 2025

Looks good once we fix the lint issues!

Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
@dmartinol dmartinol enabled auto-merge (squash) September 19, 2025 13:36
@dmartinol dmartinol merged commit 7002a23 into stacklok:main Sep 19, 2025
28 checks passed
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.

[Kubernetes MCPRegistry] Git Source Handler (no auth)
3 participants