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

Issue Reporter: Support configuring data sent to extensions #46726

Closed
RMacfarlane opened this issue Mar 27, 2018 · 21 comments
Closed

Issue Reporter: Support configuring data sent to extensions #46726

RMacfarlane opened this issue Mar 27, 2018 · 21 comments
Assignees
Labels
api-proposal feature-request Request for new features or functionality issue-reporter Issue reporter widget issues on-testplan
Milestone

Comments

@RMacfarlane
Copy link
Contributor

Continuation of #45673

Now that users can choose to file on extensions, extension authors should be able to specify additional data to include in the report. This could potentially include

  • User settings
  • launch.json information
  • Metadata about the workspace (is it multiroot)
  • Console errors
  • Data specific to the extension
@Almenon
Copy link

Almenon commented Apr 7, 2018

By default the extension log should definitley be included within the report. Extension settings would also be very helpful.

@rkeithhill
Copy link

rkeithhill commented Jul 8, 2018

To add to what @RMacfarlane says, the PowerShell extension would love to supply the PowerShell version info in this issue report. We'd (and I suspect most extension authors) would like to see a list of all loaded extension versions. There is sometimes "interference" between extensions and having this information can help determine if what a user is seeing might be a result of this.

Here is an example of the PowerShell version info and extension info we generate with our extension's bug report command:

PowerShell Information

Name Value
PSVersion 5.1.17134.137
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.17134.137
BuildVersion 10.0.17134.137
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
cmake twxs 0.0.17
code-settings-sync Shan 2.9.2
cpptools ms-vscode 0.17.6
csharp ms-vscode 1.15.2
debugger-for-chrome msjsdiag 4.7.0
EditorConfig EditorConfig 0.12.4
githistory donjayamanne 0.4.1
gitlens eamodio 8.4.1
html-snippets abusaidm 0.2.1
PowerShell ms-vscode 1.7.0
sass-indented robinbentley 1.4.9
theme-cobalt2 wesbos 2.1.6
tslint eg2 1.0.33
vscode-eslint dbaeumer 1.4.12

If we had this and there was a way to invoke the issue reporter programmatically, we would redirect bug report command to pop the issue reporter and probably, over time phase out our bug report command in favor of the built-in one.

@rkeithhill
Copy link

rkeithhill commented Jul 8, 2018

Oh and we'd like to show them how to attach log files generated by the extension to the bug report e.g.:

Attached Logs

Follow the instructions in the README about capturing and sending logs.

Of course, if the issue reporter supported attachment of log files (or zip of log files) and uploaded that with the bug report - that'd be sweet!!

@rkeithhill
Copy link

Extension settings would also be very helpful.

Yes! But we would only need the non-default settings.

@bwateratmsft
Copy link
Contributor

The Docker extension along with several Azure extensions managed by @EricJizbaMSFT and @StephenWeatherford would really benefit from this as well.

@TylerLeonhardt
Copy link
Member

I'm thinking the best API for this kind of thing is a typical provider model:

interface IssueDataProvider {
    provideIssueData(): ProviderResult<string | MarkdownString>;
}

namespace env {
    export function registerIssueDataProvider(provider: IssueDataProvider): Disposable;
}

Reusing env seems reasonable since the environment could be important for the issue.

Also since MarkdownString has nice utilities for creating MarkdownStrings I think it's reasonable to include that in the result... though really at the end of the day we'll just be sending a string.

@gjsjohnmurray
Copy link
Contributor

Do you plan to make the Issue Reporter dialog give the user a preview of the data the extension wants to send? And/or an option to exclude it? When logged in at GitHub we only get to see issue contents after filing.

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Mar 7, 2023

Do you plan to make the Issue Reporter dialog give the user a preview of the data the extension wants to send? And/or an option to exclude it?

Yes. Similar to when you open an issue on VS Code and it shows you the additional data that will be included in your issue... except probably more obvious since it's coming from a random extension instead of VS Code.

When logged in at GitHub we only get to see issue contents after filing.

You have the ability to see all of it, today via the different "show more"s, just not in one big text area like you do on GitHub. I do want to have a preview button and that's #117657

We did it the way that we did because there's a hard limit on number of characters that a browser can handle via a query parameter so if you're logged in we can simply use a POST to the issue API which will guarantee it's creation. Not the best experience but better than asking the user to paste content in.

@bwateratmsft
Copy link
Contributor

bwateratmsft commented Mar 7, 2023

Would some sort of state object be suitable, e.g., programmatically execute the "Report Issue..." command, with an object containing state that is subsequently passed into provideIssueData(). Primarily I'm thinking of passing along an error object, call stack, etc. from, e.g., an error toast, into the issue reporter.

As an example, in the Docker and most Azure extensions we trap errors and, in some cases, show an error toast with a "Report issue" button, that opens the issue reporter with the extension pre-selected. It would be helpful to be able to pass along that error into the IssueDataProvider's provideIssueData() function.

@TylerLeonhardt
Copy link
Member

Yeah that's a good idea. I know we already have a command for launching the issue reporter with pre-filled data. I think it can probably be a bit more ergonomic.

@TylerLeonhardt
Copy link
Member

Some interesting data on how some extensions have implemented their own Report Issue... experience:

Extension Command name Sample Notes
Core Help: Report Issue... opens issue reporter defaults to "Bug Report"
Core Help: Report Performance Issue... opens issue reporter defaults to "Performance Issue"
Azure Account Azure Account: Report Issue... sample version info, os info, locale
Codespaces Codespaces: Report Issue sample doesn't include any info. Goes to GitHub Support
Codespaces Codespaces: Send Feedback sample doesn't include any info. Goes to GitHub Discussions
Dev Containers Dev Containers: Report Issue... opens issue reporter issue reporter is completely blank
Luna Luna > Help: Report Issue... opens issue reporter only extension is pre-filled
Pylance Pylance: Report Issue... sample version info, os info, couple of setting values
Python Python: Report Issue... opens issue reporter template, python env info, couple of setting values
Remote SSH Remote-SSH: Report Issue... opens issue reporter issue reporter is completely blank
Remote Tunnels Remote Tunnels: Report Issue... opens issue reporter issue reporter is completely blank
PowerShell PowerShell: Upload Bug Report to GitHub sample they include info but it gets lost due to new issue choose
Project Manager no command but Report Issue in a view sample doesn't include any info
Project Manager no command but Provide Feedback in a view sample is a tweet

For the remote extensions that open the issue reporter completely blank I believe it was a bug that I fixed a few days ago... they now should open with their extension pre-selected.

@TylerLeonhardt
Copy link
Member

Here's an iterative (hacked up) mockup of what the Issue Reporter could look like with the extension contributed data:
image

words can change but the idea is that we widen the issue reporter to make way for a 2nd column being the data that the extension provides.

The current API proposal aligns with this model. The vscode.openIssueReporter, which allows you to specify this:

interface OpenIssueReporterArgs {
	readonly extensionId?: string;
	readonly issueTitle?: string;
	readonly issueBody?: string;
}

would include an additional extensionData property or something that would allow for @bwateratmsft's ask to programmatically open the issue reporter with all this stuff in it. (in the future, proper API could wrap this command, but I'll leaving that out of scope for now since I have limited time)

Now I think these needs 2 additional things:

  1. allowing an extension to control the Steps to Reproduce/title content so that extensions can make it easier for users to "file good steps" whatever that means for that extension. Requires more API... I'm thinking maybe an additional IssueDataProvider#provideIssueTemplate(): ProviderResult<string | MarkdownString> separate from gathering data so that the user can start filling in the template while the provideIssueData is finishing.
  2. a good experience for extensions that don't use GitHub Issues (maybe they use GitLab, or even GitHub Discussions like Codespaces does) - I think this is all UI work in the issue reporter which I will mock up.

@bwateratmsft
Copy link
Contributor

That makes sense. For us, what we ultimately need is to be able to put data into the issue body--metadata like call stack, error, OS, extension-specific info, etc.--while still requiring users to type something as well. We receive a considerable volume of issues where the user enters something into the title, but nothing in the details or repro steps, usually resulting in unactionable issues.

@brettcannon
Copy link
Member

Is there any way to make the data like the "Include" options that come baked in? Basically be checkboxes with the "show" link to show what's being included? I'm wondering if that might help make all the data less ominous to users?

