Module::Install and RTxInitDB

Hi - I’m working on Ruslan’s RT::Extension::RepliesToResolved extension, and I’ve reached the point where I’m writing some Scrips for it. I’ve created an etc/initialdata file, but now when I try to run perl Makefile.PL I get:

23:39:54 tim@canopus:~/git/rt-extension-repliestoresolved$ perl Makefile.PL
Using RT configuration from /Users/tim/git/rt/lib/RT.pm:
./etc => /Users/tim/git/rt/local/plugins/RT-Extension-RepliesToResolved/etc
./lib => /Users/tim/git/rt/local/plugins/RT-Extension-RepliesToResolved/lib
The ‘RTxInitDB’ method does not exist in the ‘inc’ path!
Please remove the ‘inc’ directory and run Makefile.PL again to load it.

Following the instructions at the end gets me to a worse place:

Can’t locate inc/Module/Install.pm in @INC

Do I need a particular updated version of Module::Install from somewhere?

Tim

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

Hi - I’m working on Ruslan’s RT::Extension::RepliesToResolved extension, and I’ve reached the point where I’m writing some Scrips for it. I’ve created an etc/initialdata file, but now when I try to run perl Makefile.PL I get:

23:39:54 tim@canopus:~/git/rt-extension-repliestoresolved$ perl Makefile.PL
Using RT configuration from /Users/tim/git/rt/lib/RT.pm:
./etc => /Users/tim/git/rt/local/plugins/RT-Extension-RepliesToResolved/etc
./lib => /Users/tim/git/rt/local/plugins/RT-Extension-RepliesToResolved/lib
The ‘RTxInitDB’ method does not exist in the ‘inc’ path!
Please remove the ‘inc’ directory and run Makefile.PL again to load it.

Following the instructions at the end gets me to a worse place:

Can’t locate inc/Module/Install.pm in @INC

Do I need a particular updated version of Module::Install from somewhere?

Make sure Module::Install::RTx is installed from CPAN.

You also probably need to tell Module::Install that you’re an “author”
now for that dist and you want it to do author-y things that it won’t
normally do for end users just installing.

mkdir -p inc/.author
perl Makefile.PL

should repopulate inc/.

Hi - I’m working on Ruslan’s RT::Extension::RepliesToResolved extension, and I’ve reached the point where I’m writing some Scrips for it. I’ve created an etc/initialdata file, but now when I try to run perl Makefile.PL I get:

23:39:54 tim@canopus:~/git/rt-extension-repliestoresolved$ perl Makefile.PL
Using RT configuration from /Users/tim/git/rt/lib/RT.pm:
./etc => /Users/tim/git/rt/local/plugins/RT-Extension-RepliesToResolved/etc
./lib => /Users/tim/git/rt/local/plugins/RT-Extension-RepliesToResolved/lib
The ‘RTxInitDB’ method does not exist in the ‘inc’ path!
Please remove the ‘inc’ directory and run Makefile.PL again to load it.

Following the instructions at the end gets me to a worse place:

Can’t locate inc/Module/Install.pm in @INC

Do I need a particular updated version of Module::Install from somewhere?

Never mind - found it. Needed Module::Install::RTx installed. That seems to have sorted it.

Tim

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

Hi - I’m working on Ruslan’s RT::Extension::RepliesToResolved extension, and I’ve reached the point where I’m writing some Scrips for it. I’ve created an etc/initialdata file, but now when I try to run perl Makefile.PL I get:

23:39:54 tim@canopus:~/git/rt-extension-repliestoresolved$ perl Makefile.PL
Using RT configuration from /Users/tim/git/rt/lib/RT.pm:
./etc => /Users/tim/git/rt/local/plugins/RT-Extension-RepliesToResolved/etc
./lib => /Users/tim/git/rt/local/plugins/RT-Extension-RepliesToResolved/lib
The ‘RTxInitDB’ method does not exist in the ‘inc’ path!
Please remove the ‘inc’ directory and run Makefile.PL again to load it.

Following the instructions at the end gets me to a worse place:

Can’t locate inc/Module/Install.pm in @INC

Do I need a particular updated version of Module::Install from somewhere?

Make sure Module::Install::RTx is installed from CPAN.

You also probably need to tell Module::Install that you’re an “author”
now for that dist and you want it to do author-y things that it won’t
normally do for end users just installing.

mkdir -p inc/.author
perl Makefile.PL

should repopulate inc/.

Aha - thanks for that. Worked out I needed another Module::Install extension too… got where I needed to go now, and pushed my branches (one for a tiny patch to RT itself needed for the module to work correctly) and one for the module back up to github for Ruslan to look at – or indeed anyone else who’s interested.

Tim

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

Aha - thanks for that. Worked out I needed another Module::Install
extension too… got where I needed to go now, and pushed my branches
(one for a tiny patch to RT itself needed for the module to work
correctly) and one for the module back up to github for Ruslan to look
at – or indeed anyone else who’s interested.

Ah, neat, you implemented the time-based limitation that I wanted (I’m
judging from the branch name, I haven’t had time to full review the
code yet).

I’d be interested to see the bug report / pull request that you needed
to make it work with RT.

-kevin

Aha - thanks for that. Worked out I needed another Module::Install
extension too… got where I needed to go now, and pushed my branches
(one for a tiny patch to RT itself needed for the module to work
correctly) and one for the module back up to github for Ruslan to look
at – or indeed anyone else who’s interested.

Ah, neat, you implemented the time-based limitation that I wanted (I’m
judging from the branch name, I haven’t had time to full review the
code yet).

I’ve implemented all the things that Ruslan mentioned he hadn’t had time to do:

  • Configurable time limit. There’s a default, and you can also do it per queue.
  • Automatic link creation to the previous ticket. The type of link is configurable, also on a per-queue basis.
  • Alter the subject line of the new ticket to remove the old RT tag.

The configuration is a hash, looking like this:

Set(%RepliesToResolved,
default => {
# 7 day time limit, create MemberOf link
‘reopen-timelimit’ => 7,
‘link-type’ => ‘MemberOf’,
},
‘some-queue’ => {
# Always create new ticket, create a refers-to link
‘reopen-timelimit’ => 0,
‘link-type’ => ‘RefersTo’,
},
‘exception-queue’ => {
# Traditional RT behaviour; disable the extension for this queue
‘reopen-timelimit’ => undef,
},
);

I’d be interested to see the bug report / pull request that you needed
to make it work with RT.

The third of the above features requires the patch to RT. I’ll file a bug report about it, but basically RT::Interface::Email has already pulled out the Subject by the time it runs the ExtractTicketId function, which the extension overrides. Since ExtractTicketId now changes the Subject header in the incoming message, I just added an extra line after calling ExtractTicketId to re-fetch the Subject, in case it’s changed. That’s all. The following commit is the relevant one:

https://github.com/tcutts/rt/commit/593b2fe645f43c5776c8a9c1921be4aed26b202b

Tim

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

I’ve implemented all the things that Ruslan mentioned he hadn’t had time to do:

  • Configurable time limit. There’s a default, and you can also do it per queue.
  • Automatic link creation to the previous ticket. The type of link is configurable, also on a per-queue basis.
  • Alter the subject line of the new ticket to remove the old RT tag.

I think the one other thing I’d like to handle in this is more
Statuses than just Resolved (especially with lifecycles) but that does
raise the question of whether the name wants to change or not.

The configuration is a hash, looking like this:

Set(%RepliesToResolved,
default => {
# 7 day time limit, create MemberOf link
‘reopen-timelimit’ => 7,
‘link-type’ => ‘MemberOf’,
},
‘some-queue’ => {
# Always create new ticket, create a refers-to link
‘reopen-timelimit’ => 0,
‘link-type’ => ‘RefersTo’,
},
‘exception-queue’ => {
# Traditional RT behaviour; disable the extension for this queue
‘reopen-timelimit’ => undef,
},
);

If you don’t specify default, does it just punt on queues that aren’t
specified, or if you only want this behaviour on one queue do you have
to say default => { ‘reopen-timelimit’ => undef }

The third of the above features requires the patch to RT. I’ll file
a bug report about it, but basically RT::Interface::Email has
already pulled out the Subject by the time it runs the
ExtractTicketId function, which the extension overrides. Since
ExtractTicketId now changes the Subject header in the incoming
message, I just added an extra line after calling ExtractTicketId to
re-fetch the Subject, in case it’s changed. That’s all. The
following commit is the relevant one:

https://github.com/tcutts/rt/commit/593b2fe645f43c5776c8a9c1921be4aed26b202b

Ah - interesting. I’d like Ruz to comment, since he wrote the
ExtractId code and might have thoughts.

-kevin

The third of the above features requires the patch to RT. I’ll file
a bug report about it, but basically RT::Interface::Email has
already pulled out the Subject by the time it runs the
ExtractTicketId function, which the extension overrides. Since
ExtractTicketId now changes the Subject header in the incoming
message, I just added an extra line after calling ExtractTicketId to
re-fetch the Subject, in case it’s changed. That’s all. The
following commit is the relevant one:

https://github.com/tcutts/rt/commit/593b2fe645f43c5776c8a9c1921be4aed26b202b

Ah - interesting. I’d like Ruz to comment, since he wrote the
ExtractId code and might have thoughts.

Hi,

We for sure need something like this. I’m just unsure if $Subject
should be updated or
in $ticket->Create call we should pass updated value.

Later $Subject is used in Create call and calls to report errors to
user and/or RT owner.

I think updated subject should be passed to ticket create, but in
error mails we use original subject.

Also, for backwards compatibility we should keep chomp’ing subject.

Best regards, Ruslan.

I’ve implemented all the things that Ruslan mentioned he hadn’t had time to do:

  • Configurable time limit. There’s a default, and you can also do it per queue.
  • Automatic link creation to the previous ticket. The type of link is configurable, also on a per-queue basis.
  • Alter the subject line of the new ticket to remove the old RT tag.

I think the one other thing I’d like to handle in this is more
Statuses than just Resolved (especially with lifecycles) but that does
raise the question of whether the name wants to change or not.

Might be sensible to make it any inactive status for the lifecycle in question. Easy enough to do.

The configuration is a hash, looking like this:

Set(%RepliesToResolved,
default => {
# 7 day time limit, create MemberOf link
‘reopen-timelimit’ => 7,
‘link-type’ => ‘MemberOf’,
},
‘some-queue’ => {
# Always create new ticket, create a refers-to link
‘reopen-timelimit’ => 0,
‘link-type’ => ‘RefersTo’,
},
‘exception-queue’ => {
# Traditional RT behaviour; disable the extension for this queue
‘reopen-timelimit’ => undef,
},
);

If you don’t specify default, does it just punt on queues that aren’t
specified,
or if you only want this behaviour on one queue do you have
to say default => { ‘reopen-timelimit’ => undef }

