Closed aboyett closed 8 years ago
Thanks for the contribution! Please ensure your commits follow our style guide. This code will be tested once a Deis maintainer reviews it.
@jeroenvisser101, @arschles and @aledbf are potential reviewers of this pull request based on my analysis of git blame
information. Thanks @aboyett!
@@ master #418 diff @@
==========================================
Files 26 26
Lines 1101 1105 +4
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 518 521 +3
- Misses 552 553 +1
Partials 31 31
Powered by Codecov. Last update 9c54cdd...05522a0
@aboyett looks good, maybe add some unit-tests?
@jeroenvisser101 I augmented the existing tests to handle this new argument. Do you have any suggestions on what other tests you'd like to see added as part of this PR?
@aboyett ah, right, I think it's fine indeed. In #412 I added a method, but you're reusing gitSha.short()
which has tests already. I think it's fine as is.
Jenkins, add to whitelist.
@aboyett Some other changes have been made to this bit of code, do you mind rebasing?
Rebase complete, waiting on the e2e test to finish
If I understand this PR correctly, the SOURCE_VERSION environment variable is currently only available during build. Would it be possible to pass it on to the apps environment as well?
It would be great to pass as additional context in exception monitoring. I'm currently passing the WORKFLOW_RELEASE environment var as context, but that requires another roundtrip to look up the commit sha from deis releases
to be able to see which version of the code this was.
Btw. it seems that heroku uses the environment variable HEROKU_SLUG_COMMIT
for this, so it might make sense to emulate that variable in the slugbuilder. It would allow existing tools like the sentry client to detect the release without changes.
@felixbuenemann mind filing a new issue so we can track that effort? :)
My pull request attempted to replicate the behavior of Heroku which only makes the SOURCE_VERSION
variable available during the compile phase[1]. I am curious to hear more about this HEROKU_SLUG_COMMIT
env var as it doesn't appear to exist in cedar-14 based python buildpack generated slugs. If you create a new ticket, please reference this ticket so it is easy to find :smile:
[1] https://devcenter.heroku.com/articles/buildpack-api#bin-compile-summary
@aboyett It must be enabled on heroku, see Heroku Labs: Dyno Metadata.
heroku exposes the git commit hash of the revision being built in the SOURCE_VERSION environment variable. this commit implements this in the deis builder for git pushes.
see https://devcenter.heroku.com/changelog-items/630 for more info on heroku's implementation