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

How is the revision meta tag supposed to be used? #31

Open
RobinDaugherty opened this issue Mar 10, 2017 · 2 comments
Open

How is the revision meta tag supposed to be used? #31

RobinDaugherty opened this issue Mar 10, 2017 · 2 comments

Comments

@RobinDaugherty
Copy link

The readme says:

When you setup raven-js you can retrieve it like this:

Raven.config({
    release: $("meta[name='sentry:revision']").attr('content')
});

How is this supposed to work with ember-cli-sentry?

@RobinDaugherty
Copy link
Author

To amplify, here is what I have observed:

  1. Release version is created during deployment using ember-cli-deploy-revision-data plugin.
  2. ember-cli-deploy-sentry uses this release version to upload source maps.
  3. raven-js library uses ENV.APP.version when sending an exception report to sentry.
  4. Where is the value of ENV.APP.version generated? No idea yet, will require a lot of reading of code. It is however, package version + git commit.
  5. Is it possible to set ENV.APP.version during deployment? Doesn't seem possible to get access to the build information in environment.js.

I tried adding to my raven service:

import Raven from 'ember-cli-sentry/services/raven';

let releaseMetaTag = document && document.querySelector("meta[name='sentry:revision']");
let release = releaseMetaTag && releaseMetaTag.getAttribute('content');
if (release) {
  Raven.callRaven('setRelease', release);
}

export default Raven.extend({}) // snipped the boilerplate

This fails. Should I instead use window.Raven directly? Is this even the correct place to do this?

@duizendnegen
Copy link
Collaborator

I originally worked on this... it doesn't work as well as it should. The break (as you note correctly) is in that ENV.APP.version is used for sending an exception report, which was supposed to be meta[name='sentry:revision'] but has deviated from it, in a way that I don't recall.
This already was supposed to be happening (see 2a561ff) but something, somewhere went wrong...

Your Raven service sounds good - quite possibly we should stick something like that in an initializer instead of a service.

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