jenkins-x-plugins/jx-promote

Use of a previous github bot by the command, resulting in an error to fetch the boot repository

Closed this issue · 6 comments

When trying jx promote inside a project repository, the command fails with the following error:

➜ jx promote
? Are you sure you want to promote the application named: quickstart-node-http? Yes
about to run: git clone https://<old-github-bot-username>:<old-token>@github.com/<my-org>/jx3-azure-terraform.git /var/folders/m4/ytp3wjnn1hlbrxt27d64jc3c0000gn/T/jx-git-440220957 in dir /var/folders/m4/ytp3wjnn1hlbrxt27d64jc3c0000gn/T
Cloning into '/var/folders/m4/ytp3wjnn1hlbrxt27d64jc3c0000gn/T/jx-git-440220957'...
remote: Repository not found.
fatal: repository 'https://github.com/<my-org>/jx3-azure-terraform.git/' not found
error: failed to lazy load the EnvironmentContext: failed to clone URL https://<old-github-bot-username>:<old-token>@github.com/<my-org>/jx3-azure-terraform.git: failed to clone repository https://<old-github-bot-username>:<old-token>@github.com/<my-org>/jx3-azure-terraform.git to directory: /var/folders/m4/ytp3wjnn1hlbrxt27d64jc3c0000gn/T/jx-git-440220957: failed to run 'git clone https://<old-github-bot-username>:<old-token>@github.com/<my-org>/jx3-azure-terraform.git /var/folders/m4/ytp3wjnn1hlbrxt27d64jc3c0000gn/T/jx-git-440220957' command in directory '/var/folders/m4/ytp3wjnn1hlbrxt27d64jc3c0000gn/T', output: 'Cloning into '/var/folders/m4/ytp3wjnn1hlbrxt27d64jc3c0000gn/T/jx-git-440220957'...
remote: Repository not found.
fatal: repository 'https://github.com/<my-org>/jx3-azure-terraform.git/' not found'

The command is using the github username and token of a previously used bot for jx2, whereas I used a new github bot for the new jx3 installation I've made, and where the current project is integrated.

The old bot doesn't have acces to the jx3 repository, nor this project repository.

It should use the new github username and token I've specified with jx admin operator
 

jx version : 3.0.338

jx upgrade plugins :

checking binary jx plugin project version 0.0.99 is installed

Not complety sure it's related, but now when I'm executing jx project quickstart (for example), the github bot and token used is also the old one, whereas before executing jx promote it was the (correct) new one.

I noticed this when I saw the possible owners proposed for the repository of this new quickstart.

Related Slack thread, with discussions about "jx admin operator", $HOME/git/crentials file as source by default for the "jx promote" and "jx project" commands, and saving of git arguments in git credentials or not: https://kubernetes.slack.com/archives/C9MBGQJRH/p1600847399007500

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Provide feedback via https://jenkins-x.io/community.
/lifecycle stale

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Provide feedback via https://jenkins-x.io/community.
/lifecycle rotten

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Provide feedback via https://jenkins-x.io/community.
/close

@jenkins-x-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Provide feedback via https://jenkins-x.io/community.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the jenkins-x/lighthouse repository.