Skip to content

rspier/rt-static

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rt-static

rt-static is a (mostly) static RT (Request Tracker) data viewer, meant for keeping archived data available without a full RT instance underneath.

Tools

server

server is a webserver that serves the extracted data.

extract/dump-json.pl

dump-json.pl uses the RT API to extract selected tickets, and writes one JSON file per ticket.

index

index reads the files generated by dump-json.pl and outputs:

  • a bleve index
  • index.json containing information used to speed up other operations.

cli

The cli tool can be used to query the generated bleve index from the command line.

Usage

Generate and Index

queue=perl5
extract/dump-json.pl --out /rtjson/${queue} --queue ${queue}
go run cmd/index/index.go -data /rtjson/${queue} --alsologtostderr --outdir /rtjson/${queue}

Serve

go run cmd/server/server.go  --data /big/rt-static/perl5/ --index /big/rt-static/perl5/index.bleve

Generate merged.csv

Extract merged.json from the archive and use json_xs to CSVify it.

json_xs -e 'my $o=""; while (my ($k,$v) = each %{$_}) { $o.="$k\t$v\n" }; $_=$o' -t string < merged.json | sort -n > merged.txt

Redirects

rtgithub.txt is the mapping of old RT issues to new GitHub issue IDs (in a single component.) When expanding to multiple projects, you'll need multiple RewriteMaps and rules.

RewriteMap GitHubMap "txt:/path/to/rtgithub.txt"
RewriteMap Merged "txt:/path/to/merged.txt"

RewriteCond "%{QUERY_STRING}" ".*id=(\d+).*"
RewriteCond ${Perl5Merged:%1} !=""
RewriteRule "/(?:Ticket|Public/Bug)/" "https://github.com/Perl/perl5/issues/${GitHubMap:${Merged:%1}}?" [L]

RewriteCond "%{QUERY_STRING}" ".*id=(\d+).*"
RewriteCond ${GitHubMap:%1} !=""
RewriteRule "/(?:Ticket|Public/Bug)/" "https://github.com/Perl/perl5/issues/${GitHubMap:%1}?"

Disclaimers

This is not an official Google project.

This project is not affiliated with Best Practical, LLC.