Modify

Opened 6 years ago

Last modified 6 years ago

#331 assigned enhancement

Update to work with Apache Bloodhound

Reported by: gary.martin@… Owned by: bas
Priority: major Milestone:
Component: email2trac Version: 2.7.0
Keywords: bloodhound Cc:

Description

Hi Bas,

Glad to see you noticed the associated thread on the bloodhound dev mailing list.

A bit ago bloodhound made some changes that I believe breaks the previous compatibility with email2trac. I have created a patch that gives some hints for how support for bloodhound might be provided with some limited detection of a bloodhound environment to provide some safety. At the moment I think I have only included the ability to specify a bloodhound product on the command line.

Attachments (1)

bloodhound_compat.diff (3.7 KB) - added by gary.martin@… 6 years ago.

Download all attachments as: .zip

Change History (11)

Changed 6 years ago by gary.martin@…

comment:1 Changed 6 years ago by bas

  • Keywords bloodhound added
  • Status changed from new to assigned

Thanks for the patch i will examine it and release a new version if this is the way to go for bloodhound.

comment:2 follow-up: Changed 6 years ago by gary.martin@…

Thanks for looking at this. I won't try to claim that it is a complete solution but at worst it shows a number of ways to determine whether you are dealing with an Apache Bloodhound installation. Without going through the bloodhound libraries, tickets will not be assigned an id within a product which will cause problems for users.

I think in principle we should also add knowledge of a few more forms for referring to tickets but I think that is probably a task for another ticket.

What I am not so sure of is how it is best to allow users to dynamically select the bloodhound product if this is desired. While for some people specifying configuration sections per product might be fine, others may prefer to be able to choose product without having to adjust the configuration as products are added.

What do you think?

comment:3 in reply to: ↑ 2 ; follow-up: Changed 6 years ago by bas

What I am not so sure of is how it is best to allow users to dynamically select the bloodhound product if this is desired. While for some people specifying configuration sections per product might be fine, others may prefer to be able to choose product without having to adjust the configuration as products are added.

What do you think?

Gary i am not familiar with the bloodhound terminology (yet). What are products? In email2trac.conf there is default section. This sectio holds global settings can be overrriden in the trac project sections.

[DEFAULT]
parentdir: /data/trac/oss/projects

[email2trac]
debug: 1

[pbs-python]
project: /data/trac/pbs_python/project

comment:4 in reply to: ↑ 3 Changed 6 years ago by gary.martin@…

Replying to bas:

What I am not so sure of is how it is best to allow users to dynamically select the bloodhound product if this is desired. While for some people specifying configuration sections per product might be fine, others may prefer to be able to choose product without having to adjust the configuration as products are added.

What do you think?

Gary i am not familiar with the bloodhound terminology (yet). What are products?

No problem.. I didn't expect you to be familiar.

Products are our means of allowing multi-product functionality, though clearly with a slightly different name! So each product has its own tickets, milestones, versions, etc and in some ways acts as a distinct trac environment. Tickets, while keeping their globally unique id, also get an independent id within the product and it is these differences that my patch looks to fix.

In email2trac.conf there is default section. This sectio holds global settings can be overrriden in the trac project sections.

[DEFAULT]
parentdir: /data/trac/oss/projects

[email2trac]
debug: 1

[pbs-python]
project: /data/trac/pbs_python/project

Yes, that makes sense and if you were to add a

[prod1]
product: prod1

to explicitly set the product prefix to select, that should be a very good start. I only went as far as providing the command line options.

