Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Class Parameters, Performance tuning #142

Closed
wants to merge 6 commits into from

5 participants

@fhrbek

This is a new pull request for class parameters and performance tuning, this time based on the correct origin.

@sodabrew
Owner

Thanks, the diffs look a lot better! Time to start reading code :)

@sodabrew
Owner

Does this enable the ENC yaml output for parameterized classes? Yes, that's exactly what it does. Very cool! According to http://docs.puppetlabs.com/guides/external_nodes.html#enc-output-format all puppet clients of this dashboard would have to be running Puppet 2.6.5 or higher.

@haus

@sodabrew just the master needs to be of that version to parse the enc. clients of the master need to be no more than one major release behind the master, however.

@sodabrew
Owner

Ok, cool. I'm not on top of this changeset yet, but looking at it next.

@fhrbek Could you squash some of the commits together? In particular I think 17900 and 17901 should meld into 17899.

@fhrbek

@sodabrew I can do that but is it necessary? Current commits match redmine issues. Let me know if you want to squash them anyway.

@sodabrew
Owner

Oh, I didn't catch that they were redmine issues. Lemme take a look... Well, it looks like there are three major things happening:

  • Class parameters
  • Better conflict resolution (does this also improve group-group parameter conflicts?)
  • Update jQuery plugin
@fhrbek

Yes, group conflicts are also handled.
There's yet another fixed issue regarding performance with large data - I found out that using OpenStruct is a performance killer so I changed them to ruby hashes (much much faster).
What we did not finish was the design - now we have two different kinds of pop-ups - alerts and rendered windows (which need more attention regarding styling). We need to hear some opinion and then finish this part (e.g. unify all pop-ups as rendered windows and get them designed by a real designer which is something I'd recommend rather than using ugly alerts).

@sodabrew
Owner

Ok, so there are at least four things going on ;) Let's leave it as-is then.

Are you entirely removing OpenStruct? I was wondering about what benefit it provides vs. Hashes. Maybe better behavior on older Ruby 1.8's? I don't have a sense of the risk for this speed benefit.

Re: popups: I'm generally a fan of the Rails 'flash' popups, they provide a consistent CSS interface to provide styling.

May I ask you to attach some cropped screenshots to this PR?

@fhrbek

OpenStruct: I have no idea if there is any other benefit than convenient calls of methods instead of addressing items by keys but it does not seem like too much added value to me. Basically I got rid of all of OpenStructs that were related to potentially large data in the model. You can check very easily if you browse changes for that commit (only OpenStruct refactoring and a single DB migration for indexing foreign keys are related to this ticket/commit).

Popups: What's a "Rails 'flash' popup"?

Here are examples of current (quite ugly) popups in the dashboard:

Alert Popup
Rendered Popup

@fhrbek

Fixes for failing specs are now resubmitted as a new pull request:
#157

@sodabrew
Owner

@fhrbek Next piece of low-hanging fruit to merge: let's pick a jquery-placeholder. I found many implementations, and just want to make sure we're picking the "best" one. Let's do a separate PR for just that change. My goal is to have the merge PR for class parameters be very focused on just this feature :)

http://code.google.com/p/jquery-placeholder-js/source/browse/trunk/jquery.placeholder.1.3.js
http://www.iliadraznin.com/2011/02/jquery-placeholder-plugin/
http://demo.frugalcoder.us/files/jquery.placeholder-1.1.9.js.txt
https://github.com/andrewrjones/jquery-placeholder-plugin
https://github.com/mathiasbynens/jquery-placeholder
https://github.com/danielstocks/jQuery-Placeholder

@fhrbek
@sodabrew
Owner

Huge thank you for the thorough review of these options!!

For the options that require initialization, we can put a self-initializing piece of JS at the bottom of the script file. For the one that requires CSS changes, that's less attractive. Maybe we can adjust the script to use our existing CSS? I'll take a look at this over the weekend or next week.

@fhrbek

One more thing to investigate - we used prototype's ajax in our implementation in the class_parameters branch. I noticed that you got rid of this library in your rails3 branch. Perhaps replacing prototype's ajax calls with jquery's ajax calls would be compatible with jquery placeholder implementations. I can look into it if you like.

@sodabrew
Owner

Yes, using jQuery's ajax would be better.

By the way, could you rebase your branch once more off current master? You should be able to drop the spec fixes commit out of the way, and also split out the placeholder commit as a separate PR.

@sodabrew
Owner

Definitely time for a rebase to master! :)

@sodabrew
Owner

@fhrbek please rebase from master when you have some time! :)

@fhrbek
@stahnma

I theoretically love this pull request. Fillip, I hope you get some time very soon to rebase. This would be an awesome addition to Dashboard 1.3. @khussey -- wanted to add this back on your radar.

@puppetcla

CLA Signed by fhrbek on 2013-01-07 21:00:00 -0800

@sodabrew sodabrew referenced this pull request
Merged

Class Parameters #198

@sodabrew sodabrew closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.