Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for using gitlab as a git provider. #434

Merged
merged 1 commit into from
Jan 23, 2020

Conversation

dibbles
Copy link
Member

@dibbles dibbles commented Jan 22, 2020

Changes

Adds the ability to use Gitlab as a provider.
Adds the ability to disable certificate verification.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide
for more details.

@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 22, 2020
@dibbles
Copy link
Member Author

dibbles commented Jan 22, 2020

/uncc @akihikokuroda

@tekton-robot tekton-robot removed the request for review from akihikokuroda January 22, 2020 10:15
@dibbles
Copy link
Member Author

dibbles commented Jan 22, 2020

/uncc @CarolynMabbott

@tekton-robot tekton-robot removed the request for review from CarolynMabbott January 22, 2020 10:15
@dibbles
Copy link
Member Author

dibbles commented Jan 22, 2020

@mnuttall @a-roberts

I have updated versions of buildah pipeline at https://github.com/dibbles/example-pipelines (I will need to deliver these at some point if everything is working) - let me know if you need gitlab pointers.

@a-roberts
Copy link
Member

I've been testing this on Duane's kindly provided GitLab, so far I've found all is working well on GHE in terms of hooks but the PR has both default and Tekton statuses.

For GitLab, all was well, I had auto-devops pipelines on. Duane deactivated them, I made a new project and a new PullRequest and now I have no status information for the PullRequest.

Will continue further testing with Duane and see where we get.

Images so far of progress:

image

image

image

@dibbles dibbles force-pushed the gitlab2 branch 3 times, most recently from f6b3682 to 4a2b7e8 Compare January 22, 2020 17:06
Copy link
Member

@a-roberts a-roberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this with @dibbles so only a few minor comments/questions left 😄 works perfectly

webhooks-extension/docs/Architecture.md Outdated Show resolved Hide resolved
webhooks-extension/docs/Limitations.md Outdated Show resolved Hide resolved
webhooks-extension/pkg/utils/utils.go Outdated Show resolved Hide resolved
webhooks-extension/pkg/endpoints/webhook.go Show resolved Hide resolved
@dibbles
Copy link
Member Author

dibbles commented Jan 23, 2020

/test tekton-experimental-unit-tests

@a-roberts
Copy link
Member

/lgtm
/approve

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 23, 2020
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-roberts

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 23, 2020
@tekton-robot tekton-robot merged commit 536718c into tektoncd:master Jan 23, 2020
@karimbzu
Copy link

karimbzu commented Feb 6, 2020

image
I am unable to add webhook using the guide: https://github.com/dibbles/example-pipelines
appreciate your response

@dibbles
Copy link
Member Author

dibbles commented Feb 6, 2020

@karimbzu from what I can tell you are not on a level of code that supports gitlab. I cannot see how you get the error you see given your project URL and the current master branch codebase.

What/How did you install the webhooks-extension?

@karimbzu
Copy link

karimbzu commented Feb 6, 2020

@dibbles Thanks for your response. Here are my steps to install webhook-extensions and tekton-dashboard

Tekton Dashboard

oc new-project tekton-pipelines || true

openshift_master_default_subdomain=$(oc get ingresses.config.openshift.io cluster --output=jsonpath={.spec.domain})

curl -s -L https://github.com/tektoncd/dashboard/releases/download/v0.4.1/openshift-tekton-webhooks-extension-release.yaml | sed "s/{openshift_master_default_subdomain}/${openshift_master_default_subdomain}/" | oc apply -f -
oc apply -f

https://github.com/tektoncd/dashboard/releases/download/v0.4.1/dashboard_latest_openshift-tekton-dashboard-release.yaml

Please correct me if i am wrong. Thanks

@dibbles
Copy link
Member Author

dibbles commented Feb 6, 2020

@karimbzu I do not believe there has been an official release of the webhooks-extension code with the gitlab support as yet - hopefully it will be either tomorrow or next week some time. Until then you would have to do a development install rather than a release install.

@karimbzu
Copy link

karimbzu commented Feb 6, 2020

Ok thank you for your information, I am trying to install the development version and will share it with you. please confirm is this the correct link for development version?:
https://github.com/tektoncd/experimental/blob/master/webhooks-extension/docs/InstallNightlyBuild.md
Thanks

@karimbzu
Copy link

karimbzu commented Feb 6, 2020

[root@bastion webhooks-extension]# oc apply -k overlays/openshift-latest
error: AccumulateTarget: couldn't find target rbac.authorization.k8s.io_v1_ClusterRole|tekton-pipelines|~P|tekton-webhooks-extension-minimal-cluster-powers|~S for json patch
facing the error, may be some policies need to be adjusted, can you suggest something ?

@a-roberts
Copy link
Member

[root@bastion webhooks-extension]# oc apply -k overlays/openshift-latest
error: AccumulateTarget: couldn't find target rbac.authorization.k8s.io_v1_ClusterRole|tekton-pipelines|~P|tekton-webhooks-extension-minimal-cluster-powers|~S for json patch
facing the error, may be some policies need to be adjusted, can you suggest something ?

