stealthybox / container-builder-github-ci-status

Google Cloud Function responds to PubSub events on the cloud-builds topic to update GitHub CI status.
MIT License
23 stars 4 forks source link

Option for repo name as GH name #3

Closed max-sixty closed 1 year ago

max-sixty commented 6 years ago

Would it be helpful to have an option here that the repo is named the same in GH as GSR? It could check this format if it can't find the existing template.

TBC, the current code doesn't offer that an option (it's only the way we need it for our work), but happy to add that if helpful

stealthybox commented 6 years ago

A good way to address this problem would be to parse the remote URL instead repoName. It would be ideal if this was provided in the build object under repoSource, but it's not.

I believe we could resolve the remote URL using the Cloud Source Repository API.

Could you tell me more about how you're setting up your mirrors? I'm using the GitHub Google Cloud OAuth App to mirror repos through the UI when creating build triggers.

When you do gcloud source repos list --format json do you have a mirrorConfig?

❯ gcloud source repos list --format json
[
  {
    "mirrorConfig": {
      "deployKeyId": "27991111",
      "url": "ssh://git@github.com/org/api.git",
      "webhookId": "24890000"
    },
    "name": "projects/gke-project/repos/github-org-api",
    "url": "https://source.developers.google.com/p/gke-project/r/github-org-api"
  }
]
max-sixty commented 6 years ago

We have the same name in GSR as GH.

Here's one of the mirror configs:

    "mirrorConfig": {
      "deployKeyId": "#",
      "url": "ssh://git@github.com/SixtyCapital/sixty.git",
      "webhookId": "#"
    },
    "name": "projects/sixty-capital/repos/sixty",
    "url": "https://source.developers.google.com/p/sixty-capital/r/sixty"
  }