Skip to content

Conversation

@radumg
Copy link
Collaborator

@radumg radumg commented Jan 9, 2019

Purpose

NOTE : replaces PR #9150 which was based on wrong branch and adds unit tests.

Fixes #5909 by pre-filling the new Github issue page with

  • an appropriate title that includes Dynamo version number : Crash report from Dynamo 2.0.1
  • issue body filled with the crash details text, displayed in the CrashPrompt window bottom text box

Currently pressing Submit to Github takes you here :

image

With the new behaviour, pressing Submit to Github takes you here :

image

In the above image, the This is the error text body would be replaced by the actual details of the crash stack trace, as per original screenshot in #5909 .

I can't seem to be able to make Dynamo crash on purpose right now (funny how that works...), so dunno how to replicate.

Other notes

  • sends users to https://github.com/DynamoDS/Dynamo/issues/new by default when no crash text is supplied (friendlier than sending to the super-busy all issues page)
  • as per current implementation, you still need to be logged in to Github to be able to submit the issue

Further improvements

We could add the rest of the current issue template text to the body and wrap the crash dump inside a nice code block, but I'm afraid that'd make the query string way too long. Open to ideas/suggestions ?

Declarations

Check these if you believe they are true

  • The code base is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning, and are documented in the API Changes document.

Reviewers

@alfarok
@Racel

FYIs

@andydandy74 , @johnpierson

@radumg
Copy link
Collaborator Author

radumg commented Jan 9, 2019

Started on the unit tests @alfarok , will finish them later today, they test :

  • new browser tab is opened when a bug with no content is reported
  • new browser tab is opened when a bug with content is reported

For now, confirmed (in a separate experiment) the methodology works for all major browser (on Windows at least) and correctly catches open tabs with right name on : Edge, Chrome, Firefox & even Internet Explorer.

edge
firefox
iexplore
chrome

One potential hiccup is that if you're not logged in, you'd be taken to sign-in page, so i'll test further for that and adjust.

@radumg
Copy link
Collaborator Author

radumg commented Jan 9, 2019

let me know in the meantime if it makes sense where the unit test is placed.

@mjkkirschner
Copy link
Member

@radumg sorry, I should have been more clear. Please keep the test class and tests public (I think they need to be public to be found by nunit on our runner) - I only meant to make the TargetWords list private.

😄

@radumg
Copy link
Collaborator Author

radumg commented Jan 10, 2019

@mjkkirschner hah, thought there was something funny there, but looked at other classes and they lacked an access modifier, turns out only the methods need it. Didn't have the NUnit 2 adapter anyway, so couldn't test. 😁

update : confirm it picks up Dynamo version in issue title
image

@radumg
Copy link
Collaborator Author

radumg commented Jan 10, 2019

Ok, should be ready for review now @mjkkirschner @alfarok

Tests passing
tests passing

Works both logged in and logged out of Github
logged out working
logged in working

Now adds long stack trace & further metadata details (OS, CLR & Dynamo versions) to issue body
issue with stack trace

When submitted, it looks like this
issue formatting

Let me know what you think & if you have any feedback/ideas, etc 😄

@radumg
Copy link
Collaborator Author

radumg commented Jan 10, 2019

FYI, introduced a new CrashUtilities.cs in Wpf.Utilities, it's set to internal to not impact public API, hope that's ok - if not, open to suggestions. Didn't want to polute the ViewModel with crash formatting implementation details.

@alfarok
Copy link
Contributor

alfarok commented Jan 10, 2019

Hey @radumg, thanks for continuing this work! I'll pull your changes today and review

@radumg
Copy link
Collaborator Author

radumg commented Jan 10, 2019

Looking great 👏 , thanks @alfarok !

@alfarok
Copy link
Contributor

alfarok commented Jan 11, 2019

@radumg quick update, the tests are failing on the test machine because no user is logged in so it brings you to the login page as you outlined. We can probably just test the body of the request instead and not open the browser at all. I am looking into a solution now

@radumg
Copy link
Collaborator Author

radumg commented Jan 11, 2019

hm, interesting @alfarok ! There's a fallback so the unit test should detect it's on the sign-in page and pass.

In CrashReportingTests.cs :

private bool ContainsAllTargetWords(string source)
        {
            return TargetWords.TrueForAll(x => source.ToUpper().Contains(x)) ||
                   TargetWordsLoggedOutFallback.TrueForAll(x => source.ToUpper().Contains(x));
        }

where the words are :

List<string> TargetWordsLoggedOutFallback = new List<string> { "SIGN IN", "GITHUB" };

Running it here works logged out too.

@radumg
Copy link
Collaborator Author

radumg commented Jan 11, 2019

@radumg quick update, the tests are failing on the test machine

What OS is the test machine ? Linux or Windows ? I'm wondering if grabbing the Process.MainWindowTitle is inconsistent between them

@alfarok
Copy link
Contributor

alfarok commented Jan 11, 2019

@radumg I think it is because the test machine opens an additional window about setting a default browser (or something similar) before continuing. Unfortunately I don't think our testing machines will be super reliable with browser interactions, sorry for any additional work. I am making a PR to your branch now that simplifies the tests a bit but covers similar functionality. If we get everything resolved by today we should be able to get this into 2.1

@alfarok
Copy link
Contributor

alfarok commented Jan 11, 2019

radumg#7

Address browser testing issues on test machines
@radumg
Copy link
Collaborator Author

radumg commented Jan 11, 2019

All merged in 👍

@radumg
Copy link
Collaborator Author

radumg commented Jan 11, 2019

Not sure what’s going with Github, my comments keep disappearing, so just in case : @alfarok your PR should be merged now, if not please feel free to proceed with it, all looks 👏

@alfarok
Copy link
Contributor

alfarok commented Jan 11, 2019

@radumg once the self-serve completes I think this is ready to merge if there are no objections from @mjkkirschner. Thanks for the quick updates the last couple of days, this will be really nice to have in 2.1 👍

@mjkkirschner
Copy link
Member

this looks good to me.

@alfarok alfarok added the LGTM Looks good to me label Jan 11, 2019
@alfarok alfarok merged commit fc7d5a3 into DynamoDS:master Jan 11, 2019
@alfarok
Copy link
Contributor

alfarok commented Jan 11, 2019

@radumg all unit tests passing, merged. @QilongTang can I cherry-pick to 2.1?

alfarok pushed a commit to alfarok/Dynamo that referenced this pull request Jan 11, 2019
* add /new to GitHubBugReportingLink url

* add bug report title to .resx

* add support for pre-filled new Github issue text when reporting

* Revert resx un-necessary changes

* simplify query construction

since we make a new Uri, it would never have any existing query parameters

* rename variables for legibility

* add fallback values for text to prevent null exceptions

* invert IF logic to bail early

* add XML comment for public method

* get rid of conditional logic ✌️

* scaffold unit tests for CrashReporting

* add CrashReportingTests.cs to DynamoCoreWpfTests proj

* remove public access modifiers

* add logged out fallback and make tab detection case-insensitive

* move issue text & url formatting to new CrashUtilities.cs file

* add test for long stack trace

* Revert "Revert resx un-necessary changes"

This reverts commit 01fc93c.

* add description to issue crash report

* fix XML comments

* further formatting to crash report

* Include issue details from old template

* additional new line required

* remove browser interaction from unit tests

* decrement Dynamo version to make release

* comment spelling

* spelling - GithhubCrashReportBody becomes GitHubCrashReportBody
@radumg
Copy link
Collaborator Author

radumg commented Jan 11, 2019

Thanks for the quick updates the last couple of days, this will be really nice to have in 2.1 👍

My pleasure, many thanks @alfarok and @mjkkirschner for the help 🍻

mjkkirschner pushed a commit that referenced this pull request Jan 12, 2019
* add /new to GitHubBugReportingLink url

* add bug report title to .resx

* add support for pre-filled new Github issue text when reporting

* Revert resx un-necessary changes

* simplify query construction

since we make a new Uri, it would never have any existing query parameters

* rename variables for legibility

* add fallback values for text to prevent null exceptions

* invert IF logic to bail early

* add XML comment for public method

* get rid of conditional logic ✌️

* scaffold unit tests for CrashReporting

* add CrashReportingTests.cs to DynamoCoreWpfTests proj

* remove public access modifiers

* add logged out fallback and make tab detection case-insensitive

* move issue text & url formatting to new CrashUtilities.cs file

* add test for long stack trace

* Revert "Revert resx un-necessary changes"

This reverts commit 01fc93c.

* add description to issue crash report

* fix XML comments

* further formatting to crash report

* Include issue details from old template

* additional new line required

* remove browser interaction from unit tests

* decrement Dynamo version to make release

* comment spelling

* spelling - GithhubCrashReportBody becomes GitHubCrashReportBody
alfarok added a commit to alfarok/Dynamo that referenced this pull request Jan 14, 2019
@alfarok alfarok mentioned this pull request Jan 14, 2019
7 tasks
reddyashish added a commit that referenced this pull request Jan 14, 2019
QilongTang pushed a commit that referenced this pull request Jan 14, 2019
* 5909 report bug ux tested (#9393)

* add /new to GitHubBugReportingLink url

* add bug report title to .resx

* add support for pre-filled new Github issue text when reporting

* Revert resx un-necessary changes

* simplify query construction

since we make a new Uri, it would never have any existing query parameters

* rename variables for legibility

* add fallback values for text to prevent null exceptions

* invert IF logic to bail early

* add XML comment for public method

* get rid of conditional logic ✌️

* scaffold unit tests for CrashReporting

* add CrashReportingTests.cs to DynamoCoreWpfTests proj

* remove public access modifiers

* add logged out fallback and make tab detection case-insensitive

* move issue text & url formatting to new CrashUtilities.cs file

* add test for long stack trace

* Revert "Revert resx un-necessary changes"

This reverts commit 01fc93c.

* add description to issue crash report

* fix XML comments

* further formatting to crash report

* Include issue details from old template

* additional new line required

* remove browser interaction from unit tests

* decrement Dynamo version to make release

* comment spelling

* spelling - GithhubCrashReportBody becomes GitHubCrashReportBody

* Revert "5909 report bug ux tested (#9393)"

This reverts commit dfb7ddf.
@QilongTang QilongTang mentioned this pull request Jan 28, 2020
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM Looks good to me

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants