-
Bug
-
Resolution: Done
-
Major
-
4.11.0
-
Important
-
None
-
Rejected
-
False
-
-
-
Bug Fix
-
Done
-
Release Notes
Description of problem:
When adding a "Git Repository" (a tekton or pipelines Repository) and enter a GitLab or Bitbucket PAC repository the created Repository resource is invalid.
Version-Release number of selected component (if applicable):
411-4.13
How reproducible:
Always
Steps to Reproduce:
Setup a PAC git repo, you can mirror these projects if you want: https://github.com/jerolimov/nodeinfo-pac
For GitHub you need setup
- an account-global "private access token" > a classic access token, see https://github.com/settings/tokens
- a repo > webhook
For GitLab:
- a repo > Project Access Tokens
- a repo > webhook
For Bitbucket:
- an account-global "app password, see https://bitbucket.org/account/settings/app-passwords/
- a repo > webhook
On a cluster bot instance:
- Install OpenShift Pipelines operator
- Navigate to Developer perspective > Pipelines
- Select Create > Repository
- Enter a GitLab based git repository with Git access token and Webhook secret
- Enter a Bitbucket based git repository with Git access token (webhook secret isn't supported)
Actual results:
The GitLab created resource looks like this:
apiVersion: pipelinesascode.tekton.dev/v1alpha1
kind: Repository
metadata:
name: gitlab-nodeinfo-pac
spec:
git_provider:
secret:
key: provider.token
name: gitlab-nodeinfo-pac-token-gfr66
url: gitlab.com # missing schema
webhook_secret:
key: webhook.secret
name: gitlab-nodeinfo-pac-token-gfr66
url: 'https://gitlab.com/jerolimov/nodeinfo-pac'
The Bitbucket resource looks like this:
apiVersion: pipelinesascode.tekton.dev/v1alpha1
kind: Repository
metadata:
name: bitbucket-nodeinfo-pac
spec:
git_provider:
secret:
key: provider.token
name: bitbucket-nodeinfo-pac-token-9pf75
url: bitbucket.org # missing schema and invalid API URL !
webhook_secret: # don't entered a webhook URL, see OCPBUGS-7035
key: webhook.secret
name: bitbucket-nodeinfo-pac-token-9pf75
url: 'https://bitbucket.org/jerolimov/nodeinfo-pac'
The pipeline-as-code controller Pod log contains some error messages and no PipelineRun is created.
Expected results:
For GitLab:
- The spec.git_provider.url should contain the schema https://, so it should be https://gitlab.com, or can be removed completely. Both work fine.
A working example:
apiVersion: pipelinesascode.tekton.dev/v1alpha1 kind: Repository metadata: name: gitlab-nodeinfo-pac spec: git_provider: secret: key: provider.token name: gitlab-nodeinfo-pac-token-gfr66 url: https://gitlab.com webhook_secret: key: webhook.secret name: gitlab-nodeinfo-pac-token-gfr66 url: 'https://gitlab.com/jerolimov/nodeinfo-pac'
Bitbucket:
- The spec.git_provider.url should be https://api.bitbucket.org/2.0, or can be removed completely. Both work fine.
- The Account Secret needs also a Bitbucket login name, passed as spec.git_provider.user.
A working example:
apiVersion: pipelinesascode.tekton.dev/v1alpha1
kind: Repository
metadata:
name: bitbucket-nodeinfo-pac
spec:
git_provider:
user: jerolimov
secret:
key: provider.token
name: bitbucket-nodeinfo-pac-token-9pf75
webhook_secret:
key: webhook.secret
name: bitbucket-nodeinfo-pac-token-9pf75
url: 'https://bitbucket.org/jerolimov/nodeinfo-pac'
A PipelineRun should be created for each push to the git repo.
Additional info:
- Bitbucket use a small 2nd b.
- For the Bitbucket issue see also https://github.com/openshift-pipelines/pipelines-as-code/issues/416
- clones
-
OCPBUGS-7036 Add Git Repository (PAC) doesn't setup GitLab and Bitbucket configuration correct
- Closed
- is blocked by
-
OCPBUGS-7036 Add Git Repository (PAC) doesn't setup GitLab and Bitbucket configuration correct
- Closed
- links to