You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.
agent.trackRelease accepts a data parameter which is passed to getTracker which accepts an auto property as a default to actually use the rev option passed in rather than using git rev-parse: watson/opbeat-release-tracker@93342fc
Since the client argument is provided to getTracker but not the defaults argument, there is no way to provide this option to the release tracker, which means that the function throws an exception if executed on a server where the git executable or a parent .git isn't available.
Currently I am monkey patching this like so:
Opbeat.start({appId: process.env.OPBEAT_SERVER_APP_ID,organizationId: process.env.OPBEAT_ORGANIZATION_ID,secretToken: process.env.OPBEAT_SECRET_TOKEN});if(process.env.NODE_ENV==='production'||process.env.NODE_ENV==='staging'){// Hack defaults to prevent Opbeat from calling gitOpbeat._httpClient.auto=false;Opbeat.trackRelease({rev: process.env.GIT_COMMIT});}
The server runs in Docker and doesn't have the project's git history. I populate GIT_COMMIT with Webpack's DefinePlugin at build time.
I'm happy to work on a PR for this in either project, but I wasn't sure if @watson would think it should be patched here or in opbeat-release-tracker. I have to say, having a defaults argument inside of a closure which acts to override the options argument passed into the actual function is a bit unintuitive. It seems semantically correct that options be merged with defaults and override them.
The text was updated successfully, but these errors were encountered:
@jordansexton Thanks for reporting this. It's definitely an oversight on my part and the API could be better - so there's a lot of room for improvement. You're probably right that this should be fixed down the dependency graph as well - I'll fix this in the forthcoming release.
agent.trackRelease
accepts adata
parameter which is passed to getTracker which accepts anauto
property as a default to actually use therev
option passed in rather than usinggit rev-parse
: watson/opbeat-release-tracker@93342fcSince the
client
argument is provided togetTracker
but not thedefaults
argument, there is no way to provide this option to the release tracker, which means that the function throws an exception if executed on a server where thegit
executable or a parent.git
isn't available.Currently I am monkey patching this like so:
The server runs in Docker and doesn't have the project's git history. I populate
GIT_COMMIT
with Webpack's DefinePlugin at build time.I'm happy to work on a PR for this in either project, but I wasn't sure if @watson would think it should be patched here or in
opbeat-release-tracker
. I have to say, having adefaults
argument inside of a closure which acts to override theoptions
argument passed into the actual function is a bit unintuitive. It seems semantically correct thatoptions
be merged with defaults and override them.The text was updated successfully, but these errors were encountered: