Don't pass TranslationImportQueueEntry around everywhere

Bug #607231 reported by Jeroen T. Vermeulen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

We do way too much stuff with TranslationImportQueueEntry. The approval code messes with them in murky ways, so we can't isolate and improve the code. The import code is built around queue-entry objects all the way down, so a simple test involving an import requires the $#%&@ librarian. (Plus a commit, which would be bad all in itself).

Right now the parsers for the individual file formats are expected to retrieve the file's contents from the Librarian. I'll pull that up one or two levels in the call tree so that it's easier for tests to inject text directly.

Revision history for this message
Данило Шеган (danilo) wrote :

Jeroen, I am not sure what you want to do with this bug? From my reading it should be titled something like "individual file format parsers should not work on librarian files or translation import queue entries, but on contents or file objects instead". Is my reading correct? FWIW, even that might be more complex than you anticipate, though I am not sure of that (I remember some bits were not nicely decoupled)

(I assume you *don't* want to change all things where TranslationImportQueueEntry/TIQE is being passed in)

Changed in rosetta:
status: New → Incomplete
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Not passing TIQE to the parsers is definitely one of the most important jobs I see here. But I think they should already be out of the API one or two levels up from there—think of the import methods on POTemplate and POFile.

I don't imagine any of this is easy, which is why I'm filing a bug instead of doing it right here where I run into the problem. It's basically tech debt: we have a design that obscures our data flow. I'll try at least to remove the duplicated Librarian interaction from the parser, and make it easier for a test to feed test data into the importer without firing up the Librarian.

Changed in launchpad:
status: Incomplete → Triaged
importance: Undecided → Low
tags: added: tech-debt
Revision history for this message
Данило Шеган (danilo) wrote :

The point is that the bug report like this is not very useful in itself. "There some bad code there": sure, but it won't help in knowing how to fix the problem especially since there's probably a lot of work around it. This should have originally been several bug reports instead which are more to the point. I am leaving it open just because I am lazy to worry about it.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.