We've released the code used to run rt.cpan.org

brian_d_foy on 2008-03-05T00:36:00

As part of a recent project to modernize and improve rt.cpan.org, we took the time to clean up and better abstract the various plugins we use on the backend. We've also (finally) moved all the RT extensions that make up the UI to a public SVN repository (svn://svn.bestpractical.com/).

We use the following extensions.:

For authentication:

  • RT-Authen-PAUSE
  • RT-Authen-Bitcard
  • RT-Authen-OpenID

CPAN specific UI and public bug tracking:

  • RT-BugTracker
  • RT-BugTracker-Public
  • RT-Extension-rt_cpan_org

Other:

  • RT-Extension-MergeUsers
  • RT-Extension-QuickDelete

We also have a set of tools which import info from the PAUSE and other sources into RT's Database, but we still need to clean those up a bit (removing hardcoded passwords, little things like that) before we can publish them.

If you've been hankering for a new feature in rt.cpan.org, now's the time to start sending patches. After 3 good patches, we'll grant you a commit bit to the rt.cpan.org extensions. You can start sending your patches to the address listed on the front page of rt.cpan.org.

-jesse


More stuff for testing?

Alias on 2008-03-05T19:28:33

On top of this, would it be possible to get, say, a VM copy of the setup with database etc as well, so that we can run test bug fixes (like the annoying "NoAuth -> Login takes you back to NoAuth ticket" bug...)

Re:More stuff for testing?

jesse on 2008-03-05T20:32:18

The actual database has an awful lot of personal information I'm not comfortable publishing.
But this is the tool we use to do a live install of rt.cpan:

diesel:~# svn cat svn+ssh://svn.bestpractical.com/svn/bps-private/rt.cpan.org/pull-rt-cpan
root@s vn.bestpractical.com's password:
#!/usr/bin/env perl

my $root = $ENV{'RTHOME'} = "/opt/rt/rt.cpan.org-managed/";
use Cwd qw/getcwd abs_path/;

my @CO = qw{
  svn+ssh://svn.bestpractical.com/svn/bps-public/rt/branches/3.6-RELEASE/
  svn+ssh://svn.bestpractical.com/svn/bps-public/RT-Authen-Bitcard/
  svn+ssh://svn.bestpractical.com/svn/bps-public/RT-Authen-OpenID/
  svn+ssh://svn.bestpractical.com/svn/bps-public/RT-Authen-PAUSE/
  svn+ssh://svn.bestpractical.com/svn/bps-public/RT-BugTracker/
  svn+ssh://svn.bestpractical.com/svn/bps-public/RT-BugTracker-Public/
  svn+ssh://svn.bestpractical.com/svn/bps-public/RT-Extension-MergeUsers/
  svn+ssh://svn.bestpractical.com/svn/bps-public/RT-Extension-QuickDelete/
  svn+ssh://svn.bestpractical.com/svn/bps-public/RT-Extension-rt_cpan_org/
  svn+ssh://svn.bestpractical.com/svn/bps-private/rt.cpan.org/
};

my @UPDATE = qw{
  RT-Extension-MergeUsers
  RT-Authen-Bitcard
  RT-Authen-PAUSE
  RT-BugTracker
  RT-BugTracker-Public
  RT-Extension-rt_cpan_org
  RT-Extension-QuickDelete
  RT-Authen-OpenID
};

foreach my $url (@CO) {

    print "Getting $url...\n";
    `svn export --quiet --non-interactive $url`;

}

my $fully_installed = 1;

`cd 3.6-RELEASE && sh ./configure.ac --prefix=$root --with-db-database=rt3cpan; sudo make upgrade `;

INSTALL:
foreach my $module (@UPDATE) {

    print "Trying to install $module...\n";

    my $dir = getcwd();
    opendir DIR, $dir or die "Can't open directory $dir: $!";

    # Breadth-First Search on canonicalized directories
    my @elts = filter_paths($dir, readdir DIR);
    foreach my $elt (@elts) {
        #print "Checking $elt\n";       # verbose

        if ($elt !~ /$module$/) {
            opendir SUBDIR, $elt or die "Can't open directory $elt: $!";
            my @subelts = readdir SUBDIR;
            @subelts = filter_paths($elt, @subelts);
            push @elts, @subelts;
            closedir SUBDIR;

            next;
        }
        else {
            print "Installing $module...\n";
            `cd $elt && rm -rf inc && perl ./Makefile.PL && make && sudo make install`;
            next INSTALL;
        }
    }

    print STDERR "*** Could not find module $module.  Did not install.\n";
    $fully_installed = 0;
}

if (!$fully_installed) {
    print STDERR "Some modules were not able to be installed.\n";
    print STDERR "You will need to install them manually.\n\n";
}

`cp rt.cpan.org/RT_SiteConfig.pm ${root}etc`;

#print "Remember to copy the RT_SiteConfig.pm file to the live directory!\n";

1;

sub filter_paths {
    my $base_path = shift;
    my @paths = @_;
    return grep { ( -d $_) }
        (map { abs_path("$base_path/$_") }
            (grep {$_ !~ /^\./} @paths));
}