Skip to content
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

On Heroku, relies on '/etc/heroku/dyno' which is added by https://devcenter.heroku.com/articles/dyno-metadata #111

Open
bf4 opened this issue Dec 20, 2017 · 2 comments

Comments

@bf4
Copy link
Contributor

bf4 commented Dec 20, 2017

Making an issue since I'm not sure where a PR would go

The code shows that :'heroku.dyno_info_path' => '/etc/heroku/dyno' and the docs mention that you may need to activate the metadata labs, but I didn't see anywhere to check if you have /etc/heroku/dyno (so I ran heroku labs:enable runtime-dyno-metadata -a appname)

This comes up in the deploy util Util::Deploy.build(self) which iterates through [DefaultDeploy, HerokuDeploy, GitDeploy] which otherwise tries to get he release info from git, which causes Heroku to warn

fatal: Not a git repository (or any parent up to mount point /app)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

I've traced this warning to the Skylight::Util::GitDeploy shelling out to git git log -1 --pretty="%H %s" 2>&1

In the console, I can now

Skylight::Util::Deploy.build(Skylight::Config.new)

=> #<Skylight::Util::Deploy::HerokuDeploy:0x007f36290eb288 @config=#<Skylight::Config:0x007f36290eb440 @values={}, @priority={}, @regexp=nil, @environment=nil>, @timestamp=1513797401, @info={"id"=>123, "commit"=>"fd1036919b3a612a29a4c0985c6f879a4dfe840d", "description"=>"Deploy fd103691"}>
@wagenet
Copy link
Contributor

wagenet commented Dec 20, 2017

@bf4 Thanks for the report. What specific changes are you recommending here?

@bf4
Copy link
Contributor Author

bf4 commented Dec 20, 2017

@wagenet I'm thinking https://www.skylight.io/support/advanced-setup#if-you-use-heroku

If You Use Heroku
You may need to enable Heroku’s Dyno Metadata feature in order to send deploy information to Skylight.

could be more specific and say that if you use heroku, you'll want to ensure your filesystem has /etc/heroku/dyno, which is added by the dyno metadata feature.

And/or that Skylight::Util::Deploy.build(Skylight::Config.new) is how you can determine what deploy info skylight is finding, if any

Or that you could add the heroku plugin then

# config/skylight.yml
deploy:
  id: <%= ENV.fetch("HEROKU_RELEASE_VERSION")[/\d+/] %>
  git_sha: <%= ENV.fetch("HEROKU_SLUG_COMMIT") %>
  description: <%= ENV.fetch("HEROKU_SLUG_DESCRIPTION") %>

or if there's a way to set that on config.skylight

or in config/environment.rb

ENV['SKYLIGHT_DEPLOY_ID'] = ENV.fetch("HEROKU_RELEASE_VERSION")[/\d+/]
ENV['SKYLIGHT_DEPLOY_GIT_SHA'] = ENV.fetch("HEROKU_SLUG_COMMIT")
ENV['SKYLIGHT_DEPLOY_DESCRIPTION'] =  ENV.fetch("HEROKU_SLUG_DESCRIPTION") 

Or maybe just a general FAQ that if you see in your logs

fatal: Not a git repository (or any parent up to mount point /app)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

That may be due to skylight deploy tracking trying to find deploy info from git, but the deploy environment has no git repo

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

No branches or pull requests

2 participants