And I do appreciate manually sending in the template if you go the GitHub issues direction as we purposefully turn off the ability to open a new issue to direct users through our "Report Issue" command 😁.

Lastly, other than some select settings outside of what our extension provides, we include every setting that is set to a non-default value. We also anonymize any setting that is free-form in case there's PII, but otherwise include any setting the user specified. Not sure if it would make sense to do that automatically since the setting contributions are known to Python and the type details for those settings are also known.

@TylerLeonhardt
Copy link
Member

Is there any way to make the data like the "Include" options that come baked in? Basically be checkboxes with the "show" link to show what's being included? I'm wondering if that might help make all the data less ominous to users?

I opted against this with the concern that since we don't own every extension in the marketplace, we can't be sure that their data capturing processes are up to par. So I aired on the side of caution and made the extension issue data front and center. I understand that this might increase the likelihood of an empty issue (the user just deletes the content) but I think that this cohort of "security cautious but not willing to scan data manually" is small compared to others.

Lastly, other than some select settings outside of what our extension provides, we include every setting that is set to a non-default value. We also anonymize any setting that is free-form in case there's PII, but otherwise include any setting the user specified. Not sure if it would make sense to do that automatically since the setting contributions are known to Python and the type details for those settings are also known.

I think this is a good idea but it would make a good addition to this proposal rather than a replacement. I think there is still a need for data only available at runtime.

@eleanorjboyd
Copy link
Member

eleanorjboyd commented Mar 13, 2023

Excited about the proposal! @TylerLeonhardt I have a github issue form for remote-ssh bugs which I would also love to port over to this new issue reporter. From what I can see, everything you have planned fits with the features I have for my issue form. The first comment I have is I am not sure if this is already planned but I have really appreciated having long items in dropdowns (this is done on the python report issue command so I assume that is done everywhere) but just wanted to bring it up as it does help keep issues visually cleaner even when we are gathering extensive logs.
Screenshot 2023-03-13 at 1 24 25 PM

Secondly, will the issue reporter allow assigning tags or assignees? Since remote-ssh has all bug reports go through the remote-release repo I have my bug report form assigning it to me and adding "ssh" as a label for organizational purposes.

@TylerLeonhardt
Copy link
Member

@eleanorjboyd

I have really appreciated having long items in dropdowns (this is done on the python report issue command so I assume that is done everywhere) but just wanted to bring it up as it does help keep issues visually cleaner even when we are gathering extensive logs.

yeah we would collapse it in a dropdown on the issue for sure.

Secondly, will the issue reporter allow assigning tags or assignees?

Users who aren't in the GH Org can't assign people or add tags so this doesn't seem useful to support. Instead, you could use an Issue Form Template which allows for a hardcoded list of assignees & labels.

@TylerLeonhardt TylerLeonhardt modified the milestones: March 2023, April 2023 Mar 20, 2023
@TylerLeonhardt TylerLeonhardt modified the milestones: April 2023, Backlog Apr 11, 2023
@justschen justschen self-assigned this Sep 18, 2023
@AnthonyLeonardoGracio
Copy link

Hello!

Is this already available through the VS Code API? I am not very familiar on how new APIs get merged, but I wanted to use this new capability in our own extension, so I was wondering what should I need to do in order to have access to this new API: if someone has a working example of a customized issue reporter, that would be very useful!

Regards,

@TylerLeonhardt TylerLeonhardt removed their assignment May 13, 2024
@justschen
Copy link
Contributor

justschen commented May 13, 2024

this is available ATM! extensions can contribute a command which will be triggered in the reporter when selecting their extension as long as they follow this menu contribution point:

"commands": [
    {
        "command": "extension.myCommand",
        "title": "Report Issue"
    }
],
    "menus": {
        "issue/reporter": [
            {
                "command": "extension.myCommand"
            }
        ]
    }

extension.myCommand will then run an workbench.action.openIssueReporter command with any information they want 👍

check out https://code.visualstudio.com/updates/v1_87#_contributing-additional-data-in-issue-reporter for additional details.

here is also our internal testing item which has some additional instructions #203094

please let me know what you guys think!

@microsoft microsoft locked and limited conversation to collaborators Jun 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-proposal feature-request Request for new features or functionality issue-reporter Issue reporter widget issues on-testplan
Projects
None yet
Development

No branches or pull requests