heroku / roadmap

This is the public roadmap for Salesforce Heroku services.
194 stars 0 forks source link

Make the pull request base branch and number available in the CI flow #150

Open rnuyts opened 1 year ago

rnuyts commented 1 year ago

Required Terms

What service(s) is this request for?

Heroku CI

Tell us about what you're trying to solve. What challenges are you facing?

We would like to use SonarCloud to analyze the code quality of our project. The Sonar scanner must be executed once the tests have been executed since it uses the coverage result files.

The Sonar scanner needs these parameters when a pull request code must be analyzed: sonar.pullrequest.base, sonar.pullrequest.branch, sonar.pullrequest.key.

The pull request base branch and the pull request key (number) are not available in the CI flow. The branch name is available through the HEROKU_TEST_RUN_BRANCH variable. It would be really helpful to expose this information in the CI environment variables since it's required to use a tool like Sonarcloud which is a widely used tool in software development.

The Heroku support told us that the pull request number is available in the review app env through the HEROKU_PR_NUMBER variable, but we need it in the CI flow since we need the test coverage files to execute the analysis.

ASayre commented 1 year ago

@rnuyts Thank you for the feedback!

I can see how this would be useful for you, and we'll keep this in mind when making improvements in this space!

rnuyts commented 1 year ago

@ASayre I saw in the documentation here https://devcenter.heroku.com/articles/github-integration-review-apps#injected-environment-variables that there is a HEROKU_PR_NUMBER variable.

I tried to use it but it's always empty. So it seems to be buggy.

Is there any news regarding this env variable provinding the PR number during CI?