Giter Site home page Giter Site logo

Comments (27)

urbany avatar urbany commented on July 16, 2024 1

Hehe, ok mate no problem I'll give it a try then.

from ember-cli-deploy-sentry.

duizendnegen avatar duizendnegen commented on July 16, 2024 1

That's right @alexjpong. There are alternative paths for when Sentry decides it doesn't want to support gzipping, but it's clumsier and much more work (convincing -gzip to keep the non-encrypted files, rename files after uploading to Sentry so that also S3 and azure-blob also find things like they expect...) - I'd rather wait a bit.

from ember-cli-deploy-sentry.

urbany avatar urbany commented on July 16, 2024

I see this issue has been brought up before in #8 and #9 but keeping the zipped files isn't a possibility for me. Any ideas on how to fix this for good?

from ember-cli-deploy-sentry.

dschmidt avatar dschmidt commented on July 16, 2024

I dont have time to look into this right now :-(

from ember-cli-deploy-sentry.

dschmidt avatar dschmidt commented on July 16, 2024

Are you using master or the release version btw?

from ember-cli-deploy-sentry.

urbany avatar urbany commented on July 16, 2024

Release. I can submit a PR, just need some guidance on what is the best solution.

from ember-cli-deploy-sentry.

dschmidt avatar dschmidt commented on July 16, 2024

It would be a start to try master, I'm afraid I can't give any guidance atm. I haven't done any Ember or Node.js work lately - you're probably all on your own here.

from ember-cli-deploy-sentry.

duizendnegen avatar duizendnegen commented on July 16, 2024

We should also push this convo to ember-cli-deploy-gzip, there's cases where we want to keep both the processed files (possibly in distFiles: []) and unprocessed files (possibly in rawFiles: []).

@urbany there are (from my point of view) 3 options, sorted in order of preference:

  1. see if Sentry accepts gzipped assets if we're smarter with headers that we sent to them;
  2. see if we can get the raw/unprocessed files from ember-cli-deploy-gzip;
  3. unzip the files separately again, writing a ember-cli-deploy-ungzip. I vaguely recall other plugins have travelled this route, it would not be my preference at all.

from ember-cli-deploy-sentry.

urbany avatar urbany commented on July 16, 2024

@duizendnegen thank you for replying, I agree with all your points and priorities.

from ember-cli-deploy-sentry.

urbany avatar urbany commented on July 16, 2024

So I just spent a few hours trying to solve this and looking at @duizendnegen priorities:

  1. could not make it work, tried using the following headers during upload and it doesn't fix the problem: Transfer-Encoding: gzip, Content-Encoding: gzip
  2. ember-cli-deploy-gzip has an option to keeo the original files, but then the gzipped files have a different name so it's not what we need, and doing something there to keep the originals seems overkill.
  3. This is the only option I can see working now, I can take the idea from #9 and adapt to current master if you guys are interested.

Right now I decided to stop GZIPping my files and let cloudfront do it for me.

from ember-cli-deploy-sentry.

duizendnegen avatar duizendnegen commented on July 16, 2024

Could you open a ticket on the Sentry side of things and see if they're seeing similar issues? According to getsentry/sentry#934 this should just work out of the box (but obviously it doesn't)
Thanks for spending some cycles on investigating!

from ember-cli-deploy-sentry.

urbany avatar urbany commented on July 16, 2024

@duizendnegen I opened a ticket yesterday getsentry/sentry#4566 and I'm currently in contact with their support via email. Current status is: it should work but it's not working, so they are going to fix it. I'll keep you posted when I have an update.

from ember-cli-deploy-sentry.

duizendnegen avatar duizendnegen commented on July 16, 2024

Any update on this, did support get back to you?

from ember-cli-deploy-sentry.

urbany avatar urbany commented on July 16, 2024

@duizendnegen nothing yet, still waiting.

from ember-cli-deploy-sentry.

kmiyashiro avatar kmiyashiro commented on July 16, 2024

Funny since Sentry explicitly says they do not support gzipped artifacts: https://docs.sentry.io/clients/javascript/sourcemaps/#verify-artifacts-are-not-gzipped

If getsentry/sentry#4566 actually gets fixed and you can send gzipped artifacts with a header, this plugin will have to support setting the header for this to work. As far as I can tell, this is not supported yet: https://github.com/dschmidt/ember-cli-deploy-sentry/blob/master/index.js#L171-L174

from ember-cli-deploy-sentry.

urbany avatar urbany commented on July 16, 2024

@kmiyashiro when they fix it I'll add a PR with a configurable option for the user to indicate if the sourcemaps are gzipped, in which case the header will be sent.

PS: thanks for pinging the sentry issue.

from ember-cli-deploy-sentry.

kmiyashiro avatar kmiyashiro commented on July 16, 2024

@urbany would it be possible to submit the PR before Sentry fixes their side? Since it's supposed to be supported, I don't see why we couldn't add support for it now.

from ember-cli-deploy-sentry.

kmiyashiro avatar kmiyashiro commented on July 16, 2024

It's happening 🎉 getsentry/sentry#4677

from ember-cli-deploy-sentry.

duizendnegen avatar duizendnegen commented on July 16, 2024

Excellent!

fyi we don't need to add an extra configurable option to indicate if the sourcemaps are gzipped, we can simply look at whether context.gzippedFiles is present. See https://github.com/ember-cli-deploy/ember-cli-deploy-s3/blob/master/index.js#L32

from ember-cli-deploy-sentry.

dschmidt avatar dschmidt commented on July 16, 2024

Sure, I will accept a PR as soon as it has landed on sentry master. Feel free to send it before the sentry PR is merged.

Great work everyone 👍

from ember-cli-deploy-sentry.

kmiyashiro avatar kmiyashiro commented on July 16, 2024

Looks like the sentry PR has been merged.

from ember-cli-deploy-sentry.

alexjpong avatar alexjpong commented on July 16, 2024

So it looks like we're still waiting for sentry to merge the gzip code? In the mean time, would it be best to rely on something like Cloudfront to gzip instead of ember-cli-deploy-gzip?

from ember-cli-deploy-sentry.

jpaas avatar jpaas commented on July 16, 2024

This issue hasn't been updated in 6 months. Is there any chance we will be able to use ember-cli-deploy-gzip?

from ember-cli-deploy-sentry.

urbany avatar urbany commented on July 16, 2024

I asked about this yesterday: getsentry/sentry#4566
No response yet.

from ember-cli-deploy-sentry.

kmiyashiro avatar kmiyashiro commented on July 16, 2024

I went the route of unzipping and renaming the unzipped files *.gz before uploading them to sentry with an in-repo addon, I couldn't wait for the fix.

from ember-cli-deploy-sentry.

xcambar avatar xcambar commented on July 16, 2024

@kmiyashiro care to share? This would help at least the 6 contributors of this thread and probably many more!

from ember-cli-deploy-sentry.

kmiyashiro avatar kmiyashiro commented on July 16, 2024

Sure, here is the in-repo addon, be sure to put this right before the upload to sentry and after you upload your gzipped files where they need to go. In this case, I'm running after s3 which uploads the gzipped files.

/* eslint-env node */
const fs = require('fs');
const glob = require('glob');

module.exports = {
  name: 'ember-cli-deploy-unzip-sentry',

  createDeployPlugin: function(options) {
    return {
      name: options.name,

      runBefore: 'sentry',
      runAfter: ['gzip', 's3'],

      upload: function() {
        let jsFiles = glob.sync('./dist/**/*.js');

        jsFiles.forEach((file) => {
          let fileData = fs.readFileSync(file, 'utf-8');
          fs.writeFileSync(`${file}.gz`, fileData);
          console.log(`✔ copied ${file} to ${file}.gz`);
        });
      },
    };
  }
};

from ember-cli-deploy-sentry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.