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

removed assets related to spree store: dead code #2540

Merged
merged 1 commit into from
Sep 17, 2018

Conversation

luisramos0
Copy link
Contributor

@luisramos0 luisramos0 commented Aug 11, 2018

What? Why?

I found this in the context of deleting dead code here #2539
Deleting dead UI code. The OFN frontoffice should not depend on any Spree JS code any longer.

What should we test?

The frontoffice (OFN shop) should work and look the same way.

Release notes

Removed unused Spree UI code.

Changelog Category: Removed

@luisramos0 luisramos0 self-assigned this Aug 11, 2018
Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't know if this is used or not. I can't find any other require statement. Let's test it. :-D

Do you happen to know why we need to add stuff like shared/* here? Shouldn't that already be included in admin/all or darkswarm/all?

I'm also just seeing the all_split2 again which we don't need any more.

@luisramos0
Copy link
Contributor Author

luisramos0 commented Aug 18, 2018

re /shared, I dont know.
I have checked and most stuff in shared is called and included in the all.js file of admin or darkswarm.
jquery 1.8 and jquery timeago are only used in tests.

re split2, I have removed it, there's no reference to it in the code base.

I don't understand why we have /app/assets/javascripts/shared and /vendor/assets/javascript.
It would be good to merge these two under /app/assets/javascripts/shared.

@mkllnk
Copy link
Member

mkllnk commented Aug 20, 2018

Why not in vendor/assets? Seems to be the Rails convention: https://guides.rubyonrails.org/asset_pipeline.html#asset-organization

@daniellemoorhead
Copy link
Contributor

@Matt-Yorkley could you take a look at this and approve pls? That way we can try and merge it and get it out of the way :)

@daniellemoorhead
Copy link
Contributor

daniellemoorhead commented Aug 20, 2018

@luisramos0 can I assume this one doesn't need to be tested by Myriam or Rachel or Sally?

I put the 'pr-no-test' label on it, it can be removed if it does actually need to be tested :)

@mkllnk
Copy link
Member

mkllnk commented Aug 20, 2018

It should still be tested. We think that we are removing unused code, but sometimes we make mistakes.

@luisramos0
Copy link
Contributor Author

yes, needs to be tested. we need to validate the checkout process.

@Matt-Yorkley
Copy link
Contributor

Looks good, I hope we can get rid of the split2 file without any problems.

@luisramos0
Copy link
Contributor Author

all right, I moved it to test ready. needs staging.

@daniellemoorhead
Copy link
Contributor

I think we really need the french staging server so we have 3 european options going at the same time. There are so many things to test, it will help with that. @luisramos0 if you can try and figure out why it's not working (ping @myriamboure FYI) and get access to it I think this will be a great help in clearing out the testing backlog.

@luisramos0
Copy link
Contributor Author

luisramos0 commented Aug 27, 2018

ok, stagingFR is working now. I'll learn how to stage and stage this one there today or tomorrow.

@mkllnk mkllnk added the pr-staged-au staging.openfoodnetwork.org.au label Aug 31, 2018
@mkllnk
Copy link
Member

mkllnk commented Aug 31, 2018

Staged on https://staging1.openfood.com.au/.

@mkllnk
Copy link
Member

mkllnk commented Sep 3, 2018

After deploying this, we got the following exception on staging:

 ActionView::Template::Error · darkswarm/all_split2.css isn't precompiled

gems/actionpack-3.2.22.5/lib/sprockets/helpers/rails_helper.rb:142:in `digest_for': darkswarm/all_split2.css isn't precompiled (ActionView::Template::Error)
    from gems/actionpack-3.2.22.5/lib/sprockets/helpers/rails_helper.rb:151:in `rewrite_asset_path'
    from gems/actionpack-3.2.22.5/lib/action_view/asset_paths.rb:27:in `compute_public_path'
    from gems/actionpack-3.2.22.5/lib/sprockets/helpers/rails_helper.rb:56:in `asset_path'
    from gems/actionpack-3.2.22.5/lib/sprockets/helpers/rails_helper.rb:49:in `block in stylesheet_link_tag'
    from gems/actionpack-3.2.22.5/lib/sprockets/helpers/rails_helper.rb:43:in `collect'
    from gems/actionpack-3.2.22.5/lib/sprockets/helpers/rails_helper.rb:43:in `stylesheet_link_tag'
    from gems/css_splitter-0.4.5/app/helpers/css_splitter/application_helper.rb:18:in `block in split_stylesheet_link_tag'
    from gems/css_splitter-0.4.5/app/helpers/css_splitter/application_helper.rb:7:in `map'
    from gems/css_splitter-0.4.5/app/helpers/css_splitter/application_helper.rb:7:in `split_stylesheet_link_tag'
    from app/views/layouts/darkswarm.html.haml:20:in `_ab5644e7ce6d8a4a7df3eb77aaf8a69f'
    from gems/actionpack-3.2.22.5/lib/action_view/template.rb:145:in `block in render'
    from gems/skylight-1.6.1/lib/skylight/vendor/active_support/notifications.rb:161:in `instrument'
    from gems/actionpack-3.2.22.5/lib/action_view/template.rb:143:in `render'
    from bundler/gems/deface-1110a1336252/lib/deface/action_view_extensions.rb:41:in `render'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/template_renderer.rb:60:in `render_with_layout'
    from gems/skylight-1.6.1/lib/skylight/probes/action_view.rb:30:in `block in render_with_layout'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
    from gems/skylight-1.6.1/lib/skylight/vendor/active_support/notifications.rb:159:in `block in instrument'
    from gems/skylight-1.6.1/lib/skylight/vendor/active_support/notifications/instrumenter.rb:20:in `instrument'
    from gems/skylight-1.6.1/lib/skylight/vendor/active_support/notifications.rb:159:in `instrument'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
    from gems/skylight-1.6.1/lib/skylight/probes/action_view.rb:29:in `render_with_layout'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/template_renderer.rb:46:in `render_template'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/template_renderer.rb:18:in `render'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/renderer.rb:43:in `render_template'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/renderer.rb:24:in `render'
    from gems/actionpack-3.2.22.5/lib/abstract_controller/rendering.rb:111:in `_render_template'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/streaming.rb:225:in `_render_template'
    from gems/actionpack-3.2.22.5/lib/abstract_controller/rendering.rb:104:in `render_to_body'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/renderers.rb:28:in `render_to_body'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
    from gems/actionpack-3.2.22.5/lib/abstract_controller/rendering.rb:89:in `render'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/rendering.rb:16:in `render'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
    from gems/activesupport-3.2.22.5/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
    from /home/openfoodweb/.rbenv/versions/2.1.5/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
    from gems/activesupport-3.2.22.5/lib/active_support/core_ext/benchmark.rb:5:in `ms'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'

Caused by: gems/actionpack-3.2.22.5/lib/sprockets/helpers/rails_helper.rb:142:in `digest_for': darkswarm/all_split2.css isn't precompiled (Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError)
    from gems/actionpack-3.2.22.5/lib/sprockets/helpers/rails_helper.rb:151:in `rewrite_asset_path'
    from gems/actionpack-3.2.22.5/lib/action_view/asset_paths.rb:27:in `compute_public_path'
    from gems/actionpack-3.2.22.5/lib/sprockets/helpers/rails_helper.rb:56:in `asset_path'
    from gems/actionpack-3.2.22.5/lib/sprockets/helpers/rails_helper.rb:49:in `block in stylesheet_link_tag'
    from gems/actionpack-3.2.22.5/lib/sprockets/helpers/rails_helper.rb:43:in `collect'
    from gems/actionpack-3.2.22.5/lib/sprockets/helpers/rails_helper.rb:43:in `stylesheet_link_tag'
    from gems/css_splitter-0.4.5/app/helpers/css_splitter/application_helper.rb:18:in `block in split_stylesheet_link_tag'
    from gems/css_splitter-0.4.5/app/helpers/css_splitter/application_helper.rb:7:in `map'
    from gems/css_splitter-0.4.5/app/helpers/css_splitter/application_helper.rb:7:in `split_stylesheet_link_tag'
    from app/views/layouts/darkswarm.html.haml:20:in `_ab5644e7ce6d8a4a7df3eb77aaf8a69f'
    from gems/actionpack-3.2.22.5/lib/action_view/template.rb:145:in `block in render'
    from gems/skylight-1.6.1/lib/skylight/vendor/active_support/notifications.rb:161:in `instrument'
    from gems/actionpack-3.2.22.5/lib/action_view/template.rb:143:in `render'
    from bundler/gems/deface-1110a1336252/lib/deface/action_view_extensions.rb:41:in `render'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/template_renderer.rb:60:in `render_with_layout'
    from gems/skylight-1.6.1/lib/skylight/probes/action_view.rb:30:in `block in render_with_layout'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
    from gems/skylight-1.6.1/lib/skylight/vendor/active_support/notifications.rb:159:in `block in instrument'
    from gems/skylight-1.6.1/lib/skylight/vendor/active_support/notifications/instrumenter.rb:20:in `instrument'
    from gems/skylight-1.6.1/lib/skylight/vendor/active_support/notifications.rb:159:in `instrument'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
    from gems/skylight-1.6.1/lib/skylight/probes/action_view.rb:29:in `render_with_layout'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/template_renderer.rb:46:in `render_template'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/template_renderer.rb:18:in `render'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/renderer.rb:43:in `render_template'
    from gems/actionpack-3.2.22.5/lib/action_view/renderer/renderer.rb:24:in `render'
    from gems/actionpack-3.2.22.5/lib/abstract_controller/rendering.rb:111:in `_render_template'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/streaming.rb:225:in `_render_template'
    from gems/actionpack-3.2.22.5/lib/abstract_controller/rendering.rb:104:in `render_to_body'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/renderers.rb:28:in `render_to_body'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
    from gems/actionpack-3.2.22.5/lib/abstract_controller/rendering.rb:89:in `render'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/rendering.rb:16:in `render'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
    from gems/activesupport-3.2.22.5/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
    from /home/openfoodweb/.rbenv/versions/2.1.5/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
    from gems/activesupport-3.2.22.5/lib/active_support/core_ext/benchmark.rb:5:in `ms'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
    from gems/actionpack-3.2.22.5/lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'

@luisramos0
Copy link
Contributor Author

yeah...
I have put the split2 thing back in application.rb preconpile list.
If we do something with it, we can do it in PR #2637
I think we should go forward with this PR without it.

@sigmundpetersen sigmundpetersen removed the pr-staged-au staging.openfoodnetwork.org.au label Sep 3, 2018
@luisramos0
Copy link
Contributor Author

This needs to be staged again.

@luisramos0 luisramos0 added the pr-staged-fr staging.coopcircuits.fr label Sep 13, 2018
@luisramos0
Copy link
Contributor Author

Back to staging, this time on https://staging.openfoodfrance.org/

@RachL RachL self-assigned this Sep 17, 2018
@RachL
Copy link
Contributor

RachL commented Sep 17, 2018

Front office looks as usual on both desktop and mobile. Guest and login checkout worked good as well.
Testing notes:
https://docs.google.com/document/d/1_tMLQZ2DHIlmbkU-tWlSgAo_bhbDAEYGRn94JBxXeIk/edit#

@RachL RachL removed the pr-staged-fr staging.coopcircuits.fr label Sep 17, 2018
@sauloperez sauloperez merged commit 0520f21 into openfoodfoundation:master Sep 17, 2018
@luisramos0 luisramos0 deleted the delete_dead_store branch September 17, 2018 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants