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

Create an issue from NBug report #5064

Closed
drewnoakes opened this issue Jun 12, 2018 · 16 comments
Closed

Create an issue from NBug report #5064

drewnoakes opened this issue Jun 12, 2018 · 16 comments

Comments

@drewnoakes
Copy link
Member

When an error occurs, a user sees:

crash screen

When they click "Send and Quit" what actually happens?

@RussKie mentioned that a zip file is created. Are these sent anywhere?

Can we perhaps have the error dialog gather all this info into a form that works well with the GitHub issue tracker? For example, a link to the issue search, and a way of populating relevant information about the machine/OS/version/etc that's reliable.

@RussKie
Copy link
Member

RussKie commented Jun 12, 2018 via email

@RussKie
Copy link
Member

RussKie commented Jun 12, 2018 via email

@RussKie
Copy link
Member

RussKie commented Jun 24, 2018

Yesterday I spent some time going through the NBug code and thinking how we can auto submit crash information to github.
Out of the box NBug can be configured to generate reports and email or upload those (form POST zip to a URL). An integration with github will need to be implemented, if desired.
However this made me question whether we need the added complexity of NBug at all.
Perhaps the following is a better solution?

  • A global exception handler shows a simpler (than the NBug's) form, something similar to .Net Framework's crash dialog, that has two buttons [View Details] and [Submit to GitHub].
  • [View Details] button expands the dialog and shows the full stack trace + additional info such as OS, git version etc, that can be copied
  • [Submit to GitHub] button attempts to connect to github under the user's account via Octokit API (or similar).
    The caveat here is that the user will need to authorise GE and generate an access token.

Thoughts?

@RussKie
Copy link
Member

RussKie commented Jun 24, 2018

This is somewhat related to #4800

@drewnoakes
Copy link
Member Author

Fallback for those not willing to add an authorisation is to copy all relevant information into the clipboard and ask the user to paste it into the issue tracker at URL:

https://github.com/gitextensions/gitextensions/issues/new

This still excludes users who do not have a GitHub account, though currently we are not in a good position to interact with such users anyway.

@klorinczi
Copy link
Contributor

Until the send capability is not activated, I would suggest to modify the button text to "Save report & Quit"...

@RussKie
Copy link
Member

RussKie commented Apr 1, 2019

How about we replace NBug with ExceptionReporter.NET?

@RussKie
Copy link
Member

RussKie commented Apr 4, 2019

I've had a play with ExceptionReporter.NET and whilst it looked promising, it had massive scaling issues which I couldn't be bothered dealing with.
So back to NBug.

I have decided to break the tie with the upstream repo (given the original repo hasn't changed much nor we have contributed anything back for years), and customising our fork for our needs.

I have removed the "Send and quit" button and added a "Copy" button that would copy exception details in MD format ready to paste to a GitHub issue.

Depending how much time I have, I may look at adding a submission to GitHub functionality to NBug as well (it has few examples for other external systems).

Please have a look at gitextensions/NBug#15

@RussKie RussKie added this to the 3.1.0 milestone Apr 4, 2019
@RussKie RussKie self-assigned this Apr 5, 2019
@RussKie RussKie changed the title Where are crash reports sent to? Create an issue from NBug report Apr 5, 2019
@RussKie
Copy link
Member

RussKie commented Apr 5, 2019

I'm working on getting an automatic bug reporting to GitHub.

It is reasonably straight forward - POST https://api.github.com/repos/gitextensions/gitextensions/issues {payload}.
The only sticking bit is a user's OAuth token.

Imagine we have the UI that has "Send" button:
crash screen

Would you think it is reasonable to ask user to provide an OAuth token when attempting to submit?
The flow would probably looks something like:

  • crash occurred and NBug window is shown
  • user click "Send" button
  • check whether there is a stored OAuth token (Windows Credential Manager is probably the place to store it), and use it if one found
  • if not, ask the user to supply a token (a simple dialog with a text box and a label with instructions)
  • make a call to GH
  • if successful - all good
  • if failed (404) - tell the user to reset the token (provide instructions)
  • if failed (other) - tell user to try again or copy and submit manually

Thoughts / opinions?

@gerhardol
Copy link
Member

If automatic adding, can we somehow distinguish those from manual reports by default?
Ideally, a separate Issue tab...

For instance, I expect the filtering to be worse than for manual entered reports

@vbjay
Copy link
Contributor

vbjay commented Apr 5, 2019 via email

@RussKie
Copy link
Member

RussKie commented Apr 6, 2019

If automatic adding, can we somehow distinguish those from manual reports by default?
Ideally, a separate Issue tab...

I don't believe you can have custom tabs.
As far as a distinction is concerned we can submit issues in a specific template with a specific subject.
The template will live inside the NBug project (essentially hardcoded).

Labels can only be applied automatically by those with write access or manually.

@vbjay
Copy link
Contributor

vbjay commented Apr 6, 2019

Screenshot_20190406-024216_Chrome

@RussKie
Copy link
Member

RussKie commented Apr 7, 2019

I'm not sure how it helps, Jay.

However reading the docs (thank you for the pointers), it appears we can create an issue using a query parameters.
It looks like a query string may be of a reasonable length for us to create an issue from an exception: https://stackoverflow.com/a/812962/2338036

Here's an example (❗️please don't submit the issue):

https://github.com/gitextensions/gitextensions/issues/new?labels=type%3A%20bug&title=New+bug+report&body=%23%23%20Current%20behaviour%0A%0A%60%60%60%0ASystem.DivideByZeroException%3A%20Boom!%0A%20%20%20at%20GitUI.CommitInfo.CommitInfo.ReloadCommitInfo()%20in%20C%3A%5CDevelopment%5Cgitextensions%5CGitUI%5CCommitInfo%5CCommitInfo.cs%3Aline%20241%0A%20%20%20at%20GitUI.CommitInfo.CommitInfo.SetRevisionWithChildren(GitRevision%20revision%2C%20IReadOnlyList%601%20children)%20in%20C%3A%5CDevelopment%5Cgitextensions%5CGitUI%5CCommitInfo%5CCommitInfo.cs%3Aline%20200%0A%20%20%20at%20GitUI.CommandsDialogs.FormBrowse.FillCommitInfo()%20in%20C%3A%5CDevelopment%5Cgitextensions%5CGitUI%5CCommandsDialogs%5CFormBrowse.cs%3Aline%201247%0A%20%20%20at%20GitUI.CommandsDialogs.FormBrowse.%3C.ctor%3Eb__53_2(Object%20sender%2C%20EventArgs%20e)%20in%20C%3A%5CDevelopment%5Cgitextensions%5CGitUI%5CCommandsDialogs%5CFormBrowse.cs%3Aline%20204%0A%20%20%20at%20GitUI.RevisionGridControl.%3C.ctor%3Eb__108_0(Object%20_%2C%20EventArgs%20e)%20in%20C%3A%5CDevelopment%5Cgitextensions%5CGitUI%5CUserControls%5CRevisionGrid%5CRevisionGridControl.cs%3Aline%20159%0A%20%20%20at%20System.Windows.Forms.Timer.OnTick(EventArgs%20e)%0A%20%20%20at%20System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message%26%20m)%0A%20%20%20at%20System.Windows.Forms.NativeWindow.Callback(IntPtr%20hWnd%2C%20Int32%20msg%2C%20IntPtr%20wparam%2C%20IntPtr%20lparam)%0A%60%60%60%0A%0A%0A%23%23%20Additional%20information%0A%0AThis%20happened%20whilst%20I%20was%20arguing%20with%20someone%20on%20the%20internet.%0A%0A%0A%23%23%20Environment%0A%0A-%20Git%20Extensions%203.1.0%0A-%20Build%20259c501a27db6de9723fbcddbdd40638a9498f24%20(Dirty)%0A-%20Git%202.19.0.windows.1%0A-%20Microsoft%20Windows%20NT%2010.0.17134.0%0A-%20.NET%20Framework%204.7.3324.0%0A-%20DPI%20144dpi%20(150%25%20scaling)%0A%0A

The total url length is 1,852 char

Here's a result:
image

I see the following benefits of this approach:

  • simplicity
  • we don't need to manage user's OAuth tokens

A possible drawback - a stack trace is too deep, this may result in a very long url and it may result in a partial or no submission at all.

Personally I'm willing to take chances, some submissions is better than no submissions at all.

Thoughts?

@vbjay
Copy link
Contributor

vbjay commented Apr 7, 2019

Our current templates can be set to define bug or feature request label.

https://developer.github.com/v3/issues/#create-an-issue we already have their oauth token when they setup github plugin. We could add a step in the settings setup for it. We can use AWS or azure or ... for file uploads and in the issue body link to the uploaded file. The file can be the zip nbug creates

@RussKie
Copy link
Member

RussKie commented Apr 7, 2019

Our current templates can be set to define bug or feature request label.

Yes, we can.
It simplifies the url, but doesn't address the overarching issue.
I couldn't see how we could automatically fill a template either.

we already have their oauth token when they setup github plugin.

That is a very big assumption. I have never configured or used the plugin, we can't expect our user to use the plugin.

We could add a step in the settings setup for it. We can use AWS or azure or ... for file uploads and in the issue body link to the uploaded file.

We could. However this requires a significant investment in time, effort and money.
Personally I'd rather direct efforts in getting telemetry information first (#6021).

RussKie added a commit to gitextensions/NBug that referenced this issue Apr 9, 2019
GitHub allows submitting issues by navigating a dedicated URL supplying
issue data via query string parameters.
More info: https://help.github.com/en/articles/about-automation-for-issues-and-pull-requests-with-query-parameters

Whenever Git Extensions experiences an issue that is handled by NBug, a
user is presented with an option to submit an issue to our GitHub repo.

By clicking "Send and quit" button the following occurs:
* an issue payload is generated,
* the payload gets encoded into a url, and
* the user is navigated to the generated url in a browser of their choice

Relates to gitextensions/gitextensions#5064
RussKie added a commit to RussKie/gitextensions that referenced this issue Apr 9, 2019
GitHub allows submitting issues by navigating a dedicated URL supplying
issue data via query string parameters.
More info: https://help.github.com/en/articles/about-automation-for-issues-and-pull-requests-with-query-parameters

Whenever Git Extensions experiences an issue that is handled by NBug, a
user is presented with an option to submit an issue to our GitHub repo.

By clicking "Send and quit" button the following occurs:
* an issue payload is generated,
* the payload gets encoded into a url, and
* the user is navigated to the generated url in a browser of their choice

Closes gitextensions#5064
@ghost ghost added the status: ready label Apr 9, 2019
RussKie added a commit to gitextensions/NBug that referenced this issue Apr 10, 2019
GitHub allows submitting issues by navigating a dedicated URL supplying
issue data via query string parameters.
More info: https://help.github.com/en/articles/about-automation-for-issues-and-pull-requests-with-query-parameters

Whenever Git Extensions experiences an issue that is handled by NBug, a
user is presented with an option to submit an issue to our GitHub repo.

By clicking "Send and quit" button the following occurs:
* an issue payload is generated,
* the payload gets encoded into a url, and
* the user is navigated to the generated url in a browser of their choice

Relates to gitextensions/gitextensions#5064
RussKie added a commit to RussKie/gitextensions that referenced this issue Apr 10, 2019
GitHub allows submitting issues by navigating a dedicated URL supplying
issue data via query string parameters.
More info: https://help.github.com/en/articles/about-automation-for-issues-and-pull-requests-with-query-parameters

Whenever Git Extensions experiences an issue that is handled by NBug, a
user is presented with an option to submit an issue to our GitHub repo.

By clicking "Send and quit" button the following occurs:
* an issue payload is generated,
* the payload gets encoded into a url, and
* the user is navigated to the generated url in a browser of their choice

Closes gitextensions#5064
@ghost ghost removed the status: ready label Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants