Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Agnostic support for CI systems #68

Closed
adiroiban opened this issue Jun 29, 2016 · 8 comments
Closed

Agnostic support for CI systems #68

adiroiban opened this issue Jun 29, 2016 · 8 comments

Comments

@adiroiban
Copy link

This is a follow up for buildbot/buildbot#1671

I see the code from https://github.com/codecov/codecov-python/blob/master/codecov/__init__.py#L260-L430 is trying to hunt each CI system and extract the required information .

I don't see any generic lookup for those environment variables ... other than the token.

Those variables should also be VCS agnostic ... but for now this is of lower priority, since only GitHub/GitLab and Bitbucket are supported anyway.

The goal is to allow sending reports from Buildbot or other CI system without requiring to update codecov-python for each new CI system.

For my project I am using this environment in Buildbot https://github.com/chevah/buildbot-configuration-builder/blob/master/chevah/buildbot_configuration_builder/builder.py#L859


As agnostic environment variables I suggest:

commit -> VCS_COMMIT_ID
branch -> VCS_BRANCH_NAME
branch_url -> VCS_BRANCH_URL
build -> VCS_BUILD_ID
build_url -> VCS_BUILD_URL
pr -> GITHUB_PR_ID | GITLAB_PR_ID
slug -> GITHUB_SLUG | GITLAB_SLUG


any CI system should set CI=true and maybe 'CI_NAME=service`

@stevepeak
Copy link
Contributor

stevepeak commented Jul 10, 2016

Hey! I'll be adding these patterns below if no CI provider is found

  commit="$VCS_COMMIT_ID"
  branch="$VCS_BRANCH_NAME"
  build_url="$VCS_BRANCH_URL"
  build="$VCS_BUILD_ID"
  pr="$VCS_PULL_REQUEST"
  slug="$VCS_SLUG"

CI names are specific to our backend because of icons and internal database linkage.

stevepeak added a commit to codecov/codecov-bash that referenced this issue Jul 10, 2016
stevepeak added a commit that referenced this issue Jul 10, 2016
@adiroiban
Copy link
Author

I think that instead of

build -> VCS_BUILD_ID
build_url -> VCS_BUILD_URL

we should have

build -> CI_BUILD_ID
build_url -> CI_BUILD_URL

as these variables are related to the CI system and not with the VCS

@stevepeak
Copy link
Contributor

Good point :) I agree with that 👍 I'll adjust accordingly

stevepeak added a commit to codecov/codecov-bash that referenced this issue Jul 10, 2016
stevepeak added a commit that referenced this issue Jul 10, 2016
@jayvdb
Copy link
Contributor

jayvdb commented Mar 10, 2017

This is solved?

@stevepeak
Copy link
Contributor

Short answer: Yes, in the bash uploader, when on CI provider is discovered.

Taking another look at it and I think we need to always collect these details, by default, regardless or CI detection.

@jayvdb
Copy link
Contributor

jayvdb commented Mar 10, 2017

It looks like there were commits in the python uploader as well. Is that work in the python uploader not complete?

@stevepeak
Copy link
Contributor

I'll take a look at the python uploader too. Thank you

@thomasrockhu
Copy link
Contributor

This has been solved via 2f3d3ab

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants