pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
Res facta quae tamen fingi potuit ([personal profile] pauamma) wrote in [site community profile] dw_dev_training2012-06-22 06:09 pm
Entry tags:

Question thread #7

It's time (more than time, actually) for another question thread!

The rules:

- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer.
purplecat: Hand Drawn picture of a Toy Cat (programming)

[personal profile] purplecat 2012-06-22 06:00 pm (UTC)(link)
I wish I had a more coherent wording for this but I find cvsreport more than a little mysterious and I suspect if I could word the question more coherently then I wouldn't have to ask it at all.

I've worked with cvs and subversion a lot and mercurial and hg a little bit so I feel I ought to be able to get a grip on what it does but I find it hard to work out how it works with dw-free, dw-non-free and dw. Sometimes, when I generate a patch with it, it seems to pull in new files added by the previous update but, a few updates later, it stops doing this.

Is there a good overview somewhere of what it compares to what, and when, and what it then does?
exor674: Computer Science is my girlfriend (Default)

[personal profile] exor674 2012-06-22 08:34 pm (UTC)(link)
What workflow are you using?

Are you editing files in $LJHOME? $LJHOME/cvs/dw-*? Do the words "mq" mean anything to you ( it's okay if they don't! )?

Secondly, we're switching to git at some point in the hopefully near future + some things that will hopefully simplify the workflow a lot.
purplecat: Hand Drawn picture of a Toy Cat (Default)

[personal profile] purplecat 2012-06-23 05:48 pm (UTC)(link)
I'm editing files in $LJHOME but I convert to a patch and then revert said patch (minus any additional stuff its picked up) at the end of any session. In theory that keeps the space clean for pulling in more updates or working on several patches at once.

mq means nothing to me.
momijizukamori: Green icon with white text - 'I do believe in phosphorylation! I do!' with a string of DNA basepairs on the bottom (Default)

[personal profile] momijizukamori 2012-06-22 10:04 pm (UTC)(link)
So this is sort of a vague general question as I don't have code examples ready to pull up, but I've been poking at styles-interface bugs (rah rah styles, etc), and I'm running into a stumbling block where I can't figure out where code is pulling or pushing info to the MySQL database. I know for pulling, we usually pull from memecache which in turn pulls from the database when it's not cached, but I have no idea how to access or change any of that info.

For example (as I do have some Bugzilla pages open), this bug. I know that the fix is to make custom text a property associated with a user account (I think in the userprops table but I need to do more database spelunking), instead of a value in the style wizard layer (which is... stored somewhere else I'm unclear on). I can't find the code that writes the data to the database, though.
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2012-06-23 12:39 am (UTC)(link)
Ohhh, I never did teach you about userprops! Fortunately the wiki documentation is pretty good there. If you're using a userprop, the whole thing is abstracted away pretty well and you don't have to worry about DB stuff.

For the rest, most things have methods in cgi-bin/LJ/User.pm (and that's the best way to abstract things: you don't call the DB directly in the page your'e writing, you call the User.pm method to call the DB, so if you ever need to change it it's only one place to change it); things that are one-offs, or have been around for ages and not converted to using that method, may have the SQL statements in the code itself, but it really shouldn't.
momijizukamori: Green icon with white text - 'I do believe in phosphorylation! I do!' with a string of DNA basepairs on the bottom (Default)

[personal profile] momijizukamori 2012-06-23 10:41 am (UTC)(link)
Good to know! Do we have seperate stuff like that for manipulating other parts of the database, like styles info? Some of the bugs I'm looking at involve the official styles rather than wizard layers or whatever (eg, the styles subcategory bug involves reading and writing s2lids to the database, probably in a new table).
exor674: Computer Science is my girlfriend (Default)

[personal profile] exor674 2012-06-23 04:20 pm (UTC)(link)
We are trying to make it so we aren't running SQL queries straight from pages ( admin pages are sometimes an exception ) and instead writing "models" for everything.

If you mean whatI think you mean, the code for that is in LJ::S2Theme, I don't recall if I actually wrote the editing code into the module or just inlined that into the admin page.
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2012-06-23 08:21 pm (UTC)(link)
That one's more complex and I don't know. :) I know the system styles are read in via update-db.pl but I don't know what else! (I am cheerfully ignorant of anything and everything S2-ish.)
foxfirefey: A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders. (geek)

[personal profile] foxfirefey 2012-06-23 12:52 am (UTC)(link)
I'm soliciting any questions folks have about Template Toolkit and routing!
exor674: Computer Science is my girlfriend (Default)

[personal profile] exor674 2012-06-23 01:03 am (UTC)(link)
GO YOU! \o/