One thing that I have specifically kept back in the patch is the ability to set the product through the topic (e.g. summary #?owner=someone&product=prod1). This may be misguided as it should be entirely possible and maybe even desired. At the moment, the only restriction would be that you should not attempt to change the product to which the ticket belongs. That is an ability that bloodhound may add later.

comment:5 Changed 6 years ago by bas

In 645:

added bloodhoiund support, thanks to Gary Martin from wandisco, see #331

comment:6 Changed 6 years ago by bas

Can somenody test it. You can specify it on the command line:

  • -B <name>
  • email2trac.conf
    [email2trac]
    project: /data/trac/test/project/e2t
    bh_product: iets
    ...
    

comment:7 Changed 6 years ago by bas

In 650:

added bloodhound comments to Changelog, see #331

comment:8 Changed 6 years ago by ybendana@…

I'm having trouble setting the product for a ticket. I'm using email2trac 2.8 and Postfix on CentOS 6.4. I put this line in /etc/aliases:

bhtrac: "|/usr/local/bin/email2trac --project=testtrac --bh_product=Default"

I put this in email2trac.conf:

[testtrac] project: /src/apache-bloodhound-0.7/installer/bloodhound/environments/main bh_product: Default component: component1 python_egg_cache: /tmp

I then run the test:

email2trac -d --project=testtrac --bh_product=Default < msg.txt

In the debug output I don't see the product getting set. I see a ticket created in Bloodhound but the product is not set. The ticket link is wrong and I can't access it. What am I missing?

comment:9 Changed 6 years ago by bas

Thanks for the report. I do not have bloodhound installed. So it is difficult for me to test it. I will install it and do some tests. Can you attach your debug output, maybe it is something trivial to fix.

comment:10 Changed 6 years ago by ybendana@…

Thanks for responding (by the way I'm not getting a notification when this ticket updates). Here is the debug output (also used "-B Default" with same result):

$ sudo -u apache /usr/local/bin/email2trac --project=bloodhound -d -E /var/www/apache-bloodhound-0.7/installer/bloodhound --bh_product Default < /tmp/msg.txt 2014-02-28 14:41:04,584 email2trac main: Found trac version: 1.0 2014-02-28 14:41:04,585 email2trac main: Found Bloodhound Distribution 2014-02-28 14:41:04,585 email2trac main: Loading environment /var/www/apache-bloodhound-0.7/installer/bloodhound/environments/main 2014-02-28 14:41:04,957 email2trac main: Main function parse 2014-02-28 14:41:04,962 email2trac main: saving email to /tmp/tmpdq3lw1.main.email2trac 2014-02-28 14:41:04,964 email2trac main: function get_message_parts() 2014-02-28 14:41:04,964 email2trac main: Message part: Main-Type: multipart 2014-02-28 14:41:04,964 email2trac main: Message part: Content-Type: multipart/mixed 2014-02-28 14:41:04,964 email2trac main: Skipping multipart container 2014-02-28 14:41:04,964 email2trac main: Message part: Main-Type: text 2014-02-28 14:41:04,964 email2trac main: Message part: Content-Type: text/plain 2014-02-28 14:41:04,964 email2trac main: function inline_part() 2014-02-28 14:41:04,965 email2trac main: function email_to_unicode 2014-02-28 14:41:04,965 email2trac main: unicode filename: None 2014-02-28 14:41:04,965 email2trac main: raw filename: None 2014-02-28 14:41:04,965 email2trac main: function inline_properties 2014-02-28 14:41:04,966 email2trac main: Message part: Main-Type: text 2014-02-28 14:41:04,966 email2trac main: Message part: Content-Type: text/plain 2014-02-28 14:41:04,966 email2trac main: function inline_part() 2014-02-28 14:41:04,966 email2trac main: function email_to_unicode 2014-02-28 14:41:04,966 email2trac main: unicode filename: basje.txt 2014-02-28 14:41:04,966 email2trac main: raw filename: 'basje.txt' 2014-02-28 14:41:04,966 email2trac main: function inline_properties 2014-02-28 14:41:04,966 email2trac main: function unique_attachment_names() 2014-02-28 14:41:04,966 email2trac main: function get_body_text() 2014-02-28 14:41:04,966 email2trac main: function debug_body: 2014-02-28 14:41:04,967 email2trac main: writing body to /tmp/tmpdq3lw1.main.email2trac.body 2014-02-28 14:41:04,967 email2trac main: function debug_attachments 2014-02-28 14:41:04,967 email2trac main: function get_sender_info 2014-02-28 14:41:04,967 email2trac main: function email_to_unicode 2014-02-28 14:41:04,967 email2trac main: email name: Bas van der Vlies, email address: ybendana@… 2014-02-28 14:41:04,968 email2trac main: get_sender_info: found registered user: ybendana 2014-02-28 14:41:04,968 email2trac main: function email_header_acl: white_list 2014-02-28 14:41:04,968 email2trac main: white_list not defined, all messages are allowed. 2014-02-28 14:41:04,968 email2trac main: function email_header_acl: black_list 2014-02-28 14:41:04,968 email2trac main: function email_header_acl: recipient_list 2014-02-28 14:41:04,968 email2trac main: recipient_list not defined, all messages are allowed. 2014-02-28 14:41:04,968 email2trac main: function spam 2014-02-28 14:41:04,968 email2trac main: function spam 2014-02-28 14:41:04,968 email2trac main: function email_to_unicode 2014-02-28 14:41:04,968 email2trac main: subject: u'Test123' 2014-02-28 14:41:04,968 email2trac main: function parse_delivered_to_field 2014-02-28 14:41:04,968 email2trac main: function parse_subject_header 2014-02-28 14:41:04,969 email2trac main: function ticket_update_by_subject 2014-02-28 14:41:04,969 email2trac main: function new_ticket 2014-02-28 14:41:04,974 email2trac main: function set_cc_fields 2014-02-28 14:41:04,974 email2trac main: function set_ticket_fields 2014-02-28 14:41:04,974 email2trac main: trac[summary] = 2014-02-28 14:41:04,974 email2trac main: trac[reporter] = 2014-02-28 14:41:04,974 email2trac main: trac[owner] = < default > 2014-02-28 14:41:04,974 email2trac main: used owner = < default > 2014-02-28 14:41:04,974 email2trac main: trac[description] = 2014-02-28 14:41:04,974 email2trac main: trac[type] = defect 2014-02-28 14:41:04,974 email2trac main: used type = defect 2014-02-28 14:41:04,974 email2trac main: trac[status] = 2014-02-28 14:41:04,974 email2trac main: trac[priority] = major 2014-02-28 14:41:04,975 email2trac main: used priority = major 2014-02-28 14:41:04,975 email2trac main: trac[product] = 2014-02-28 14:41:04,975 email2trac main: trac[milestone] = 2014-02-28 14:41:04,975 email2trac main: trac[component] = 2014-02-28 14:41:04,975 email2trac main: trac[version] = 2014-02-28 14:41:04,975 email2trac main: trac[resolution] = None 2014-02-28 14:41:04,975 email2trac main: trac[keywords] = 2014-02-28 14:41:04,975 email2trac main: trac[cc] = 2014-02-28 14:41:04,975 email2trac main: trac[time] = 2014-02-28 14:41:04,975 email2trac main: trac[changetime] = 2014-02-28 14:41:04,975 email2trac main: function update_ticket_fields 2014-02-28 14:41:04,975 email2trac main: user_field owner = < default > 2014-02-28 14:41:04,975 email2trac main: ticket_field owner = < default > 2014-02-28 14:41:04,976 email2trac main: user_field priority = major 2014-02-28 14:41:04,976 email2trac main: ticket_field priority = major 2014-02-28 14:41:04,976 email2trac main: user_field type = defect 2014-02-28 14:41:04,976 email2trac main: ticket_field type = defect 2014-02-28 14:41:04,976 email2trac main: function get_message_parts() 2014-02-28 14:41:04,976 email2trac main: Message part: Main-Type: multipart 2014-02-28 14:41:04,976 email2trac main: Message part: Content-Type: multipart/mixed 2014-02-28 14:41:04,976 email2trac main: Skipping multipart container 2014-02-28 14:41:04,976 email2trac main: Message part: Main-Type: text 2014-02-28 14:41:04,976 email2trac main: Message part: Content-Type: text/plain 2014-02-28 14:41:04,976 email2trac main: function inline_part() 2014-02-28 14:41:04,976 email2trac main: function email_to_unicode 2014-02-28 14:41:04,976 email2trac main: unicode filename: None 2014-02-28 14:41:04,976 email2trac main: raw filename: None 2014-02-28 14:41:04,977 email2trac main: function inline_properties 2014-02-28 14:41:04,977 email2trac main: Message part: Main-Type: text 2014-02-28 14:41:04,977 email2trac main: Message part: Content-Type: text/plain 2014-02-28 14:41:04,977 email2trac main: function inline_part() 2014-02-28 14:41:04,977 email2trac main: function email_to_unicode 2014-02-28 14:41:04,977 email2trac main: unicode filename: basje.txt 2014-02-28 14:41:04,977 email2trac main: raw filename: 'basje.txt' 2014-02-28 14:41:04,977 email2trac main: function inline_properties 2014-02-28 14:41:04,977 email2trac main: function unique_attachment_names() 2014-02-28 14:41:04,977 email2trac main: function get_body_text() 2014-02-28 14:41:05,017 email2trac main: function attach_attachments() 2014-02-28 14:41:05,018 email2trac main: function mail_workflow: 2014-02-28 14:41:05,018 email2trac main: function notify()

Here is the Bloodhound log output:

2014-02-28 14:41:04,992 Trac[whoosh_backend] DEBUG: Doc to index: {'status': u'new', 'product': u'empty', 'name': u'#3 3', 'author': u'ybendana', '_stored_name': u'3', 'query_suggestion_basket': u'#3 3 Test1234 Test1234 --- As of 1 January 2013, SARA has a new name: SURFsara. Bas van der Vlies Operations, Support & Development SURFsara Science Park 140 1098 XG Amsterdam T +31 (0) 20 592 30 00 bas.vandervlies@… www.surfsara.nl test123 test1234 Test123', 'milestone': u'empty', 'component': u'component1', 'summary': u'Test123', 'content': u'Test1234 Test1234 --- As of 1 January 2013, SARA has a new name: SURFsara. Bas van der Vlies Operations, Support & Development SURFsara Science Park 140 1098 XG Amsterdam T +31 (0) 20 592 30 00 bas.vandervlies@… www.surfsara.nl test123 test1234', 'required_permission': u'TICKET_VIEW', 'time': datetime.datetime(2014, 2, 28, 22, 41, 4, 978040), 'owner': u'somebody', 'type': u'ticket', 'id': u'3', 'unique_id': u'empty:ticket:3'}

Add Comment

Modify Ticket

Change Properties
Action
as assigned The owner will remain bas.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from bas to the specified user. Next status will be 'new'.
Author


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

 
Note: See TracTickets for help on using tickets.