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

🚀 Configuration option for APP_REVISON #215

Closed
tombruijn opened this issue May 5, 2017 · 7 comments
Closed

🚀 Configuration option for APP_REVISON #215

tombruijn opened this issue May 5, 2017 · 7 comments
Assignees
Milestone

Comments

@tombruijn
Copy link
Member

tombruijn commented May 5, 2017

We removed the config for the APP_REVISON config in #154

Not sure if we can't add this option now. Would make for a nice way to standardize all the AppSignal configuration, as it currently is the only config var that you can only set with an env var.

The problem with automatically setting the project version as the revision, is that our integration with GitHub relies on the revision being a existing git reference on the linked repository. So to use the project version as the revision and use the GitHub integration we need users to tag their project versions in git.

git tag v1.0.1
# config/appsignal.exs
config :appsignal, :config, revision: "v1.0.1"
# or linked with the project version
config :appsignal, :config, revision: "v#{Mix.Project.config[:version]}"

# mix.exs
def project do
  [app: :appsignal_phoenix_example,
   version: "1.0.1"]
end

Asked in: https://app.intercom.io/a/apps/yzor8gyw/respond/inbox/tom@appsignal.com/conversations/9047619500

@thijsc
Copy link
Member

thijsc commented May 10, 2017

I just had a conversation with a customer about using the Erlang package revision feature we removed. For him this is a great feature. As part of their deploy process they tag the released sha with this version number. We then used to pick up on this and everything worked out of the box.

I think we should revert this pull and add the functionality back in. If APP_REVISION is set it should override, but at least we can take this as the default. We could document that we expect people to tag their releases in Git if they want to use this.

@thijsc
Copy link
Member

thijsc commented May 10, 2017

So in the context of this issue: I think we should add a revision config option. Then first fill it from the package revision, then overwrite it with APP_REVISION if present.

@tombruijn tombruijn added this to the Elixir 1.5 milestone Jun 22, 2017
@tombruijn tombruijn changed the title Configuration option for APP_REVISON 🚀 Configuration option for APP_REVISON Oct 27, 2017
@doughsay
Copy link

doughsay commented Nov 7, 2017

sooo... just to be clear: is it currently only possible to set the revision using the env var? Or can I use the above config snippet in my config.exs?

@tombruijn
Copy link
Member Author

@doughsay yes, it's currently only possible to use the env var. We're thinking of adding support back for a config option, but the automatic link between the AppSignal revision and mix project version will probably confuse people so we haven't added it yet.

@doughsay
Copy link

doughsay commented Nov 7, 2017

@tombruijn thanks for the update. I'll try and get it working on my end with the env var, but for what it's worth, I would also vote for adding the config option back in some form. Thanks!

@Wijnand
Copy link

Wijnand commented Dec 12, 2017

I would love to be able to use the Erlang package revision again as well.

jeffkreeftmeijer added a commit that referenced this issue Mar 2, 2018
tombruijn pushed a commit that referenced this issue Mar 15, 2018
tombruijn pushed a commit that referenced this issue Mar 20, 2018
@tombruijn
Copy link
Member Author

jeffkreeftmeijer added a commit that referenced this issue Mar 20, 2018
* Restore :revision config

Closes #215.

* Always set APP_REVISION in Config.write_to_environment/0

* Bump agent to 4d113e7

- Unset revision config option when the APP_REVISION environment
  variable only contains an empty string.

* :revision doesn't override APP_REVISION

* Set :revision from APP_REVISION

* Use underscored _APP_REVISION environment variable

* Bump agent to ca32965

Underscore `_APP_REVISION` environment variable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants