rt-static

module
v0.0.0-...-7dfca68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2024 License: Apache-2.0

README

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.

Directories

Path Synopsis
cmd
cli
cli is a tool for searching our bleve index
cli is a tool for searching our bleve index
index
index generates a json index and bleve search index
index generates a json index and bleve search index
web
Package web contains web related code.
Package web contains web related code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL