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

Prefill GitHub Issue Template automatically #927

Merged
merged 3 commits into from
Mar 1, 2024

Conversation

exigow
Copy link
Contributor

@exigow exigow commented Feb 29, 2024

Related to #645

This PR modifies the way users can report bugs from within the IDE. Instead of creating a new, prefilled but default issue, we now use a report_bug.yaml template. This gives us several cool features.

From now on, users cannot smash the "Open GitHub Issue" button because an additional input are required: description and steps to repro. This will increase the quality of our reports.
Bugs reported manually and automatically now have an identical structure.

Additional notes:

  • I simplified the template because some text was redundant/noise.
  • I removed the tests because the way we generate Markdown is now tightly coupled with rest of the code.

Test Plan

  • Invoke error (eg place error("") somewhere in code)
  • Use Open GitHub Issue
  • Browser opens on "JetBrains Bug report"
  • Verify:
    • Labels are prefilled with "bug" and "team/jetbrains"
    • Project is prefilled "sourcegraph/381" (AKA JetBrains Project)
    • Logs are prefilled with a stacktrace (and optional "additional info")
    • Versions are prefilled with IDE and plugin version

@exigow exigow self-assigned this Feb 29, 2024
@exigow
Copy link
Contributor Author

exigow commented Feb 29, 2024

Note: It can't be tested until we merge the changes in the template to main (because we need attribute ids), but I can confirm that it works (I created a test repo for this purpose and made sure that the labels and project are correctly assigned).

@exigow
Copy link
Contributor Author

exigow commented Feb 29, 2024

@exigow exigow marked this pull request as ready for review February 29, 2024 16:42
@exigow exigow changed the title Use template for Open GitHub Issue Prefill GitHub Issue Template automatically Feb 29, 2024
@exigow
Copy link
Contributor Author

exigow commented Feb 29, 2024

Note: I couldn't find a way to get a string similar to the Help->About->Copy and Close option (in reasonable time, I still believe it's accessible somewhere in API).

Related to #645

This PR modifies the way users can report bugs from within the IDE. Instead of creating a new "blank" issue, we now use a template for bug reporting. This gives us several cool features.

This PR addresses few problems:
* From now on, users cannot smash the "Open GitHub Issue" button because an additional input are required: description and steps to repro. This will increase the quality of our reports.
* Bugs reported manually and automatically now have an identical structure.

Additional notes:
* I simplified the template because some text was redundant/noise.
* I removed the tests because the way we generate Markdown is now tightly coupled with logic/encoding.
* It's not easy to programmatically check if modifications to the template are breaking automatic reporting. For this purpose, I simply added a comment against modification with instructions on what to pay attention to.

Test Plan

* Invoke error (eg place error("") somewhere in code)
* Use Open GitHub Issue
* Verify: Browser is opened using "JetBrains Bug report" template
* Verify: Two labels are assigned: "label" and "team/jetbrains"
* Verify: Project "sourcegraph/381" is assigned
Copy link
Contributor

@pkukielka pkukielka left a comment

Choose a reason for hiding this comment

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

LGTM, but I haven't tested locally yet

@exigow
Copy link
Contributor Author

exigow commented Mar 1, 2024

We need to merge this into the main first to be able to check if the reporting works.

I am merging now and will let you know soon if it's OK.

@exigow exigow merged commit 01c0347 into main Mar 1, 2024
2 checks passed
@exigow exigow deleted the exigow/use-bug-template-for-reporting branch March 1, 2024 15:47
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