Jump to content

VRT System/Customization

From Wikitech

Local Customizations

Packages

The codebase has some local customizations, which are applied as Znuny packages. The packages are stored in the database in otrs.package_repository and can be reapplied after update via the web UI or the command line The packages can also be downloaded from within the web interface, when logged in as an admin user:

Admin-->Package Manager-->{packages listed under Local Repository}-->Download

via the command line, packages can be reapplied with:

sudo -u www-data /opt/otrs/bin/otrs.Console.pl Admin::Package::ReinstallAll

The packages are in gerrit in the operations/software/otrs repo. Their structure is similar to the way the VRTS source code is structured. The reason for that is because OTRS/Znuny packages can override a "proper" file. e.g.

  • Custom / Kernel / Output / HTML / Templates / Standard / AgentDashboardUserOnline.tt

will override

  • Kernel / Output / HTML / Templates / Standard / AgentDashboardUserOnline.tt

That makes it a bit harder then just maintaining as patches as we have to keep the entirety of the files in sync with upstream and not just the differences (which are arguably very small). Maintaining consists of fetching the new files the package overrides per version and manually merging the new upstream stuff.

Building

Installing the packages requires that they are first built. Building the packages happens on the command line using:

cd /tmp
git clone https://gerrit.wikimedia.org/g/operations/software/otrs
cd otrs
sudo -u otrs /opt/otrs/bin/otrs.Console.pl Dev::Package::Build --module-directory packages/WikimediaTemplates/ packages/WikimediaTemplates/WikimediaTemplates.sopm /tmp

In the command above, the module directory is just a checkout of the repo mentioned above. /tmp is the output directory and the path to the .sopm file is so the code is bundled alongside the description. The .sopm file is an XML file and the format is pretty self-explanatory.

Installing

Installing the package happens using:

sudo -u www-data /opt/otrs/bin/otrs.Console.pl Admin::Package::Install /tmp/WikimediaTemplates-1.0.18.opm

The version (1.0.18 in the example above) will need adjustment per package version and is defined in the .sopm file above.

Errors

During installation of a custom package, you may encounter errors to do with the Repository setting. The following steps can be taken to resolve them:

 sudo -u otrs /opt/otrs/bin/otrs.Console.pl Maint::Config::Rebuild --cleanup
 sudo -u otrs /opt/otrs/bin/otrs.Console.pl Admin::Config::Update --setting-name Package::RepositoryList --valid 1
 sudo -u otrs /opt/otrs/bin/otrs.Console.pl Admin::Config::Read --setting-name Package::RepositoryList
 sudo -u otrs /opt/otrs/bin/otrs.Console.pl Admin::Config::Update --setting-name Package::RepositoryList --valid 0