Getting Lifecycles read in from a file rather than Admin WebUI/database

We’re trying to do something we thought would be fairly simple but so far it has us stumped. We want to go back to the old RT 4.x use of local RT_SiteConfig.pm files, which we can then manage with git and copy between server instances (as we’re doing some major localised development work which several of us are working on). Specifically, we’d like to get the lifecycles from these files, rather than the database.

In our local/etc/RT_SiteConfig.pm we’ve set the following two lines:

Set($ShowEditLifecycleConfig, 1);
Set($ShowEditSystemConfig, 1);

then flushed the Mason cache and restarted the web server. The config editing options have disappeared from the web UI as planned. However it still picks up lifecycles from the database, rather than the config file (and we know its reading the config file because we managed to miss a comma out in the lifecycle at one point and RT sat in a grump complaining about a syntax error!).

Next I nuked all the Lifecycle entries from the Configurations table, along with an Transactions of type SetConfig, and again kicked the web server. Still no joy, and now we only have the default lifecycle.

So the question is: how do we get RT 5.0.1 to just read the config files? Is there another config setting we need to invoke? Or something we need to do to get the Lifecycles ingested in to the database (that we can then script/cron if needed)?

Well as “no answer was the stern reply” I’ve had to dive in myself, and add a suitable option. In case it helps others, here’s what I did:

  1. make a local copy of /opt/rt5/lib/RT/Config.pm in /opt/rt5/local/lib/RT/Config.pm

  2. Apply this minor change to the local version:

2495c2495,2499
<     foreach (qw(Package File Line SiteConfig Extension Database)) {
---
>     my @ConfigSources = qw(Package File Line SiteConfig Extension Database);
>     if($self->Get('ConfigFromFiles')) {
> 	@ConfigSources = qw(Package File Line SiteConfig Extension);
>     }
>     foreach (@ConfigSources) {
  1. Put the line Set($ConfigFromFiles, 1); on the end of my /opt/rt5/local/etc/RT_SiteConfig.pm

  2. Flush Mason cache and restart web server.

Now the lifecycles we see in RT are the ones from the site config files, not from the database. Hoorah!

1 Like