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

Cleanup dhtmlxgrid partial. #4808

Merged
merged 1 commit into from Oct 13, 2015
Merged

Conversation

martinpovolny
Copy link

So we have this XML that we have inside a piece of javascript that is inside a script tag generated by a partial that we render to a string and assign to a variable that we pass to a dom-manipulation function $('#main_div').html(...).

It is crazy and has to be removed. But not now. Now we need to fix it...

@martinpovolny
Copy link
Author

@romanblanco : review, please

@martinpovolny martinpovolny force-pushed the dhtmlx_grid_fix branch 3 times, most recently from 6084a8f to 1904799 Compare October 12, 2015 13:19
@Fryguy
Copy link
Member

Fryguy commented Oct 12, 2015

So we have this XML that we have inside a piece of javascript that is inside a script tag generated by a partial that we render to a string and assign to a variable that we pass to a dom-manipulation function

Best description ever... cc @blomquisg 😆

@skateman
Copy link
Member

Yo Dawg

@martinpovolny
Copy link
Author

Hakiri does not like me calling j stuff.html_safe but I have to call both of the functions to get it actually right. So trying to swap the calls to make Hakiri happy.

@martinpovolny
Copy link
Author

@matthewd, @kbrock : any hint how to make Hakiri happy here? Or do we add an exception for this one, @chessbyte?

@matthewd
Copy link
Contributor

@martinpovolny I assumed the temp_variable = raw @original_thing pattern was working around that?

But personally, I vote we go with the "correct" #{raw j(@foo)}, and mark FPs on Hakiri as necessary. It's a good idea to avoid questionable coding patterns if it allows us to avoid a false positive, but if the checker is getting upset with the only correct spelling, we really have no choice but to ignore it. I think this is the thing @kbrock fixed on upstream brakeman recently.

@martinpovolny
Copy link
Author

@matthewd : tried that pattern right now (see the current version of this PR) and it seems that it shows the same issue :-(

@matthewd : if you agree, I would remove the 2nd patch and ask for this being merged + exception added.

@martinpovolny martinpovolny force-pushed the dhtmlx_grid_fix branch 5 times, most recently from c7b5337 to 1a93476 Compare October 12, 2015 18:13
@dclarizio
Copy link

@martinpovolny 1 remaining Hakiri warning and a failed test in vmdb.

@martinpovolny
Copy link
Author

@dclarizio : Hakiri warning is supposed to stay there until we mark it as false positive. Rebased and restarting travis, no failures locally and the stacktrace does not match the code. Travis went crazy?

@matthewd
Copy link
Contributor

I can't explain the backtrace, or any inconsistency, but https://github.com/ManageIQ/manageiq/pull/4808/files#diff-b889b1cf33fb6736b4b3aebbb89f1196R20 sounds like it could cause that error.

@martinpovolny
Copy link
Author

@matthewd : thx, looking into it

@dclarizio
Copy link

@martinpovolny I'm pretty sure this would be related to the changes, not sure why it passes locally.

Failures:
  1) layouts/_dhtmlxgrid.html.haml when showtype is 'performance' renders
     Failure/Error: render
     ActionView::Template::Error:
       undefined method `gsub' for 1:Fixnum
     # ./app/views/layouts/_dhtmlxgrid.html.haml:15:in `_app_views_layouts__dhtmlxgrid_html_haml__1518542955181751166_605109580'
     # ./spec/views/layouts/dhtmlxgrid.html.haml_spec.rb:9:in `block (3 levels) in <top (required)>'

@miq-bot
Copy link
Member

miq-bot commented Oct 13, 2015

Checked commit martinpovolny@be0ca66 with ruby 1.9.3, rubocop 0.34.2, and haml-lint 0.13.0
0 files checked, 0 offenses detected
Everything looks good. 👍

chessbyte added a commit that referenced this pull request Oct 13, 2015
@chessbyte chessbyte merged commit e3a8eeb into ManageIQ:master Oct 13, 2015
@chessbyte chessbyte added this to the Sprint 31 Ending Oct 26, 2015 milestone Oct 13, 2015
@martinpovolny martinpovolny deleted the dhtmlx_grid_fix branch November 28, 2017 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants