Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(WIP) Adding tools to help debugging build failures #45

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions eessi_bot_job_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ def process_new_job(self, new_job):
# NOTE adjust search string if format changed by event
# handler (separate process running
# eessi_bot_software_layer.py)
cms = '^Job `%s` on `%s`.*' % (
new_job['jobid'],
config.get_section('github').get('app_name'))
cms = '.*submitted.*job id `%s`.*' % new_job['jobid']
# new_job['jobid'],
# config.get_section('github').get('app_name'))

comment_match = re.search(cms, comment.body)

Expand Down Expand Up @@ -273,9 +273,10 @@ def process_finished_job(self, finished_job):
# NOTE adjust search string if format changed by event
# handler (separate process running
# eessi_bot_software_layer.py)
cms = '^Job `%s` on `%s`.*' % (
finished_job['jobid'],
config.get_section('github').get('app_name'))
cms = '.*submitted.*job id `%s`.*' % finished_job['jobid']
# cms = '^Job `%s` on `%s`.*' % (
# finished_job['jobid'],
# config.get_section('github').get('app_name'))

comment_match = re.search(cms, comment.body)

Expand Down
50 changes: 50 additions & 0 deletions inspect_pr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env python3
import configparser
import json
import glob
import os
import re
import shutil
import subprocess
import sys
import time

from connections import github
from datetime import datetime, timezone
from tools import args, config

from pyghee.utils import create_file

from git import Git, Repo
import requests
from typing import Tuple

# parse command-line args
opts = args.parse()

repo_name = None
if opts.repository_name is not None:
repo_name = opts.repository_name
else:
print("need a full repository name")
quit()

print("repository name: %s" % repo_name)

pr_number = None
if opts.pr_number is not None:
pr_number = opts.pr_number
else:
print("need a pull request number")
quit()

print("pull request number: %s" % pr_number)

config.read_file("app.cfg")
github.connect()
gh = github.get_instance()
repo = gh.get_repo(repo_name)
pr = repo.get_pull(int(pr_number))
base_ref = pr.base.ref

print("base_ref = '%s'" % base_ref)
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ PyGithub
Waitress
cryptography
PyGHee>=0.0.3
GitPython
Requests
Loading