Modify

Opened 23 months ago

Closed 6 months ago

Last modified 6 months ago

#10476 closed defect (fixed)

Doesn't parse "inherit" configuration file

Reported by: anonymous Owned by: rjollos
Priority: high Component: DynamicFieldsPlugin
Severity: blocker Keywords: pull-request
Cc: giursino, hasienda, rjollos Trac Release: 0.12

Description

I'm using Trac 0.12.3, and the plugin in trunk/0.11
It works on single project, but if I want to inherit settings from common settings projects it doesn't works..

On log it give me this error:

2012-10-12 12:32:56,311 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 522, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 243, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-i686/egg/dynfields/web_ui.py", line 51, in process_request
    data = {'triggers':self._get_triggers(req)}
  File "build/bdist.linux-i686/egg/dynfields/web_ui.py", line 57, in _get_triggers
    opts = Options(self.env)
  File "build/bdist.linux-i686/egg/dynfields/options.py", line 31, in __init__
    for key in parser.options('ticket-custom'):
  File "/usr/lib/python2.5/ConfigParser.py", line 241, in options
    raise NoSectionError(section)
NoSectionError: No section: 'ticket-custom'

my prj settings, trac.ini:


[inherit]
file = trac_global.ini

[logging]
log_level = INFO
log_type = file

[project]
name = xxx
url = xxx

[trac]
database = xxx

my global prj settings: trac_global.ini

...
[components]
...
dynfields.* = enabled
...

...
[header_logo]
...

[ticket-custom]
keywords.hide_always = true
...

[ticket-workflow]
...

Attachments (0)

Change History (27)

comment:1 Changed 23 months ago by giursino

  • Cc giursino added

comment:2 Changed 22 months ago by rjollos

  • Summary changed from Don't parse "inherit" configuration file to Doesn't parse "inherit" configuration file

comment:3 Changed 15 months ago by rjollos

  • Cc hasienda added

Defect confirmed and fixed for the 0.11 branch in my DynamicFieldsPlugin development branch.

I added a unit test harness, added a passing unit test for the non-inherit case, added a failing unit test for the inherit case, modified dynfields.options.Options to make the inherit case pass and then did some minor code cleanup.

robguttman: would you be okay with me pushing this to the trac-hacks SVN repository? I'll wait at least 2 weeks to hear from you before taking any action, per our trac-hacks non-maintainer commit policies.

giursino: please report back if it is working for you now.

comment:4 Changed 15 months ago by rjollos

I see now that I've just undone the change in [11655]. What is the motivation for case-sensitive option rules? There's no ticket associated with that change, so I can't find any background on it.

In general though, it feels like a bad idea to have the DynamicFieldsPlugin read case-sensitive options while the rest of Trac works with case-insensitive options.

comment:5 Changed 15 months ago by giursino

could you show me how download your patch?
thanks

comment:6 Changed 15 months ago by rjollos

I'd suggest just checking out a copy of my branch and installing from the branch.

You can obtain a copy by cloning the repository, git clone https://github.com/rjollos/trachacks.git, or downloading a zip.

Note that I made a branch of the entire trac-hacks repository, so it will take a few minutes to download.

comment:7 Changed 15 months ago by giursino

Sorry, but it's not possible to download only your plugin, instead of dowloading all??
Could you send me a link to checkout? Thanks

comment:8 Changed 15 months ago by rjollos

Unfortunately, no. It's a limitation of Git. Just checkout and delete everything except the directory with the plugin you want. The links are in comment:6.

comment:9 Changed 15 months ago by jun66j5

You can use SVN support on github for partial checkout, https://github.com/blog/626-announcing-svn-support.

$ svn co https://github.com/rjollos/trachacks/branches/dynamicfieldsplugin/dynamicfieldsplugin/0.11 $HOME/src/dynamicfieldsplugin

comment:10 Changed 15 months ago by rjollos

Thanks, Jun. That is a great feature to know about.

comment:11 Changed 15 months ago by rjollos

  • Keywords pull-request added

comment:12 Changed 15 months ago by rjollos

  • Cc rjollos added

comment:13 Changed 12 months ago by robert@…

I've just run into this problem.

Because I encountered it in a move from Trac 0.12 to Trac 1.0, it took me a long time to work out what was going on.

I've downloaded the source from the link in comment 9, and now I have a working DynamicFieldsPlugin for my new installation. Thanks to rjollos.

But now, what is the plan for getting this fix into the main plugin?

comment:14 Changed 12 months ago by rjollos

Ideally we'd get some feedback from robguttman first, particularly concerning comment:4. However, in absence of any feedback, I'll eventually just push the changes.

comment:15 Changed 12 months ago by giursino

  • Resolution set to fixed
  • Status changed from new to closed

Hi rjollos, i've tested your new version (1.2.4) present on comment 9.
It works!
Thanks a lot

Version 0, edited 12 months ago by giursino (next)

comment:16 Changed 12 months ago by rjollos

  • Resolution fixed deleted
  • Status changed from closed to reopened

Glad it is working for you, thanks for the feedback.

Let's leave the ticket open until the changes are merged to the trac-hacks repository.

comment:17 Changed 12 months ago by rjollos

  • Status changed from reopened to new

comment:18 Changed 8 months ago by rjollos

  • Owner changed from robguttman to rjollos
  • Status changed from new to accepted

comment:19 follow-up: Changed 6 months ago by rjollos

  • Resolution set to fixed
  • Status changed from accepted to closed

In 13688:

Fixes #10476: Get option values from the Configuration object in Component.env, which handles parsing of any inherited files, rather than using a Parser object to directly retrieve the configuration from the trac.ini file only. This resolves a reported defect in which the ticket-custom options from an inherited file weren't being retrieved. It also avoids a traceback when the ticket-custom section is empty.

comment:20 Changed 6 months ago by rjollos

In 13689:

Refs #10476: Some PEP-0008 changes.

comment:21 Changed 6 months ago by rjollos

In 13690:

Refs #10476: Added file headers and bumped version to 1.2.5 to account for defect fixed in #10476.

comment:22 Changed 6 months ago by rjollos

Please report back if you have a chance to test version 1.2.5.

comment:23 in reply to: ↑ 19 Changed 6 months ago by hasienda

Replying to rjollos:

In 13688:10126

I see, are you aware that you effectively reverted [11655] here? It occurred to me, just because you mentioned #10126 later on in a commit message a couple of days before that change.

comment:24 follow-up: Changed 6 months ago by rjollos

Yes, I mentioned this in comment:4.

I'm not sure why case-sensivity would be needed. If I understand the need for it, I can work on implementing it in a way that doesn't break the parse an inherited file. The tests are in place now to make sure that any future changes don't break this behavior,

comment:25 in reply to: ↑ 24 ; follow-up: Changed 6 months ago by hasienda

Replying to rjollos:

Yes, I mentioned this in comment:4.

Oh, sorry. I overlooked that, and the point you made about doing (not) same as Trac does is a good one too.

I'm not sure why case-sensivity would be needed. If I understand the need for it, I can work on implementing it in a way that doesn't break the parse an inherited file. The tests are in place now to make sure that any future changes don't break this behavior,

Great, no objections. You'll be first to know, if I find something while bringing the 0.12 branch back to life.

comment:26 in reply to: ↑ 25 ; follow-up: Changed 6 months ago by rjollos

Replying to hasienda:

Great, no objections. You'll be first to know, if I find something while bringing the 0.12 branch back to life.

I haven't been sure of the status of the 0.12 branch, other than the warning on the project page that users should steer to the 0.11 branch. The 0.12 branch appears to be primarily i18n work (log:/dynamicfieldsplugin/0.12). At some point, will all of the changes from 0.11 be merged over?

comment:27 in reply to: ↑ 26 Changed 6 months ago by hasienda

Replying to rjollos:

Replying to hasienda:

Great, no objections. You'll be first to know, if I find something while bringing the 0.12 branch back to life.

I haven't been sure of the status of the 0.12 branch, ... At some point, will all of the changes from 0.11 be merged over?

Nothing else, after I've spotted the weekness, that caused the warning.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.