jenkins-x / jx

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
https://jenkins-x.io/
Apache License 2.0
4.58k stars 788 forks source link

jx pipeline start ask for credentials even though they are supplied #8421

Open msvticket opened 2 years ago

msvticket commented 2 years ago

jx pipeline start asks for credentials even though they are supplied with GIT_USERNAME / GIT_TOKEN or --git-username / --git-token. It seems like it is git that asks for it during git clone.

If a git credential store with the crediental is set up this doesn't happen. So it's typically in a use case like mine it happens: Executing jx pipeline start in a cronjob.

This bug didn't exist in version 0.0.143. I think the regression appeared with jenkins-x-plugins/jx-pipeline#396, which would mean that it was introduced in 0.0.148.

The jx pipeline command is built from the repository https://github.com/jenkins-x-plugins/jx-pipeline/

KiranSatyaRaj commented 1 year ago

Hey @msvticket, can we discuss the technical aspect required to achieve a solution for this, I would love to work on this issue.

msvticket commented 1 year ago

Sure! I investigated a bit more now and changed the description accordingly.

msvticket commented 1 year ago

I can give a bit more details:

I think it's the argument to gitv2.NewClientFactory here that needs fixing.

It seems like James was on his way to avoid this regression when working on the PR I mention above.

In this commit he had a more fleshed out configureOpts. I suppose there was a reason he reverted that part, but it might be a start.

KiranSatyaRaj commented 1 year ago

Sure! I investigated a bit more now and changed the description accordingly.

Awesome, I'll work this out from here on, I'll get back to you if there's anything I'm stuck with, I'll make sure to notify you in your time zone, GMT right?

msvticket commented 1 year ago

Sound good

Almost. Stockholm time, so London+1h

KiranSatyaRaj commented 1 year ago

/assign

KiranSatyaRaj commented 1 year ago

Hey @msvticket, I didn't work with Git much and had less idea on how to deal with it, all these days I was learning Git and blogging it along the way, I'm back now and will start working on this issue, you've provided enough info to know more about the issue, thanks Maren

KiranSatyaRaj commented 1 year ago

the value for this var configureOpts, is to be configured here right? @msvticket

KiranSatyaRaj commented 1 year ago

Hey @msvticket, this works, the tests seem to pass as well, can you take a look? Screenshot from 2022-11-30 16-08-26

Screenshot from 2022-11-30 16-06-23

KiranSatyaRaj commented 1 year ago

hey @msvticket , can you please check this through?