[tools] testbot: Share the patch subject parsing code.