Cheatsheet - Pull-Request-Club/PRC GitHub Wiki

Uninstall nginx and cleanup.

apt purge -y nginx nginx-common && apt autoremove -y

Restart nginx.

systemctl reload nginx

Check for nginx config syntax.

sudo nginx -t

Add this to nginx config to serve static files off of nginx.

location /static {
  root /root/PRC/root;
}

Install exactly the CPAN module versions that was installed on dev (via cpanfile.snaphot).

carton install --deployment

Get Standalone HTTPS Certificate.

apt install certbot
certbot certonly --agree-tos [email protected] --non-interactive \
  --standalone --preferred-challenges http -d pullrequest.club

Run with starman, with SSL.

CLIENT_ID=xxxx CLIENT_SECRET=yyyy \
  perl -Ilocal/lib/perl5 -Ilib local/bin/starman --enable-ssl \
  --ssl-key-file=/etc/letsencrypt/live/pullrequest.club/privkey.pem \
  --ssl-cert-file=/etc/letsencrypt/live/pullrequest.club/fullchain.pem \
  prc.psgi

People who are waiting for an assignment right now:

select user_id, github_login, is_deactivated, tos_agree_time
from user u
where is_receiving_assignments = 1
and is_deactivated = 0
and not exists (
  select * from assignment a
  where u.user_id = a.user_id
  and (
    a.status = 0
    or
    month > strftime('%Y-%m','now')
  )
);

Repos that can be assigned to people above.

.width 5 5 50 10 5 5
select repo_id, org_id, github_full_name,
github_language as lang,
github_open_issues_count as issue,
github_stargazers_count as star from repo
where accepting_assignees = 1 and gone_missing = 0
and not exists (
  select * from assignment
  where assignment.repo_id = repo.repo_id
  and julianday('now')-julianday(month) < 120
) and user_id in (
  select user_id from user where is_deactivated = 0
) order by issue,star;

Get a list of all assignments

select strftime('%m', month) as month, a.assignment_id,
u.github_login, u.last_login_time,
r.github_full_name,
a.status, a.update_time from assignment a
join repo r on r.repo_id = a.repo_id
join user u on u.user_id = a.user_id;

Install reply interpreter:

sudo apt-get install libncurses5-dev libreadline-dev
cpanm Term::ReadLine::Gnu Reply

Using reply interpreter:

~/PRC$ DBIC_TRACE=1 reply -Ilib -Ilocal/lib/perl5 -MPRC::Model::PRCDB
0> my $schema = PRC::Model::PRCDB->new; 1
$res[0] = 1

1> $schema->resultset('User')->find(1)->github_login;
$res[1] = 'kyzn'