Opened 5 years ago

Closed 5 years ago

# check 1.0 compatibility

Reported by: Owned by: falkb falkb normal SimpleMultiProjectPlugin normal planned Christopher Paredes, thomasd, Ryan J Ollos, Steffen Hoffmann 1.0

### Description

all necessary activities of porting to Trac-1.0

### comment:1 Changed 5 years ago by falkb

Status: new → assigned

I tried that already, and it seems the plugin comes up properly; but as I tried to add a new milestone it failed at simplemultiprojectplugin/trunk/simplemultiproject/model.py#L59 with  AttributeError  in  self.db.commit()

    def __start_transacction(self):
self.db.commit()
self.db.close()


I digged through the internet and have found evident things that this must be ported, but haven't found clear information what's exactly to do here. I keep on searching...

### comment:2 follow-up:  13 Changed 5 years ago by cnig

We do get the same error Message, if we you try to delete any project.

Python Traceback

Traceback (most recent call last):
File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 497, in _dispatch_request
dispatcher.dispatch(req)
File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 214, in dispatch
resp = chosen_handler.process_request(req)
File "build/bdist.linux-x86_64/egg/trac/admin/web_ui.py", line 125, in process_request
path_info)
self.__SmpModel.delete_project(sel)
File "build/bdist.linux-x86_64/egg/simplemultiproject/model.py", line 134, in delete_project
self.__start_transacction()
File "build/bdist.linux-x86_64/egg/simplemultiproject/model.py", line 59, in __start_transacction
self.db.commit()
File "build/bdist.linux-x86_64/egg/trac/db/util.py", line 107, in __getattr__
raise AttributeError
AttributeError


### comment:3 Changed 5 years ago by falkb

Cc: Ryan J Ollos Steffen Hoffmann added

hmm... looking at #7262 it seems to me I shell not close the db at all in 0.12 (and likely 1.0), is this true? I'm asking the gurus now. Thanks in advance.

### comment:4 Changed 5 years ago by Steffen Hoffmann

The gurus answering (huh, a bit scary - maybe we just spend more time with trial-n-error yet?):

Yes, all kinds of nastiness springs from forcing to close a db connection, and you shouldn’t need to do that. According to my experience Trac can manage that good enough on it's own. t:wiki:TracDev/DatabaseApi has most relevant references, staring with the old (0.11) db API, that is supported until Trac 1.0, but may soon be gone. At this very same place you'll see repeated recommendation like this: "again, don't call commit() by yourself." with reference to the recent db API.

I would always skip the intermediate design and use the new API for something like a 1.0 branch these days.

### comment:5 follow-up:  6 Changed 5 years ago by Ryan J Ollos

It's mainly a rehash of t:wiki:TracDev/DatabaseApi that Steffen pointed out, but there was also recently a discussion of this on the trac-dev mailing list (last few posts).

### comment:6 in reply to:  5 Changed 5 years ago by falkb

... recently a discussion ... on ... trac-dev mailing list...

Thanks, that should help now. I skipped that mails since I triage by mail subject. Actually, that Dirk was in the same situation as I am now, I read the DatabaseApi page but after that felt more stupid than before. :)

### comment:7 Changed 5 years ago by falkb

(In [12060]) bugfix (refs #10112, refs #10365): now I also experienced that unicode decode error (with new Trac-1.0), fixed with patch of AdrianFritz. Thanks

### comment:8 Changed 5 years ago by falkb

(In [12061]) bugfix (refs #10365): Trac < 0.12 must commit and close db transactions by itself. Newer versions should not at all.

### comment:9 follow-up:  10 Changed 5 years ago by falkb

seems it works now with Trac-1.0

### comment:10 in reply to:  9 Changed 5 years ago by falkb

Keywords: testing removed

seems it works now with Trac-1.0

no, I can see milestone progress bars of width=0 on the roadmap page

### comment:11 Changed 5 years ago by falkb

(In [12068]) Refs #10365: progress bar style (which is different in Trac-1.0) fixed in div tag. Patch by thomasd, thanks.

### comment:13 in reply to:  2 ; follow-up:  15 Changed 5 years ago by cnig

We do get the same error Message, if we you try to delete any project.

It works very smooth with patches in simplemultiprojectplugin-r12139.zip and trac 1.0. Thank you very much!

### comment:14 Changed 5 years ago by falkb

Keywords: testing removed → fixed assigned → closed

tested and acknowledged by cnig

### comment:15 in reply to:  13 Changed 5 years ago by falkb

It works very smooth with patches in simplemultiprojectplugin-r12139.zip and trac 1.0. Thank you very much!

cnig, thank you for your feedback!

### comment:16 Changed 5 years ago by falkb

(In [12453]) Refs #10365: ported editing of version completion time to Trac 1.0

### Modify Ticket

Change Properties