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

Github Organisation name (case sensitivity ) will make promotions to staging fail ! #6408

Closed sepehr-lorestani closed 4 years ago

sepehr-lorestani commented 4 years ago

Summary

Github organisation PascalCase name will cause problem for promotion to staging.

Steps to reproduce the behavior

1- Create a github organisation in PascalCase. 2- GKE cluster 3- jx boot 4- jx create quickstart (golang-http in my case)

Expected behavior

Case sensitivity of organisation's name shouldn't make any problems to webhooks or promotion to staging, etc.

Actual behavior

when I did the jx boot with PascalCase organisation name, jx boot completed successfully and createed 3 environments ( dev, staging, production ) with 3 github repositories. I created a quickstart, and this was the build log for promote-step :

Showing logs for build <org>/golang-test-quick/master #2 release stage from-build-pack and container step-promote-jx-promote
WARNING: prow based install so skip waiting for the merge of Pull Requests to go green as currently there is an issue with gettingstatuses from the PR, see https://github.com/jenkins-x/jx/issues/2410
WARNING: No $CHART_REPOSITORY defined so using the default value of: http://jenkins-x-chartmuseum:8080
Promoting app golang-test-quick version 0.0.2 to namespace jx-staging
Created Pull Request: https://github.com/<orgname>/environment-<clustername>-staging/pull/2
Added label updatebot to Pull Request https://github.com/<orgname>/environment-<clustername>-staging/pull/2
WARNING: Failed to query the Pull Request last commit status for https://github.com/<orgname>/environment-<clustername>-staging/pull/2 ref e61867d0348921e77824af4eb8600d56489087f8 Could not find a status for repository <orgname>/environment-<clustername>-staging with ref e61867d0348921e77824af4eb8600d56489087f8
WARNING: Failed to query the Pull Request last commit status for https://github.com/<orgname>/environment-<clustername>-staging/pull/2 ref e61867d0348921e77824af4eb8600d56489087f8 Could not find a status for repository <orgname>/environment-<clustername>-staging with ref e61867d0348921e77824af4eb8600d56489087f8
Pull Request https://github.com/<orgname>/environment-<clustername>-staging/pull/2 is merged at sha 9358f653048ed34e50fc35cca71adb937d5b8559
Pull Request merged but we are not waiting for the update pipeline to complete!
WARNING: Could not find the service URL in namespace jx-staging for names golang-test-quick, jx-golang-test-quick, jx-staging-golang-test-quick

jx get applications output Empty !

Then I deleted the staging and production env and recreated it as James Strachan suggested as a fix for webhooks problems in one other issue, it fixed the problem, what I noticed during recreation of envs was the PascalCase organisation name during recreation.

so I deleted everything, changed the name of organisation to all lowercase and there was no problem anymore. logs for quickstart promote-step:

Showing logs for build <orgname>/golang-quick/master #1 stage from-build-pack and container step-promote-jx-promote
WARNING: prow based install so skip waiting for the merge of Pull Requests to go green as currently there is an issue with gettingstatuses from the PR, see https://github.com/jenkins-x/jx/issues/2410
WARNING: No $CHART_REPOSITORY defined so using the default value of: http://jenkins-x-chartmuseum:8080
Promoting app golang-quick version 0.0.1 to namespace jx-staging
Created Pull Request: https://github.com/<orgname>/environment-<clustername>-staging/pull/1
Added label updatebot to Pull Requesthttps://github.com/<orgname>/environment-<clustername>-staging/pull/1
got git provider status pending from PR https://github.com/<orgname>/environment-<clustername>-staging/pull/1
got git provider status pending from PR https://github.com/<orgname>/environment-<clustername>-staging/pull/1
got git provider status pending from PR https://github.com/<orgname>/environment-<clustername>-staging/pull/1
Pull Request https://github.com/<orgname>/environment-<clustername>-staging/pull/1 is merged at sha 3eb8b3090d453646d010f38c4d48ade6af7e5c70
Pull Request merged but we are not waiting for the update pipeline to complete!
WARNING: Could not find the service URL in namespace jx-staging for names golang-quick, jx-golang-quick, jx-staging-golang-quick

and the jx get applications had results finally.

Jx version

The output of jx version is:

NAME               VERSION
jx                 2.0.1094
Kubernetes cluster v1.15.4-gke.22
kubectl            v1.16.3
helm client        Client: v2.16.1+gbbdfe5e
git                2.24.1
Operating System   Mac OS X 10.13.6

Jenkins type

Kubernetes cluster

GKE provisioned with Terraform.

Operating system / Environment

Operating System Mac OS X 10.13.6

abayer commented 4 years ago

Duplicate of #5914