Open the VS Code extension test script in VS Code - Insiders
vscode-insiders://ms-dotnettools.dotnet-interactive-vscode/openNotebook?url=https%3A%2F%2Fraw.githubusercontent.com%2Fdotnet%2Finteractive%2Fmain%2FNotebookTestScript.dib
If the URL provided does not end in the notebook file's extension, you can specify the notebookFormat query parameter as an override with the supported values of 'dib' and 'ipynb'.
E.g.,
vscode-insiders://ms-dotnettools.dotnet-interactive-vscode/openNotebook?notebookFormat=ipynb&url=https://contoso.com/myNotebook
URL redirects are supported by this scenario and the extension and/or notebookFormat parameter will be pulled from the final resolved URL.
The PR build definition can be found here or by nagivating through an existing PR.
NuGet packages produced from every build of main are auto-published to the NuGet feed https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
The signed build and CI machines aren't allowed to access npmjs.org directly. If you add or update a Node package and your PR fails with:
Building NPM in directory src\polyglot-notebooks-vscode-insiders
npm ERR! code E401
npm ERR! Unable to authenticate, your authentication token seems to be invalid.
npm ERR! To correct this please trying logging in again with:
npm ERR! npm login
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\cloudtest\AppData\Local\npm-cache\_logs\2023-03-07T20_48_41_356Z-debug.log
...then you'll need to ensure the new packages are added to the internal NPM mirror.
To do this:
(this part only happens once)
- Navigate to the internal NPM package feed: https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-public-npm
- Click "Connect to Feed".
- Select "npm".
- Follow the "Project setup" instructions shown.
(this part may need to happen multiple times)
- Clear your local NPM cache with
npm cache clean --force. - Delete the
node_modulesdirectory in the directory where you added/updated the packages. - Re-run
npm installin the directory where you added/updated the packages.
When you do this locally while authenticated, any packages not on the internal mirror will be copied from npmjs.org.
The signed build produces three versions of the VS Code extension, 2 against Stable VS Code and 1 against Insiders. Both versions against Stable append a "0" character to the extension version number and Insiders appends a "1" character.
The Stable extension with the locked tool version can be published via this release definition. This will also immediately publish the corresponding Insiders version of the extension.
The Stable extension with the latest tool can be published via this release definition. This will also immediately publish the corresponding Insiders version of the extension.
The Insiders extension with the latest tool can be published via this release definition.
Once any of those release definitions are invoked, the new extension will appear in the VS Code marketplace approximately 10 minutes later, after the marketplace has run their own internal validation.
The publish/verification script is located in this repo at eng/publish/PublishVSCodeExtension.ps1.
The variable group dotnet-interactive-api-keys contains the secret vscode-marketplace-dotnet-tools-publish-token which holds the PAT used to upload the .vsix to the VS Code Marketplace. If this PAT needs to be regenerated:
- Download the latest
vsm.mac.patpackage fromhttps://dev.azure.com/devdiv/OnlineServices/_artifacts/feed/vsmarketplace - From a
pwshprompt rundotnet tool install --global --add-source "$env:USERPROFILE\Downloads" vsm.mac.pat - Run
vsmpat generate. You'll be prompted to login through a web browser and 8-10 seconds later the PAT will appear on the console.
-
(One time) Install the Arcade DARC tool by running
eng/common/darc-init.ps1from apwshprompt. -
(One time) Run the command
darc authenticate. A text file will be opened with instructions on how to populate access tokens. -
(Side note) The help system in the
darctool is very good. You can either rundarc --helpordarc COMMAND --helpto get help on any command. -
View the current channel publishing configuration by running
darc get-default-channels --source-repo dotnet/interactive. You will see several entries that look look like this:(2459) https://github.com/dotnet/interactive @ main -> .NET Core Tooling DevThis means that the
mainbranch ofdotnet/interactiveis publishing packages to the.NET Core Tooling Devchannel. -
Set the new branch to publish to the appropriate channel by running
darc add-default-channel --channel "THE CHANNEL NAME" --branch "feature/the-new-feature" --repo https://github.com/dotnet/interactive. The channel name you'll most likely use is.NET Core Experimentalwhich corresponds to thehttps://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.jsonNuGet feed. To determine the name of any channel, see the below section. -
Re-run step 3 to verify that the new branch is publishing to the correct channel.
-
Any new build from that branch will publish packages to the specified channel.
-
Be sure to update the appropriate
dotnet-interactive.interactiveToolSourcesettings in the VS Code extension'spackage.jsonfor both stable and insiders.
The mapping between a channel name and the corresponding NuGet package feed, e.g., .NET Core Tooling Dev => https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json isn't straight forward. I'll use the above values as an example.
- View the
PublishingConstants.csfile in thedotnet/arcaderepo on GitHub. - Search for the channel name, e.g.,
.NET Core Tooling Dev. As of this writing the definition is here. - Notice the
targetFeedsparameter points to theDotNetToolsFeedsvariable. - The
DotNetToolsFeedsvariable is defined here and it's entry for shipping packages lists another variable,FeedDotNetTools. - The
FeedDotNetToolsvariable lists the NuGet package feed.
To roll back to a previous build, you'll need to:
- Find the build you'd like to roll back to.
- Copy the commit's SHA.
- Start a new signed build with that SHA.
- Use that build to publish like normal.
This ensures that the version number of the extension is always increasing to pass the VS Code Marketplace verification.
The public GitHub code is internally mirrored here to enable signed builds. You'll likely never need to do anything with this.