Open codecycletechnologies opened 3 years ago
Is there a GCP rest API available that exposes this flow?
@rileykarson, Please refer to below API detail
https://cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos/create https://cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos#Repo
Check mirrorConfig in request object.
That field is not actually available in the request object, unfortunately!
How this repository mirrors a repository managed by another service. Read-only field.
@rileykarson , Can you please verify the same in https://cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos/create?apix=true. In this, request body contains selection of mirrorConfig.
The "Request Body" section of the page links to the Repo type, which declares the field read-only. The API Explorer allows unspecifiable fields to be specified, unfortunately. If you're able to provision the resource (and the documentation is wrong) please let me know!
On Tue, May 18, 2021 at 9:22 PM Codecycle @.***> wrote:
@rileykarson https://github.com/rileykarson , Can you please verify the same in https://cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos/create?apix=true. In this, request body contains selection of mirrorConfig.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hashicorp/terraform-provider-google/issues/9155#issuecomment-843734421, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAP36CBTEJH55SAKEZAMFMTTOM4ITANCNFSM445SEVDQ .
@rileykarson Hey, we tried but not able to figure out how to solve this. Basically we want to link Github repository to Google cloud repository through terraform. And we think this feature should be there.
Just checked:
{
"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": "<PRIVATE>"
}
]
}
}
There's a feature request tracking allowing this functionality: https://issuetracker.google.com/issues/73122477
If you're interested in this use-case, please vote for it by clicking ⭐ button on the linked page.
It looks like until now there isn't any argument to manage external repositories on google_sourcerepo_repository.
Note: This was marked as Won't Fix by the service team, likely because Cloud Source Repositories itself is end-of-sale at the moment. We can leave it open to track interest, and the TF provider still supports the resource, but it seems unlikely to be resolved.
Community Note
Description
Hello,
Please provide support of adding external repository mirroring through google_sourcerepo_repository resource. https://cloud.google.com/source-repositories/docs/mirroring-a-github-repository
New or Affected Resource(s)
b/359684554