-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add Codecov coverage #1671
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
Add Codecov coverage #1671
Conversation
|
Is there documentation on global environment variables? I'm looking for something like this. Thanks! |
|
@stevepeak could you please elaborate a bit what kind of documentation you are looking for? |
|
Thanks @sa2ajj I'm looking for something like this: The documentation does not layout specific example values which would help for testing purposes. In the uploader you can get and idea of the variables I'm looking for: branch, commit, slug, pr#, build id, etc. Thanks. |
|
@stevepeak sorry, it took so long to follow up. As such, Builldbot does not have environment variables -- it has build properties. These can be exposed as environment variables, but it requires some parameters to the build step. I'd suggest you describe the workflow you expect to work and then I could tell you how this could be achieved. |
|
@sa2ajj no problem, thanks for working with me on this. MethodThere are two different ways on handling the workflow with Codecov. One is the traditional method used at all CI companies. The other is an embedded method (more integrated) so the customer can just add Codecov as a plugin (per-say) by toggling it on. The traditional method is using an uploader, likely the Global Bash Uploader. You can read more about how that works on the repo codecov/codecov-bash The embedded method would be adding an upload method directly to Buildbot code base to make the transaction between our products seamless. We would work on this together if this method interests you. What Codecov needsBoth methods require Codecov to recognize some variables to understand what repo, commit, etc. are being uploaded. Checkout this example |
|
Hi stevepeak. Our framework uses properties, which are documented here: so probably the best option is to use the codecov -e option, and pass the environment variable via a properly configured Interpolate(). f.addStep(steps.ShellCommand(command=['codecov', '-e',
util.Interpolate('BUILDBOT=true,BRANCH=%(prop:branch)s, etc')]))or you can contribute a full featured step that would download codecov automatically, and the run the shellcommand. You can look at the demo buildbot instance, which show the list of common properties that you can use. |
|
@tardyp thanks for your comment: I still did not understand the question :) |
|
@stevepeak regarding your change: what will it give Buildbot project? (we already use coveralls) |
|
Codecov has plenty of advantages vs Coveralls. It's a decision you may make to switch products, but just my bias suggestion :) I'm happy to show you the many ways our product is far superior. I will be integrating with Buildbot to provide a more streamline opportunity for your clients to upload reports to Codecov. My original question was simply what are some example variables provided, but it looks like there is more then just some environment variables at play. I'll need to spend some more time looking over how to fully integrate with Buildbot. |
|
It's interesting that you began this PR with a patch to make Buildbot submit its own coverage information to Codecov, but this does not appear to be what you really want to do. If Codecov provides advantages to our developers over coveralls -- or better, if we can use both without either one spamming our email or pull requests -- then I don't see any reason not to merge this PR. To the bigger issue, I think the right fix is to write a build step that runs the codecov uploader command (assuming it's already been installed, or given a path to it in a virtualenv), somewhat like what @tardyp has suggested. I think that would make a great second pull request. |
|
@stevepeak I'll see if I could submit a PR for codecov/codecov-python |
|
@sa2ajj Thanks ;) Both codecov/codecov-python and codecov/codecov-bash operate the same and are very suitable for the integration. I appreciate your help! |
|
Regarding this PR: I looked at the http://codecov.io and saw the differences between coveralls and this service. I'll merge the PR to see how all those features really compare :) |
|
@stevepeak I'd really appreciate a better API docs:
|
|
@sa2ajj I have not updated our API docs for the v2 endpoint which is a much better one to utilize. Are you planning on using the Bash or Python uploader or would you prefer the APIs directly, I can give you more details on them accordingly. Thanks! |
|
@stevepeak Python uploader :) Would you expect a Buildbot developer to use bash? :) |
|
Sounds good. Well in that case here is some more information about it. Codecov is looking for general information about the build that includes the following:
I can add the buildbot section into the python uploader that can retrieve these values. Just need know how. See the Jenkins section for reference. |
|
@stevepeak what about other VCS? |
|
Codecov requires your repo being hosted on Github, Bitbucket or Gitlab. So we support git and mercurial. A mercurial commit and branch is appropriate too. |
|
Sorry, I've been distracted. I'll submit the PR eventually :) One question: since you added commands to submit coverage information to codecov.io, is it supposed to add any statuses of PRs? |
|
We do update the status of the PR for min coverage and relative coverage (incremental). However, this feature needs to be enabled in the UI under Features -> Github Status. Thanks |
|
This is linked from https://github.com/codecov/codecov-python as coming-soon but I think that a separate ticket is needed. What @stevepeak want is to have a list of env vars which are exported by default by Buildbot and which contain information about branch , github , pr... etc. The answer is that Buildbot does not expose them by default as Buildbot is way too flexible to handle this :) so @stevepeak rather than chasing after the env vars of each CI provider, I think that for codecov you should define a set of required env variables and then someone who want to integrate with codecov will need to make sure that those env variables are exposed. I see the code from https://github.com/codecov/codecov-python/blob/master/codecov/__init__.py#L260-L430 but I don't see any generic lookup for those environment variables So we need a last branch which is triggered with I suggest to prefix all of them with "CI_" ... so that we have "CI_BRANCH" , "CI_BUILD" |
|
@adiroiban π Agreed. Happy to elaborate on details if necessary. |
|
Try to repeat 10 times really fast the title of this pull request |
Hey,
I'm the founder of Codecov and had some customers ask to integrate with your awesome product. Thank you for building a great CI tool. Thought I should add Codecov. Checkout all our features at https://codecov.io
Cheers,
Steve