-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Build automation window for faster test iteration with device #87
Conversation
This is a first time checkin of a Build & Deploy window. It supports one-button clicks for building the SLN file, building the APPX, uninstalling & installing on device, grabbing the log file (among other things). Also has a single click build SLN, APPX, and install option.
Hi @jevertt, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
public const int kTimeoutMS = (int)(kTimeOut * 1000.0f); | ||
public const float kMaxWaitTime = 20.0f; | ||
|
||
public static readonly string kAPI_ProcessQuery = @"http://{0}/api/resourcemanager/processes"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http only works when connected over USB (localhost:10080) or if the user explicitly disables HTTPS in the Windows Device Portal via the browser.
Requiring the user to disable HTTPS is generally not a good idea. Using HTTPS will require your code to get / validate the server certificate from the device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as we specify in the ReadMe or Info to remind people to keep their device connected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it currently requires people to first...
- pair the device.
- disabling HTTPS requirement in the device portal (or always connect local).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please update the ReadMe.md with information about this component?
@jevertt this is absolutely EPIC! Will make so many developers happy :) |
Right now the HoloToolkit menu has a Build subsection with easy output of the Sln and an option to open the Sln. I'm thinking we should add a button here for outputting the Sln in the same manner that the build menu currently does, and then drop that subsection from the menu. Also, to note: Resolves - #49 |
public class BuildDeployPortal | ||
{ | ||
// Consts | ||
public const float kTimeOut = 6.0f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious about the 'k' prefix on these. @NeerajW Do we have a coding standard? Or just shooting for consistency within a file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We recommend and follow general C# coding conventions. Also match the style in files for sure.
Personally, I can do without the 'k' prefix :)
Cool stuff, definitely better than my PowerShell script, but not sure this method should be legitimized further given:
|
{ | ||
// Consts | ||
public const float kTimeOut = 6.0f; | ||
public const int kTimeoutMS = (int)(kTimeOut * 1000.0f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Use the TimeSpan class to clean up manual arithmetic
@riverar, Windows Device Portal seems to be the most appropriate solution for this feature. Since the target is developers building applications for HoloLens, it is reasonable to expect that the device is in developer mode. |
@davidkline-ms
|
@riverar Windows Device Portal is the supported form of communicating with Windows devices on all different platforms like HoloLens, Phone, Xbox etc. It's reasonable to expect developers to have this enabled for their HoloLens. Let me know if I can help answer any other questions. |
And how do you plan on migrating users back onto HTTPS? I think landing that in v1 is critical for security, agree on everything else! |
We could limit the connection, in this iteration, to USB and then add support for specifying an ip address (using https) in a future update. |
Personally, I'd rather give the user the ability to make the choice (rather than making the choice for them) - only works wired or disabling HTTPS and it works both wired and remote. This is an option that is exposed to people in the Device Portal. And I will work towards adding remote HTTPS support. |
Users will turn off HTTPS and not turn it back on when its support is eventually rolled out, leaving their devices in an insecure state. Also consider the HoloLens Academy scenario, in which devices are remote controlled and are deployment targets via public IP not localhost. (HA at BUILD in fact stressed wireless deployment!) In this scenario, malicious actors on the network can sniff out the portal Basic auth credentials... a non-starter, really. I like @davidkline-ms's suggestion for v1. If I get overruled here, a commitment to break HTTP support in the next push, forcing users to reconfigure the Device Portal, would be strongly recommended. |
What about this. When HTTPS support is added, also add a checkbox "Don't allow non-secure connections" that throws an exception if non-secure connections are set on the target device (and default it to true)? Or maybe a dialog box that says - non-secure connections are currently allowed on device, would you like to disable this setting? (and do it for them) |
|
||
// Username/Password (and save seeings, if changed) | ||
string newUsername = EditorGUILayout.TextField(kGUIHorizSpacer + "Username", deviceUser); | ||
string newPassword = EditorGUILayout.TextField(kGUIHorizSpacer + "Password", devicePassword); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch to EditorGUILayout.PasswordField so we get masked input in editor
@jevertt, We could definitely check the device and, if indicated change the settings for them. In my experience, setting the device to HTTP does not preclude it from talking via HTTPS, so they can safely say "no" and we could still use HTTPS. |
Removed k in constants & made password field hidden
I don't understand the strong desire to ship support for an insecure configuration. I cloned the proposed commits and wired up a ServerCertificateValidationCallback that ignores (only) CRL issues (as the HoloLens root cert doesn't have a CDP specified). I then dropped the certificate into %AppData%\Roaming.mono\certs\Trust and things mostly worked until I hit what appears to be old TLS bugs in Mono, perhaps related to self-signature, Subject Alternative Name extension, or something else entirely. I'm worried HTTPS support is far away now, perhaps restricting this to loopback use only is in order. |
if (GUILayout.Button("Open SLN", GUILayout.Width(buttonWidth_Quarter))) | ||
{ | ||
// Open SLN | ||
FileInfo slnFile = new FileInfo(Path.Combine(buildDirectory, PlayerSettings.productName + ".sln")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acts funky if no solution exists. Maybe disable in that case? Current Build menu asks if you'd like to build one in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Win32Exception: The system cannot find the file specified.
System.Diagnostics.Process.Start_shell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process)
System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process)
System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo)
System.Diagnostics.Process.Start (System.String fileName)
HoloToolkit.Unity.BuildDeployWindow.OnGUI () (at Assets/HoloToolkit/Build/Editor/BuildDeployWindow.cs:128)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch - I'll take a look a this
Should we drop the current Build menu in this PR so there's no period of overlap? |
…ith HTTPS default setting) & removed redundant build sub-menu
} | ||
else | ||
{ | ||
Debug.LogError("Solution file does not exist (" + slnFilename + ")"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something like the below from the old BuildMenu? Might be more clear than an error in the logs.
bool buildNow = EditorUtility.DisplayDialog("Solution Not Found", "We couldn't find the solution. Would you like to Build?", "Yes, Build", "No");
Alternatively you could check for the filepath before adding the button and disable the button if it doesn't exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it - in now.
… isn't found (per feedback)
Thanks for the updates @jevertt. I think we are ready to merge. |
Thanks for tolerating my moaning, I think we ultimately went down the right road here. Cool stuff @jevertt! |
@riverar, |
This is a first time checkin of a Build & Deploy window. It supports
one-button clicks for building the SLN file, building the APPX,
uninstalling & installing on device, grabbing the log file (among other
things). Also has a single click build SLN, APPX, and install option.