codeclimate / test-reporter

Code Climate Test Reporter
MIT License
156 stars 76 forks source link

Pull requests GIT env-vars #370

Closed gaborbernat closed 4 years ago

gaborbernat commented 6 years ago

Hello,

I'm trying to do an Azure Pipelines integration (https://github.com/tox-dev/tox) and had trouble to identify what values should I set for the environment variables in case of a PR. A pull request can be against either the upstream or a fork. In case of a pull request we have three commits:

My question is in such case what value should be set to GIT_BRANCH, and GIT_COMMIT; so that reporting is correct and the Github PR checks are correctly triggered/showed.

I've already reached out to @codeclimate customer support, and Emily encouraged me to open this issue to clarify things.

wfleming commented 6 years ago

GIT_COMMIT should be the full SHA of the commit currently being tested. GIT_BRANCH should be the branch name for the current CI run, i.e. the branch of the PR, or master for a master branch CI run, etc.

Does that clarify things?

gaborbernat commented 6 years ago

So in case of a pull request from a fork:

wfleming commented 6 years ago

No, for a fork the GIT_COMMIT should be the HEAD SHA of the PR on the fork side, and similarly the branch should be the branch name of the PR on the fork side.

damienwebdev commented 4 years ago

@gaborbernat I spent some time making a template for Azure Devops.

https://github.com/graycoreio/daffodil/blob/c42994970649c96d5c1d7415f4a205e334d61a02/.azure/templates/codeclimate.yml

@wfleming you should probably document this somewhere and this issue can be closed.

gaborbernat commented 4 years ago

I've given up a long time ago on using codeclimate to instability and lack of feedback, so from my side free to close it.