#7812 closed enhancement (fixed)
[PATCH] Handle references between imported tickets
Reported by: | Chris Nelson | Owned by: | Chris Nelson |
---|---|---|---|
Priority: | normal | Component: | TicketImportPlugin |
Severity: | normal | Keywords: | ticket dependency subtask wbs |
Cc: | Trac Release: | 0.11 |
Description
This enhancement facilitates importing projects from Microsoft Project or similar programs by handling references to other tickets in the import such as dependencies and WBS (parent/child). Dependencies work well with the MasterTicket plugin. I know of no good support for parent/child tasks yet.
For example:
summary | #blockedby | #wbs |
Design schematic | 1 | |
Layout board | 1 | 2 |
Check board | 2 | 2.1 |
Manufacture prototypes | 2,3 | 2.2 |
Prototype verification | 4 | 3 |
Once imported, this list might become:
id | summary | blockedby | wbs |
3000 | Design schematic | ||
3001 | Layout board | 3000 | |
3003 | Check board | 3001 | 3001 |
3004 | Manufacture prototypes | 3001,3003 | 3001 |
3005 | Prototype verification | 3004 |
This is provided in several patches which first change some plugin code to facilitate the enhancement, then add dependency support, then add WBS support. Each patch depends on those before it but can be used without those after it.
Attachments (9)
Change History (27)
Changed 14 years ago by
Attachment: | typo.patch added |
---|
Changed 14 years ago by
Attachment: | modified_list.tgz added |
---|
Keep a list of added, modified tickets, count at end.
Changed 14 years ago by
Attachment: | form_reorg.patch added |
---|
Move form to top of page. (Experienced users don't need the details every time.)
Changed 14 years ago by
Combined patch (all of the other changes in one file).
comment:1 Changed 14 years ago by
Sorry for the compressed tar files but when I tried to upload a couple of my patches, TH complained about "blacklisted patterns" in the text.
Changed 14 years ago by
Revised comprehensive patch (with new WBS changes)
comment:2 follow-ups: 4 5 Changed 14 years ago by
Owner: | changed from François Granade to Chris.Nelson@… |
---|
I'd love to take your patch ! however, could i ask you to add a few tests ?
It should be easy - see for example [9725] for fix that has a test...
If you want I can make you committer if it's easier for you.
comment:3 Changed 14 years ago by
Summary: | Handle references between imported tickets → [PATCH] Handle references between imported tickets |
---|
comment:4 Changed 14 years ago by
comment:5 Changed 14 years ago by
comment:6 Changed 14 years ago by
Hello Chris
the .ctl (control) file(s) are simply copies of the .out (output) file(s) generated by each test. The idea is: when you are happy with the output that you see when importing the file manually in your Trac instance, you just run the test(s) from the command line, and you rename or copy the .out file to .ctl, and then commit the .ctl. When rerunning the tests, the .ctl files will be compared with .out file generated, to ensure the result is the same.
Note that since the output aren't exactly the same on 0.11 and 0.12, there are two sets of control files: if possible at leat commit them for 0.11
Hope it helps
comment:7 Changed 13 years ago by
Owner: | changed from Chris.Nelson@… to Chris Nelson |
---|---|
Reporter: | changed from Chris.Nelson@… to Chris Nelson |
comment:8 Changed 12 years ago by
Hi, could you please update the patch? The current SVN revision isn't patchable:
... The text leading up to this was: -------------------------- |diff --git a/0.11/talm_importer/importer.py b/0.11/talm_importer/importer.py |index 6bcbdb9..e16d003 100644 |--- a/0.11/talm_importer/importer.py |+++ b/0.11/talm_importer/importer.py -------------------------- File to patch: talm_importer/importer.py patching file talm_importer/importer.py Hunk #1 succeeded at 203 (offset 12 lines). Hunk #2 succeeded at 259 (offset 12 lines). Hunk #3 succeeded at 325 (offset 17 lines). Hunk #4 FAILED at 369. 1 out of 4 hunks FAILED -- saving rejects to file talm_importer/importer.py.rej can't find file to patch at input line 71 Perhaps you used the wrong -p or --strip option? ... patching file talm_importer/templates/importer.html Hunk #1 succeeded at 31 with fuzz 2. Hunk #3 FAILED at 110. 1 out of 3 hunks FAILED -- saving rejects to file talm_importer/templates/import er.html.rej ...
comment:9 Changed 12 years ago by
Patch updated in all.3.tgz -- should work now on the 0.11 branch (which also works on 0.12).
Chris, as soon as you have a little bit of tests on this, I'll be glad to apply the patch.
Changed 12 years ago by
comment:10 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Actually, I ended up applying the patch to the 0.11 branch - in [11745]. It may not work 100% correctly but it's not breaking anything. Marking this as fixed, even though I'd glad to have tests...
comment:12 Changed 12 years ago by
Nope, doesn't work:
KeyError: u'#blockedby'
callstack is:
Datei "build/bdist.win32/egg/trac/web/main.py", Zeile 511, in _dispatch_request dispatcher.dispatch(req) Datei "build/bdist.win32/egg/trac/web/main.py", Zeile 237, in dispatch resp = chosen_handler.process_request(req) Datei "build/bdist.win32/egg/talm_importer/importer.py", Zeile 78, in process_request encoding=req.session['importer.encoding']) Datei "build/bdist.win32/egg/talm_importer/importer.py", Zeile 122, in _do_preview return self._process(filereader, get_reporter_id(req), PreviewProcessor(self.env, req)) Datei "build/bdist.win32/egg/talm_importer/importer.py", Zeile 389, in _process relativeticketvalues.append(dict([(f, row['#'+f]) for f in relativeticketfields]))
comment:13 follow-up: 14 Changed 12 years ago by
it seems it's because the .xls file uses '#BlockedBy' instead of '#blockedby' ...although the docs say it shouldn't matter.
comment:14 follow-up: 15 Changed 12 years ago by
Replying to falkb:
it seems it's because the .xls file uses '#BlockedBy' instead of '#blockedby' ...although the docs say it shouldn't matter.
I can't find where it's written in the doc, could you point me to it ? I doesn't seem easy to fix in the code, so I'd rather fix the docs...
comment:15 follow-up: 16 Changed 12 years ago by
Replying to farialima:
I can't find where it's written in the doc, could you point me to it ? I doesn't seem easy to fix in the code, so I'd rather fix the docs...
I asked the user and it turns out he has read it on the web page displayed when one clicks on mainnav menu item "Import". The text says:
"...The fields must be Trac fields. The valid fields for this Trac instance are: ticket or id, summary, reporter, ...snip... , blockedby, blocking, ...snip... and . Field names are case-insensitive: 'summary', 'Summary', 'SUMMARY' refer to the same field. ..."
comment:16 Changed 12 years ago by
Replying to falkb:
Replying to farialima:
I can't find where it's written in the doc, could you point me to it ? I doesn't seem easy to fix in the code, so I'd rather fix the docs...
I asked the user and it turns out he has read it on the web page displayed when one clicks on mainnav menu item "Import". The text says:
"...The fields must be Trac fields. The valid fields for this Trac instance are: ticket or id, summary, reporter, ...snip... , blockedby, blocking, ...snip... and . Field names are case-insensitive: 'summary', 'Summary', 'SUMMARY' refer to the same field. ..."
It seems likely that the main plugin downcases field names and my patch fails to.
comment:17 Changed 12 years ago by
Actually, I ended up fixing this issue with the case - in [11758] - now things should work correctly no matter the case of the field name.
comment:18 Changed 12 years ago by
Cool, the preview says everything is OK now, though due other reasons we haven't completed the import yet. Gonna report the result as soon as done...
Fix a typo in a comment