Hey @karimbzu, @dibbles is right, I'm expecting to do a webhooks release imminently 😄

Happy to help over Slack (tektoncd.slack.com) for further details, or please raise issues if you think there's a particular problem you're seeing - in your particular case this works for me:

kustomize build overlays/openshift-development | ko apply -f -

Kustomize is version 3.5.4, ko is version 0.2.0

Directory structure I'm using is as follows

(base) adams-mbp:webhooks-extension aroberts$ ls overlays/
development             openshift-latest
latest                  openshift-release
openshift-all           plainkube-all
openshift-development   release

And I've run this well on OCP 4.2 or 4.3. Give this a try 😄

@karimbzu
Copy link

karimbzu commented Feb 6, 2020

Hi, @a-roberts really nice to see your response and solution. i am working with openshift 4.2.16 however, found some issues, can you please suggest some solution. Thanks once again

[root@bastion webhooks-extension]# ./kustomize build overlays/openshift-development | ko apply -f -
2020/02/06 11:05:55 No matching credentials were found, falling back on anonymous
serviceaccount/tekton-webhooks-extension unchanged
serviceaccount/tekton-webhooks-extension-eventlistener unchanged
role.rbac.authorization.k8s.io/tekton-webhooks-extension-minimal unchanged
clusterrole.rbac.authorization.k8s.io/tekton-triggers-minimal unchanged
clusterrole.rbac.authorization.k8s.io/tekton-webhooks-extension-minimal-cluster-powers unchanged
rolebinding.rbac.authorization.k8s.io/tekton-webhooks-extension-minimal unchanged
clusterrolebinding.rbac.authorization.k8s.io/tekton-webhooks-extension-eventlistener-minimal unchanged
clusterrolebinding.rbac.authorization.k8s.io/tekton-webhooks-extension-minimal-cluster-powers unchanged
service/tekton-webhooks-extension-validator unchanged
service/webhooks-extension unchanged
deployment.apps/tekton-webhooks-extension-validator unchanged
deployment.apps/webhooks-extension unchanged
task.tekton.dev/monitor-task configured
triggerbinding.tekton.dev/monitor-task-github-binding unchanged
triggerbinding.tekton.dev/monitor-task-gitlab-binding unchanged
triggertemplate.tekton.dev/monitor-task-template unchanged
[root@bastion webhooks-extension]# oc get pods
NAME READY STATUS RESTARTS AGE
tekton-webhooks-extension-validator-6464f884b8-6lm2m 0/1 ImagePullBackOff 0 19m
webhooks-extension-7d98d78b9f-q8xhw 0/1 ImagePullBackOff 0 19m

#oc describe tekton-webhooks-extension-validator-6464f884b8-6lm2m

Type Reason Age From Message


Normal Scheduled 21m default-scheduler Successfully assigned tekton-pipelines/tekton-webhooks-extension-validator-6464f884b8-6lm2m to infra2.ocp.tmrnd.net
Normal Pulling 20m (x4 over 21m) kubelet, infra2.ocp.tmrnd.net Pulling image "github.com/tektoncd/experimental/webhooks-extension/cmd/interceptor"
Warning Failed 20m (x4 over 21m) kubelet, infra2.ocp.tmrnd.net Failed to pull image "github.com/tektoncd/experimental/webhooks-extension/cmd/interceptor": rpc error: code = Unknown desc = Error reading manifest latest in github.com/tektoncd/experimental/webhooks-extension/cmd/interceptor: error parsing HTTP 404 response body: invalid character 'N' looking for beginning of value: "Not Found"
Warning Failed 20m (x4 over 21m) kubelet, infra2.ocp.tmrnd.net Error: ErrImagePull
Normal BackOff 6m34s (x63 over 21m) kubelet, infra2.ocp.tmrnd.net Back-off pulling image "github.com/tektoncd/experimental/webhooks-extension/cmd/interceptor"
Warning Failed 93s (x84 over 21m) kubelet, infra2.ocp.tmrnd.net Error: ImagePullBackOff

@a-roberts
Copy link
Member

a-roberts commented Feb 6, 2020

@karimbzu yeah,

[root@bastion webhooks-extension]# ./kustomize build overlays/openshift-development | ko apply -f -
2020/02/06 11:05:55 No matching credentials were found, falling back on anonymous

is the biggest clue, please take a look through DEVELOPMENT.md, my guess if you haven't done a docker login, make sure you also set KO_DOCKER_REPO too.

Essentially that ko step is going to build and push your image to your Dockerhub and replace the image coordinates (so instead of using github.com it'll use your own registry where your newly built image will sit)

@karimbzu
Copy link

karimbzu commented Feb 6, 2020

thanks once again, :( i am still struggling
image

@a-roberts
Copy link
Member

thanks once again, :( i am still struggling
image

https://github.com/tektoncd/dashboard/releases/tag/v0.5.0 pre-release done, give this a try please and for anything further I've found you on Slack in openshift-pipelines 😄

@karimbzu
Copy link

karimbzu commented Feb 7, 2020

@a-roberts @dibbles really thankful to you for your endless support, effort and time. i resolved all my issues regarding gitlab pipelines. Stay Blessed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants