Modify

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#11587 closed defect (fixed)

changeset modification only happens with path

Reported by: Scott Owned by: Ryan J Ollos
Priority: normal Component: CodeReviewerPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

If the page being retrieved is:

http://foo.com/trac/project/changeset/1981

Then I don't see the codereview information on the page.

The page has to include a path after the revision number:

http://foo.com/trac/project/changeset/1981/directory

I tried to debug and saw this for the first case:

2014-02-20 00:24:48,946 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/changeset/1981'">
2014-02-20 00:24:48,947 Trac[session] DEBUG: Retrieving session for ID 'shr'
2014-02-20 00:24:48,962 Trac[main] DEBUG: Negotiated locale: None -> en_US
2014-02-20 00:24:48,976 Trac[api] INFO: Synchronized '(default)' repository in 0.03 seconds
2014-02-20 00:24:48,977 Trac[web_ui] DEBUG: codereview pre_process_request

and this for the second (working):

2014-02-20 00:33:52,569 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/changeset/1981/diretory'">
2014-02-20 00:33:52,570 Trac[session] DEBUG: Retrieving session for ID 'shr'
2014-02-20 00:33:52,584 Trac[main] DEBUG: Negotiated locale: None -> en_US
2014-02-20 00:33:52,636 Trac[api] INFO: Synchronized '(default)' repository in 0.07 seconds
2014-02-20 00:33:52,636 Trac[web_ui] DEBUG: codereview pre_process_request

2014-02-20 00:33:53,085 Trac[main] DEBUG: Dispatching <RequestWithSession "GET '/coderev/coderev.html'">
2014-02-20 00:33:53,086 Trac[web_ui] INFO: DEBUG9 path /coderev/coderev.html

2014-02-20 00:33:53,086 Trac[session] DEBUG: Retrieving session for ID 'shr'
2014-02-20 00:33:53,100 Trac[main] DEBUG: Negotiated locale: None -> en_US
2014-02-20 00:33:53,116 Trac[api] INFO: Synchronized '(default)' repository in 0.03 seconds
2014-02-20 00:33:53,116 Trac[web_ui] DEBUG: codereview pre_process_request

2014-02-20 00:33:53,116 Trac[web_ui] DEBUG: codereview process_request

2014-02-20 00:33:53,136 Trac[chrome] DEBUG: Prepare chrome data for request

At that point I got confused. This might be the cause of #11413

Attachments (0)

Change History (7)

comment:1 Changed 10 years ago by Ryan J Ollos

I noticed this as well while working on #10834.

comment:2 Changed 10 years ago by Scott

I figured out that I could work around this issue by changing from a default repository to the new standard way of referencing repositories in Trac.

So I changed my trac.ini from this:

[trac]
repository_dir = /sysadm/svn/svip/vlab_svip_ocp
repository_type = svn

To this:

[repositories]
svn.dir = /sysadm/svn/svip/vlab_svip_ocp
svn.type = svn
svn.hidden = true
.alias = svn

Now the changeset URLs always have "svn" after the number and the plugin works. The alias also means that it redirects from the old bare URLs to the new ones.

Since I couldn't see the plugin getting called at the right times when I tried to debug, I think the bug might be in the core of Trac 1.0 and handling of old default repositories. But this was my first dive into the Trac code, so take that with a huge grain of salt.

It looks weird to call the SVN repository “svn” in the config file (by saying svn.FOO), but it reads normal from the user side: We store our code in 'svn'.

comment:3 Changed 10 years ago by Ryan J Ollos

Owner: changed from Rob Guttman to Ryan J Ollos
Status: newassigned

I'm glad you have a workaround. I'm not sure when I can get to investigating a proper fix, but I'll keep it on my prioritized list.

comment:4 Changed 9 years ago by Ryan J Ollos

#11413 closed as a duplicate.

comment:5 Changed 9 years ago by Ryan J Ollos

In 14603:

1.0.0dev: Changeset review on default repository. Refs #11587.

This adds an extra SQL statement that is likely only compatible with SQLite.

comment:6 Changed 9 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

I'm unsure of a better way to handle NULLs for repo in the CODEREVIEWER table and I'd welcome advice on that. I think the better solution may be to store the repository id in the repo table and do a JOIN when the repository name is needed, like is done in NODE_CHANGE and REVISION.

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:7 Changed 9 years ago by Ryan J Ollos

In 14678:

1.0.0dev: Store default repository as empty string. Refs #11587.

This revises [14603] and avoids the need to modify the queries to check for a NULL value. The proper fix will be to store the repository id rather than the repository name.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.