Skip to content

MCP create_project in cluster mode produces a build configuration that cannot build (no build cloud, assumed git-provider registry) #695

Description

@Yuyz0112

Summary

We are driving Canine headlessly through its MCP server (which is great — far more complete than the REST v1 surface). In BOOT_MODE=cluster, projects created via the create_project MCP tool end up with a build configuration that cannot build:

  1. No build cloud attached. create_project only permits dockerfile_path / context_directory for the build configuration. In cluster mode the default driver is :k8s, but build_cloud_id is never set, so Projects::BuildJob hits K8::BuildCloudManager.new(..., project.build_configuration.build_cloud) with nil even when the target cluster has a build cloud installed.

  2. Wrong registry for enterprise git providers. BuildBuildConfiguration.default_build_configuration prefers the git provider's native registry when has_native_container_registry? — for GitLab that resolves to a hardcoded registry.gitlab.com (Provider#registry_base_url), which is wrong for self-hosted GitLab instances (and many of them run without a container registry at all). There is no way to select an existing container_registry provider from the MCP tool.

  3. image_repository defaults to project.repository_url (owner/repo), which assumes the registry namespace mirrors the git namespace — often not true for a private Harbor-style registry.

Suggested direction

Either expose build_cloud_id / build provider_id / image_repository as optional params on create_project, or make the defaults smarter in cluster mode: attach the target cluster's build cloud automatically and prefer an explicitly configured container_registry provider over the git provider's assumed registry.

We currently patch the defaults via an initializer (cluster's build cloud + last container_registry provider + an env-configurable image namespace). Happy to turn whichever direction you prefer into a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions