/srv/irclogs.ubuntu.com/2013/09/12/#launchpad-dev.txt

StevenKwgrant: So, JavaScript and microservices?05:48
wgrantStevenK: Have you repushed the JS branch?05:48
StevenKwgrant: Yeah, the .set() changes have been up since I started on destroying PF, I've just forgotten to ping05:50
wgrantAh05:52
wgrantStevenK: Have you tested person names with special characters such as .?05:55
wgrantAnd some of that code still uses appendChild excessively, which makes it pretty unreadable and slow when compared to code that creates the complex structure in a single Y.Node.create05:55
wgrant(eg. the bit under draft === true)05:56
wgrantI think it creates a <tr><td></td><td><td><div><span></span></div></div></td></tr>, but that would be much clearer if created as a single object.05:57
StevenKwgrant: Converting that bit to using .set() almost forced my brain out of my ears to begin with05:57
wgrantThere were at least two mistakes in there.05:58
StevenKwgrant: One two many <td>'s, and there's a missing <div>05:58
StevenKOne too, even05:58
wgrantStevenK: You only need to set two IDs, which should be pretty trivial.05:58
StevenKwgrant: Sure, but I want the outer div05:59
wgrantnode.one('tr > td > div') or use a class05:59
StevenKHm, yeah05:59
StevenKwgrant: So newrow = Y.Node.create('{everything}'); and then two lines to call .one().set() ?06:00
wgrantStevenK: I think that's a lot clearer, yeah06:01
wgrantYou can see the structure06:01
wgrantAnd easily see what dynamic bits you're adding06:01
wgrantAnd it's faster.06:01
StevenKwgrant: Let me polish off dealing with this e-mail, and I'll change draft === true06:02
StevenKwgrant: http://pastebin.ubuntu.com/6095769/06:24
wgrantStevenK: That looks superior.06:28
StevenKHmmm, newone.one('tr') is null :-(06:31
wgrantStevenK: Isn't that the node itself?06:36
wgrantSo finding a tr child is not going to be terribly effective.06:36
wgrants/child/descendant/06:36
StevenKYeah, I came to that realisation about 45 seconds ago06:36
StevenKwgrant: Still not sure what to do about dots in names06:43
wgrantStevenK: dots are fine in IDs, but then you're using CSS selector syntax to find them, which will fail.06:46
StevenKSo I should switch to person.id ?06:46
wgrantWe don't usually expose person IDs.06:47
wgrantThat's one possibility, but you could also just not use Node.one() to find them06:47
StevenKAnd do what instead?06:48
wgrantFetch them directly by ID, rather than a CSS selector under a node06:49
wgrantRecall that IDs are globally unique.06:49
stubNo quoting or escaping mechanism?06:49
wgrantOne could also quote them, but it's not necessary here.06:49
StevenKHmm06:50
Ursinhawgrant, should I move all checks in publishRosettaTranslations to RosettaTranslationsUpload or moving away the part that creates the job is enough?07:18
wgrantUrsinha: I think it makes sense to move the whole lot, for consistency.07:19
Ursinhawgrant, right.07:19
wgrantThe custom upload types are fundamentally different in that rosetta translations don't get extracted, but we should still keep the code as similar as is practical.07:20
Ursinhawgrant, so I could move it to a _publishRosettaCustom or something, should have the same effect and will keep publishRosettaTranslations consistent with the rest07:24
Ursinhainstead of moving the checks to RosettaTranslationsCustom, I mean07:24
Ursinhain the end it's your call anyway07:29
Ursinha:)07:29
wgrantUrsinha: Sorry, let me see.07:33
wgrantUrsinha: Ah, I see. We obviously can't use _publishCustom for this, as that assumes we're extracting a file. So I'd just move the contents of publishRosettaTranslations to new function in lp.archivepublisher.rosetta_translations and call that directly in publishRosettaTranslations.07:36
wgrantSince we don't need the extra tempfile/cleanup behavior that _publishCustom provides07:36
Ursinhawgrant, I thought we could avoid having to import a lot of things to do the checks in lp.archivepublisher.rosetta_translations when we already have it all in queue.py :) I was suggesting move the checks to a _publishRosettaCustom instead07:38
wgrantUrsinha: I think it's probably still slightly nicer to have it encapsulated in the other module like the rest, rather than inline in queue.py.07:39
wgrantBut I don't care too much.07:39
Ursinhabecause _publishCustom prepares and runs the process_* methods, so I thought it would make sense to have the checks before process_rosetta_translations as well07:40
wgrant_publishCustom doesn't do sanity checks, though07:40
Ursinhaindeed07:40
wgrantIt just prepares the temporary file in a generic way, without doing anything type-specific.07:41
Ursinhayeah, the sanity checks are all in CustomUpload.process...07:41
Ursinhaokay, I'll move it all :)07:41
wgrantSounds good.07:42
Ursinhawgrant, should I also add tests for this change in lp.soyuz.tests.test_distroseriesqueue_rosetta_translations.py?09:19
cjwatsonIIRC the archivepublisher tests are unit tests and the soyuz.tests.test_distroseriesqueue tests are kind of integration tests.09:26
Ursinharight09:40
=== frankban__ is now known as frankban
wgrantUrsinha: I believe cjwatson is correct. The tests for the other custom uploads aren't a completely terrible example, IIRC10:21
cjwatsonYeah, I think I beat them into shape in the last big refactoring10:22
cjwatsonLooks like I converted them from doctests10:22
wgrantYeah10:23
wgrantThey used to be one or two doctests each10:23
=== frankban__ is now known as frankban
=== frankban_ is now known as frankban
=== frankban_ is now known as frankban
=== lifeless_ is now known as lifeless

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!