Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-7036

Add Git Repository (PAC) doesn't setup GitLab and Bitbucket configuration correct

XMLWordPrintable

    • Important
    • None
    • ODC Sprint 232, ODC Sprint 236
    • 2
    • Rejected
    • False
    • Hide

      None

      Show
      None
    • Hide
      1. Removed spec.git_provider.url value for GitLab and BitBucket providers and added spec.git_provider.user details for BitBucket provider.
      2. Username input field is added if the provider is BitBucket
      3.Git access token/Git access token secret is made mandatory. User needs to select either one of two
      Show
      1. Removed spec.git_provider.url value for GitLab and BitBucket providers and added spec.git_provider.user details for BitBucket provider. 2. Username input field is added if the provider is BitBucket 3.Git access token/Git access token secret is made mandatory. User needs to select either one of two
    • Known Issue

      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

      1. an account-global "private access token" > a classic access token, see https://github.com/settings/tokens
      2. a repo > webhook

      For GitLab:

      1. a repo > Project Access Tokens
      2. a repo > webhook

      For Bitbucket:

      1. an account-global "app password, see https://bitbucket.org/account/settings/app-passwords/
      2. a repo > webhook

      On a cluster bot instance:

      1. Install OpenShift Pipelines operator
      2. Navigate to Developer perspective > Pipelines
      3. Select Create > Repository
      4. Enter a GitLab based git repository with Git access token and Webhook secret
      5. 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:

      1. 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:

      1. The spec.git_provider.url should be https://api.bitbucket.org/2.0, or can be removed completely. Both work fine.
      2. 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:

      1. Bitbucket use a small 2nd b.
      2. For the Bitbucket issue see also https://github.com/openshift-pipelines/pipelines-as-code/issues/416

              rh-ee-lprabhu Lokananda Prabhu
              cjerolim Christoph Jerolimov
              Sanket Pathak Sanket Pathak
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: