Skip to content

Conversation

@olbris
Copy link
Contributor

@olbris olbris commented Feb 18, 2025

Goal: add another option for error reporting in the workstation

In the workstation, we currently provide error reporting (automatic and user-driven) via email, in our case, to JIRA. This works in the cloud and the thick client. This may not be as useful for other installations outside Janelia. Even within Janelia, we are gradually shifting away from JIRA use.

GitHub is the de facto default issue tracker that everyone has easy access to. This set of changes implements error reporting to a GitHub issue tracker as an option for the workstation. The existing email reporting is not removed and is still the default option.

The feature is working in my hands on my machine, but I need help with getting configuration of the properties files working, especially in the cloud. The same branch name (github-error-reporting) is used in this repo as well as jacs-cm and hortacloud-website. The branches are up to date with approx. v9.21.

These pull requests in the other repos just contain a link back to this pull request:

Implementation

Basically I created a GitHubRestClient which provides the same interface as the existing MailHelper, and I generalized all the sources of error reports to be able to feed either one.

Access is controlled via a fine-grained personal access token to a GitHub repo created for this purpose (not the main code repo, for various reasons). This has to be created by an appropriate GitHub account, either a service account or a developer account.

Two features of GitHub create slight annoyances. First, issue text limits makes it impossible to include our system logs in-line. Second, the GitHub API inexplicably doesn't allow the creation of attachments on issues at all, even though that's an option for a human in the web UI. As a result, the system log is instead uploaded as a file on a branch in the repo, and a link is created in a comment on the issue.

Configuration

Error reporting is entirely client-side, controlled through values in console.properties. Values can be fed in the same way they are for email reporting. The new values look like this (excerpt from client.properties in jacs-cm):

# Error reporting
# valid ErrorReportingMethod options: email, github
# console.ErrorReportingMethod=email
console.ErrorReportingMethod=github
console.AutoSendExceptions=true

# GitHub
console.GitHubErrorProjectURL=${GITHUB_URL}
console.GitHubErrorProjectAccessToken=${GITHUB_TOKEN}

I will provide a URL and token for testing in Slack.

See ErrorReporting.md in hortacloud-website on the github-error-reporting branch for more details.

Testing

If you put the above lines in my.properties (with values) and build, it will report errors to the given repository.

I'm not set up to test how the values are passed along for either the thick client build or cloud deployment. I've made a start of it in jacs-cm, but this needs someone else to finish it up and test it.

Deployment

After merging but before deployment, we'll need to create and configure a GitHub repository for errors. We'll need to decide which GitHub account to use and generate the token. I can do the work once those decisions are made.

Deployment probably needs its own tracking issue and checklist, once the code is ready.

@olbris olbris requested review from cgoina and krokicki March 20, 2025 12:47
@olbris
Copy link
Contributor Author

olbris commented Mar 27, 2025

Addressing a comment on Slack by @krokicki , I improved how we notify the user of any failures to report errors. Previously we didn't, and that's not good.

Now, the user is shown a dialog if the system fails to report an error IF error reporting is configured. The dialog, which is admittedly a little ugly (*), tells the user to report the failure to the site admins, and it gives the user the option to Continue seeing the failures or to Silence them for the session.

(*) But it should be a really rare event, so I didn't think it was worth more effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants