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

GitHub issue handler #56

Merged
merged 13 commits into from
Jun 13, 2024
Merged

GitHub issue handler #56

merged 13 commits into from
Jun 13, 2024

Conversation

jhaigh0
Copy link
Contributor

@jhaigh0 jhaigh0 commented Apr 26, 2024

This is the main pr for "automatic github issue creation" of the Mantid error reporter improvements Epic.

What's been added:

  • A new database model GithubIssue comprised of a repo address and an issue number
  • github_issue_manager.py which contains the main funcion get_or_create_github_issue which does the following
    • Searches the database for a githubIssue with a matching repo and stacktrace (the stacktrace is compared irrespective of the install location / any local informaiton)
      • If one is found, a comment containing the report info is added to that issue
      • If no issue is found, then a new one is made

Two new environment variables have been added

  • GIT_AUTH_TOKEN is the auth token of the account used to create the github issues / comments (on the live version of the error reports site this will be an auth token from https://github.com/Mantid-Error-Reporter)
  • GIT_ISSUE_REPO the repository to create the issues in (e.g 'ISISNeutronMuon/mantid-isis-support')

I've also changed the slack message poster so that, id an issue is created / found, it'll be linked in the slack message.

@jhaigh0 jhaigh0 added the enhancement New feature or request label Apr 26, 2024
@jhaigh0 jhaigh0 force-pushed the github_issue_handler branch 2 times, most recently from 9bd267d to e896781 Compare April 26, 2024 11:12
@jhaigh0 jhaigh0 force-pushed the github_issue_handler branch from e896781 to 4dd35f9 Compare April 26, 2024 11:14
web/services/tasks.py Outdated Show resolved Hide resolved
web/services/github_issue_manager/test_trim_stacktrace.py Outdated Show resolved Hide resolved
web/services/github_issue_manager/github_issue_manager.py Outdated Show resolved Hide resolved
web/services/github_issue_manager/github_issue_manager.py Outdated Show resolved Hide resolved
web/services/github_issue_manager/github_issue_manager.py Outdated Show resolved Hide resolved
web/services/github_issue_manager/github_issue_manager.py Outdated Show resolved Hide resolved
web/services/github_issue_manager/github_issue_manager.py Outdated Show resolved Hide resolved
jhaigh0 and others added 2 commits May 7, 2024 16:00
@thomashampson thomashampson self-assigned this Jun 4, 2024
Copy link
Contributor

@thomashampson thomashampson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I found a couple of cases that the stack trace trimming would miss, which could result in new issues being created rather than comments added to existing issues.



class MatchingStackTraceSearchTest(TestCase):
entries = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the following would not be matched by the regex:

File "/opt/mantidworkbench6.9/lib/python3.10/site-packages/mantid/simpleapi.py", line 1083, in __call__

and also the following kind of thing that I found in the error reports slack channel:

Exception: MDWorkspace::getExperimentInfo(): expInfoIndex is out of range.
  at line 152 in '/usr/local/anaconda/envs/mantid-dev/plugins/python/algorithms/ConvertWANDSCDtoQ.py'

self.assertNotIn(username, _trim_stacktrace(test_trace))

def test_line_trimmer_file_lines(self):
examples = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might want to add the above examples to this test too

@jhaigh0 jhaigh0 force-pushed the github_issue_handler branch from 65c000f to dc9d5f2 Compare June 10, 2024 13:33
Copy link
Contributor

@thomashampson thomashampson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get this in and get it working

@thomashampson thomashampson merged commit 932bde4 into main Jun 13, 2024
2 checks passed
@thomashampson thomashampson deleted the github_issue_handler branch June 13, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants