rokucommunity / vscode-brightscript-language

A Visual Studio Code extension for Roku's BrightScript language
MIT License
112 stars 40 forks source link

Add commands to rekey device and create packages #509

Closed fumer-fubotv closed 8 months ago

fumer-fubotv commented 1 year ago

Added support for the following commands:

  1. Rekey Device: Rekey specified device based on the signing password ("brightscript.remoteControl.signingPassword") and package file ("brightscript.remoteControl.signedPackagePath") provided.

  2. Create Package: This will present user a list of available launch configs to choose from. Once selected it will create a .zip file and .pkg file based on the config and will save them to the ${workspacefolder}/out

  3. Rekey Device and Create Package: This will first rekey device and then create package for the selected launch config

Here's a demo of the "Rekey Device" command:

https://github.com/user-attachments/assets/47c40787-c1d7-4ea8-88af-f90df71be0b4

fumer-fubotv commented 1 year ago

I have a few suggestions:

  1. This stuff in this file getting a bit large, so let's move all this new logic out of BrightScriptCommands.ts into a separate src/commands/RekeyAndPackageCommands.ts file.
  2. There seem to be a few bugs around picking a json file for the "Rekey device" flow. When I pick a rokudeploy.json with only rekeySignedPackage, devId, signingPassword, convertToSquashFS, it fails with an error "A system error occurred (getaddrinfo ENOTFOUND :80). I'm assuming it's because the logic currently assumes that everything was supposed to be included in the json. That's not how it should work. We should load any values we find in the json, but then still walk through the manual prompts to allow the user to confirm those are the values they want, and fill in any missing values.
  3. When running "Rekey Device", and choosing "enter manually". after I enter my signing password, it just pops up a new file picker dialog, but there was no messaging around WHAT I'm supposed to pick. I think we need another intermediary dropdown with instructions saying "pick your pkg" so they know why the file picker appears.
  4. After running the manual rekey for our internal app, I get this error at the end. image

Most of the suggestions are addressed in the update. However i was not able to reproduce the error in #4 you mentioned

TwitchBronBron commented 10 months ago

@fumer-fubotv I finally got a chance to look over this. I've pushed some changes to optimize the flow a bit....somehow I had these sitting in an uncommited branch since November!

The biggest change here is that we really need to prompt the user for all the details every time (either from json or from input boxes). We can't use values like the last password or last host used, because that might not be the device they want to rekey.

One thing we need to tweak, is for the file picker modal, we should add information showing the currently selected zip (if there is one from rokudeploy.json), and add another button in that case saying "I want to change it". I see it having 2 flows:

  1. there is no package picked yet, so they have "Pick a file" and "cancel".
  2. There is already a default package set, so they have "Use the current file", "Pick a different file", and "cancel" image

It would be great if you could run through this workflow a few times to test it out, and iron out any rough edges. Then It should probably be good to go.

fumer-fubotv commented 9 months ago

Host and create package flows have been updated as per feedback

fumer-fubotv commented 9 months ago

I tried to reproduce the scenarios mentioned above and below are the findings:

  1. Create package using "use folder" works successfully if the specified folder has a manifest in it. Otherwise it will throw an error (Just fyi- Current implementation already zip the source folder user selects)
  2. Create package using "use a rokudeploy.json" expects source to be specified.
  3. Create Package using launch.json has been working fine for me. Lets connect to reproduce/resolve this issue