The latter. The default behaviour, at the moment, is the extension behaves as Ruslan originally coded it, if you supply an empty configuration (i.e. Set(%RepliesToResolved, ()); it behaves as though you’d configured:

default => { ‘reopen-timelimit’ => 0, ‘link-type’ => undef }

but if you don’t have an RT_SiteConfig.pm entry for the config at all, you get the default from RepliesToResolved_Config.pm, which is:

Set(%RepliesToResolved,
default => {
‘reopen-timelimit’ => 7,
‘link-type’ => ‘MemberOf’,
},
);

I’m happy for any of this to change - they’re just what I thought would be useful defaults based on conversations with my own users.

Regards,

Tim

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

Hi,

We for sure need something like this. I’m just unsure if $Subject
should be updated or
in $ticket->Create call we should pass updated value.

Later $Subject is used in Create call and calls to report errors to
user and/or RT owner.

I think updated subject should be passed to ticket create, but in
error mails we use original subject.

Also, for backwards compatibility we should keep chomp’ing subject.

I’ll update my patch appropriately.

Tim

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

Hi,

We for sure need something like this. I’m just unsure if $Subject
should be updated or
in $ticket->Create call we should pass updated value.

Later $Subject is used in Create call and calls to report errors to
user and/or RT owner.

I think updated subject should be passed to ticket create, but in
error mails we use original subject.

Also, for backwards compatibility we should keep chomp’ing subject.

I’ll update my patch appropriately.

Wait a bit for other folks from BPS to take a look. If we want this patch
to be in 4.0.x then it should be reviewed by several people.

I left a few comments on your changes to the extension.

Tim

Best regards, Ruslan.

Wait a bit for other folks from BPS to take a look. If we want this patch
to be in 4.0.x then it should be reviewed by several people.

Indeed.

I left a few comments on your changes to the extension.

All reasonable comments, and I’ve made changes to suit, which I will test shortly, and push up once I know I haven’t broken anything. Sorry about the tabs. Misconfigured editor, I think. Must go and correct that.

I’ll also look into using lifecycle inactive statuses rather than the explicit test for resolved, but I’ll do that in a separate commit.

Regards,

Tim

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

I’ll also look into using lifecycle inactive statuses rather than the explicit test for resolved, but I’ll do that in a separate commit.

List of statuses is better. For example replies to Rejected tickets is
better to open tickets rather than split. Some admins just rename
resolved to closed or other variants.

Best regards, Ruslan.

I’ll also look into using lifecycle inactive statuses rather than the explicit test for resolved, but I’ll do that in a separate commit.

List of statuses is better. For example replies to Rejected tickets is
better to open tickets rather than split. Some admins just rename
resolved to closed or other variants.

OK, fair enough. I’ve done that.

Tim

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

I’ll also look into using lifecycle inactive statuses rather than the explicit test for resolved, but I’ll do that in a separate commit.

List of statuses is better. For example replies to Rejected tickets is
better to open tickets rather than split. Some admins just rename
resolved to closed or other variants.

OK, fair enough. I’ve done that.

Hi Tim - Just wanted to let you know that I pulled your branch down
and spent some time on it. I rebased it in a few places to compress
down some of your rewrites. I then added some more documentation on
the end. Once I’m done, I’ll release to CPAN as 0.02.

I still need to go through tcutts/4.0/replies-to-resolved but assume
something will see trunk to support the feature.

-kevin

I still need to go through tcutts/4.0/replies-to-resolved but assume
something will see trunk to support the feature.

Tim - after looking at this branch, I believe I’m fine with the
change, but I wanted to rebase the branch and squash it into a single
commit. I’ve attached the resulting patch below, because I did reword
your commit messages. I also noticed that you’re using a different
committer address than you normally do. You may want to update your
branch, or I can just change the committer address when I publish your
branch into the main repo before merging.

-kevin

0001-Re-read-Subject-from-Message-after-ExtractTicketId.patch (1.48 KB)

The committee address was a mistake. I’m quite new to git, and I use it for both Debian work (for which I use my personal address) and work. My RT stuff is done mostly on work time, so I need to acknowledge that. My git noob factor is what’s biting here. In other words, do whatever you need to do, and I’ll make a fresh fork when you’re done.On 9 Nov 2012, at 04:00, Kevin Falcone falcone@bestpractical.com wrote:

On Thu, Nov 08, 2012 at 10:13:30PM -0500, Kevin Falcone wrote:

I still need to go through tcutts/4.0/replies-to-resolved but assume
something will see trunk to support the feature.

Tim - after looking at this branch, I believe I’m fine with the
change, but I wanted to rebase the branch and squash it into a single
commit. I’ve attached the resulting patch below, because I did reword
your commit messages. I also noticed that you’re using a different
committer address than you normally do. You may want to update your
branch, or I can just change the committer address when I publish your
branch into the main repo before merging.

-kevin
<0001-Re-read-Subject-from-Message-after-ExtractTicketId.patch>

We’re hiring! Careers — Best Practical Solutions

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

The committee address was a mistake. I’m quite new to git, and I use
it for both Debian work (for which I use my personal address) and
work. My RT stuff is done mostly on work time, so I need to
acknowledge that. My git noob factor is what’s biting here. In other
words, do whatever you need to do, and I’ll make a fresh fork when
you’re done.

That’s what I assumed.
I pushed it as

-kevin