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

Test: Issue Reporter Extensions Data API #196324

Closed
4 tasks done
justschen opened this issue Oct 23, 2023 · 2 comments
Closed
4 tasks done

Test: Issue Reporter Extensions Data API #196324

justschen opened this issue Oct 23, 2023 · 2 comments

Comments

@justschen
Copy link
Contributor

justschen commented Oct 23, 2023

Refs: #46726

Complexity: 4
Roles: Developer, Engineering Manager

Create Issue


Overview

Introducing additions to a proposed API that @TylerLeonhardt implemented a couple iterations ago. You can read the API proposal here: #46726

The following were added to the proposed API:

	...
	export interface IssueDataProvider {
		provideIssueData(token: CancellationToken): ProviderResult<string>;
		provideIssueTemplate(token: CancellationToken): ProviderResult<string>;
	}

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

dts can be found at https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.handleIssueUri.d.ts

You can use this in your extension by adding this to your extension manifest (package.json):

"enabledApiProposals": [
    "handleIssueUri"
  ],

and then run: npx vscode-dts dev which will fetch the proposed API and allow you to see types.

The general idea is that when the Issue Reporter has selected an extension that implements this API, then either provideIssueData, provideIssueTemplate, or handleIssueUrlRequest will be fired. For the first two (the ones on this TPI), you can provide it a string to be filled into the text boxes on the issue reporter page. some examples:

  • for the template: markdown with places for the user to manually fill in data, in string format.
  • for the issue data: extensions data of any kind, in string format.

When you use this part of the API, the Issue Reporter will populate the description text box with the template (if any) and will add a checkbox and label, where you can click show to display the extensions data, if any. There is also a loading animation if there is extension data that takes a while. There is a timeout of 5 seconds, after which an error message will appear in the extension data text box instead.

Example:
Recording 2023-10-23 at 12 05 14

To test

  1. Must have an external extension with this API adopted. If you have a personal extension to test on, fantastic. If not, check out this extension's suuuper basic implementation
  2. Once the extension is installed/adopted the API, navigate to Help: Report Issue and file an issue on that extension. To test loading, you could force a timeout, etc.
  3. Fill in some blanks, then hit submit/preview. NOTE: if you are signed in on GitHub in Insiders, it will automatically submit the issue. You can only preview when signed out of GitHub.

Some things to make sure:

  • The right things are hidden
  • When you switch between an extension that implements this API and one that doesn't that the right info in the issue reporter is shown/hidden
  • Data is populated correctly in both template and extension data sections.
  • When loading, you should be unable to submit the issue.
  • Correct text is sent to GitHub after pressing submit
     

Let me know what you think overall!

Note: you must adopt this in an external extension (not a built-in to VS Code one)

Helpful links

@justschen
Copy link
Contributor Author

Known bug atm that issue data is not being sent over after something I changed yesterday.

@rzhao271 rzhao271 assigned joyceerhl and unassigned rzhao271 and joyceerhl Oct 24, 2023
@rzhao271
Copy link
Contributor

Not sure how I reassigned Joyce
Just Paula left to verify this issue.

@paulacamargo25 paulacamargo25 removed their assignment Oct 24, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants