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

Make it easier to debug the asset pipeline #24

Closed
wuputah opened this issue Jun 12, 2012 · 15 comments
Closed

Make it easier to debug the asset pipeline #24

wuputah opened this issue Jun 12, 2012 · 15 comments

Comments

@wuputah
Copy link
Contributor

wuputah commented Jun 12, 2012

Debugging pipeline issues can be hard and devious. If the --dry-run fails, it looks like the pipeline support is not working at all, since there's no output. Here's what's currently required to track down issues:

$ heroku run bash
$ unset DATABASE_URL REDISTOGO_URL REDIS_URL MONGOLAB_URI SENDGRID_USERNAME SENDGRID_PASSWORD
$ time env RAILS_ENV=production DATABASE_URL=postgres://user:pass@127.0.0.1/dbname rake assets:precompile --trace

That said I am not sure what the best solution is, but here's some ideas.

  • What if we had a branch of the buildpack with --trace enabled on the --dry-run and the task itself?
  • What if we built this into the build pack and then it could be enabled... somehow? It can't be a config var, so... File.exists?(".debug-asset-pipeline")?
  • Is there a way we can detect the presence of the pipeline without booting their app, so at least we can say that the --dry-run failed and that's why the pipeline stuff isn't working? Maybe just blindly do this if sprockets is present?
-----> assets:precompile rake task not detected; asset pipeline support disabled
@hone
Copy link
Member

hone commented Jun 13, 2012

I've never been a big fan of the way the rake task detection works. Is there a better way than using --dry-run?

@hone
Copy link
Member

hone commented Jun 13, 2012

This is related to #9.

@wuputah
Copy link
Contributor Author

wuputah commented Jun 13, 2012

A better way? No.
A different way? Yes.
https://gist.github.com/2922172

@wuputah
Copy link
Contributor Author

wuputah commented Jun 14, 2012

Proposal:

  • Using something akin to the gist provided, provide better error messaging about why the pipeline failed.
  • Run pipeline in a limited environment and with --trace if DEBUG_PIPELINE=1

While a completely separate issue, follow Python's lead and allow users to turn off the pipeline entirely via DISABLE_PIPELINE=1

@hone
Copy link
Member

hone commented Jul 20, 2012

@wuputah how does python do this?

@wuputah
Copy link
Contributor Author

wuputah commented Jul 20, 2012

:s/ @wuputah / @kennethreitz /

@kennethreitz
Copy link

I allow users to disable it with DISABLE_COLLECTSTATIC=1, but ideally someone should almost never need to do that.

@wuputah
Copy link
Contributor Author

wuputah commented Jul 20, 2012

@kennethreitz what happens if collectstatic fails (and, of course, is not disabled)?

@kennethreitz
Copy link

I do a dry run first. If it fails, nothing happens, the user doesn't see anything about.

If the dry run passes, I run it, if it fails, i tell them the output, and point to documentation on how to debug w/ heroku run.

@wuputah
Copy link
Contributor Author

wuputah commented Jul 21, 2012

In the latter case, does the build still succeed?

@kennethreitz
Copy link

Yes. I had it fail at first, but too many people have configuration issues for that to be practical.

People have crazy configurations.

@kennethreitz
Copy link

In the long term future, I'd like to remove this feature completely and replace it with "add this oneliner to a build hook (e.g. bin/post_compile)" instead.

But, some things have to happen for that to be a reality.

@wuputah
Copy link
Contributor Author

wuputah commented Jul 21, 2012

Okay, to come back to what I was talking about earlier, I was principally referring to Kenneth's use of DISABLE_COLLECTSTATIC.

@hone
Copy link
Member

hone commented Jul 22, 2012

@wuputah i don't think we should be pushing build stuff through config vars.

@hone
Copy link
Member

hone commented Jul 18, 2013

Should be solved by #34

@hone hone closed this as completed Jul 18, 2013
bpaul pushed a commit to qstream/heroku-buildpack-ruby that referenced this issue Apr 3, 2015
Re-enabled caching bower packages and registry
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

3 participants