Mirror a GitHub repository using the source-repositories API directly

467 views Asked by At

The cloud console provides an interface for mirroring a repository from GitHub.

When you use this feature it creates a mirrorConfig on the repository which can be read from the API. The API itself however does not seem to provide a way to write to this config.

Example when trying to make a repository with a mirrorConfig

{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "repo.mirror_config",
            "description": "mirror_config is a read-only field and must not be set"
          }
        ]
      },
      {
        "@type": "type.googleapis.com/google.rpc.RequestInfo",
        "requestId": "*****"
      }
    ]
  }
}

Is there a way to programmatically create mirrored source repositories in Google Cloud Platform?

1

There are 1 answers

0
Pandelis On BEST ANSWER

No.

Is the answer :(

Source: George's comment above (Google Cloud Platform Support team)