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

More reliably determine CI Provider #1990

Closed
jennifer-shehane opened this issue Jun 19, 2018 · 4 comments
Closed

More reliably determine CI Provider #1990

jennifer-shehane opened this issue Jun 19, 2018 · 4 comments
Assignees
Labels
good first issue Good for newcomers pkg/server This is due to an issue in the packages/server directory type: enhancement Requested enhancement of existing feature
Milestone

Comments

@jennifer-shehane
Copy link
Member

Current behavior:

Some CI Providers show up as "unknown" with a suspected large amount of Jenkins CI runs going reported as "unknown"

Desired behavior:

@RandallKent mentioned this package may be helpful in determining the CI provider.

Update the current code to use package instead of env keys.

Link to current code: https://github.com/cypress-io/cypress/blob/issue-1942/packages/server/lib/util/ci_provider.coffee#L12

Versions

Cypress 3.0.1

@jennifer-shehane jennifer-shehane added type: enhancement Requested enhancement of existing feature pkg/server This is due to an issue in the packages/server directory good first issue Good for newcomers labels Jun 19, 2018
@brian-mann
Copy link
Member

That package won't help with jenkins. It's more restrictive than our current check.

@brian-mann
Copy link
Member

The only way to figure this out is spin up a jenkins instance and go look at it. It's obviously not setting what it's documented to say it sets...

https://wiki.jenkins.io/display/JENKINS/Building+a+software+project

@chrisbreiding
Copy link
Contributor

I set up a Jenkins Docker instance, ran env and this is the output:

JENKINS_HOME=/var/jenkins_home
JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental
RUN_CHANGES_DISPLAY_URL=http://localhost:8080/job/test/1/display/redirect?page=changes
HOSTNAME=417aade22af6
NODE_LABELS=master
HUDSON_URL=http://localhost:8080/
SHLVL=0
HOME=/var/jenkins_home
BUILD_URL=http://localhost:8080/job/test/1/
HUDSON_COOKIE=26651f26-d73d-4da8-ae6d-e4893ce3a8be
JENKINS_SERVER_COOKIE=5c0de994b3c8ec8b
JENKINS_UC=https://updates.jenkins.io
WORKSPACE=/var/jenkins_home/workspace/test
JAVA_VERSION=8u171
NODE_NAME=master
CA_CERTIFICATES_JAVA_VERSION=20170531+nmu1
EXECUTOR_NUMBER=1
JENKINS_VERSION=2.121.1
BUILD_DISPLAY_NAME=#1
HUDSON_HOME=/var/jenkins_home
JOB_BASE_NAME=test
JAVA_DEBIAN_VERSION=8u171-b11-1~deb9u1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
BUILD_ID=1
BUILD_TAG=jenkins-test-1
LANG=C.UTF-8
JENKINS_URL=http://localhost:8080/
JOB_URL=http://localhost:8080/job/test/
BUILD_NUMBER=1
RUN_DISPLAY_URL=http://localhost:8080/job/test/1/display/redirect
JENKINS_SLAVE_AGENT_PORT=50000
HUDSON_SERVER_COOKIE=5c0de994b3c8ec8b
JOB_DISPLAY_URL=http://localhost:8080/job/test/display/redirect
JOB_NAME=test
COPY_REFERENCE_FILE_LOG=/var/jenkins_home/copy_reference_file.log
JAVA_HOME=/docker-java-home
PWD=/var/jenkins_home/workspace/test

JENKINS_URL is there, so I assume this run would be detected as Jenkins. We could try also looking for some of the other JENKINS_* variables to be safe:

  • JENKINS_HOME
  • JENKINS_SERVER_COOKIE
  • JENKINS_UC
  • JENKINS_VERSION
  • JENKINS_SLAVE_AGENT_PORT

@brian-mann
Copy link
Member

brian-mann commented Jul 16, 2018

This is good. Can you please add JENKINS_HOME and JENKINS_VERSION to the checks?

Also can you setup a recorded run on the dashboard and make sure it works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers pkg/server This is due to an issue in the packages/server directory type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

4 participants