openshift-pipelines / pipelines-as-code

Pipelines-as-Code for Tekton
https://pipelinesascode.com
Apache License 2.0
136 stars 81 forks source link

how to configure existing repositories in a github org? #934

Open sm43 opened 2 years ago

sm43 commented 2 years ago

https://github.com/openshift-pipelines/pipelines-as-code/pull/890 with this pull req we allow user to enable auto configure new repos but how do we support configuring existing repos in the org.

few of the ways discussed in the comments https://github.com/openshift-pipelines/pipelines-as-code/pull/890#issuecomment-1284863422

we have 2 ways now...

if auto configure is enabled then list all repos which are attached to github app.. (I guess there should be some api) and then create repository Cr for it. or when we get event from that repo, and we don't find a any repository cr for it. we create one. (not secure but we will have to check where the event is coming from using some regex/org name)

and https://github.com/openshift-pipelines/pipelines-as-code/pull/890#issuecomment-1285036911

(about importing existing repo since this PR handles only newly created repos). maybe having a import flag in the CLI could solve this, it will : tkn pac import organisation org will go over every repos in the org organisation and create a namespace/repo using a template. this could be used as well for other git providers too,

sm43 commented 2 years ago

@chmouel whats the priority on this?

chmouel commented 2 years ago

maybe having this command letting do a batch import would be useful even for non auto creation,

mpreu commented 1 year ago

It would be nice from my perspective, if any form of batch import can be expressed in GitOps compatible form. This means, that repository CRs might be created on the filesystem as an alternative to just in-cluster. Especially since additional features on this CR like custom parameters seemed to be merged recently.