-
Notifications
You must be signed in to change notification settings - Fork 302
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
Review whether the recent port attributes improvements should be demonstrated in the samples #4838
Comments
Also related in ports attributes documentation and updates: Add portsAttributes to devcontainer.json doc #4711. |
@alexr00 I'd love to get your input here. We've already updated the remote-try-* samples that involve port forwarding to include the As an example, in the Go sample, the README references In the latest remote release notes (and #4623), I saw where we call out being able to use a regex for portsAttributes, along with the new Do you think we should demonstrate either of these in the samples? The
I also saw in a test plan item from the iteration that the try-Node sample was a possible starting point for testers for the regex setting, so I wasn't sure if we wanted to add it to our samples for all users as a reference? |
I think including the regex match option for portsAttributes in the node sample and maybe other examples makes a lot of sense. I'm less sure of otherPortsAttributes. If that's included, and users base their projects off of the samples, then they might not get good auto port forwarding behavior if their project doesn't use the same ports as the sample. Is there a president for including a property/setting in devcontainer.json and having it commented out? |
Including the regex match option makes sense to me too! It'll help not only raise awareness but also provide a helpful example of how to implement it, since this may sound tricky to folks at first. That's also a good point about otherPortsAttributes and potential unintended behavior; we wouldn't necessarily want to include it by default if users base their projects off the samples, or start modifying the samples and don't fully realize what otherPortsAttributes is doing.
When we adjusted the samples to use dynamic port forwarding, we kept the We also explain this setting in the README if users would like to modify and rebuild their container: Based on this discussion, here's a proposal for slightly updated port forwarding in the samples:
Does that sound like a reasonable plan? cc @Chuxel |
All that sounds great to me. |
@bamurtaugh Lets also move the ports out of the |
@Chuxel I want to make sure I understand what you mean here; the current ports properties are top-level properties not part of Is there something else we should update within the samples or docs? |
@alexr00 I've tried different expressions in "portsAttribute," and when I run the app, the attributes are respected and the port forwards correctly, but I end up with 2 ports rather than one. If I use "3000" instead of a regex, I get just one forwarded port. Is this expected? Am I using the setting incorrectly? |
Also opened microsoft/vscode-docs#4462 to update docs to reference the latest properties. |
@bamurtaugh this is actually expected. Here's a breakdown of what's happening:
Does that make sense? I think it is correct to prefer what is in the |
@alexr00 Thank you for this breakdown! I can see why this is happening and realize now how the regular expression matches the process from JS Debug. I thought I think my remaining question is why I'm still notified about port 3000, even when leaving out
At first, I was thinking I'd prefer something different here, i.e. to still not see the debug ports by default. However, the more I think about it, it feels like our general principle is for devcontainer.json to be the final/upper-level set of settings that apply, and where users can "override" other things, so I think this is correct. Also, microsoft/vscode#115616 feels like it'd end up addressing my main concern here anyways, which isn't necessarily with how settings in general apply but more so with confusion around debug ports. |
You get notified for 3000 because the default for all discovered ports is to notify. microsoft/vscode#115616 is already implemented here, which is why by default you don't see the debug port. |
Thank you for all of the collaboration here! Closing this issue since the ports updates have been merged into the remote samples. If you have any other feedback, please let me know. |
We recently updated the remote-try-* samples based on the new remote ports attributes.
With additional updates (i.e. https://github.com/microsoft/vscode-docs/blob/main/remote-release-notes/v1_55.md#use-a-regex-for-portsattributes, https://github.com/microsoft/vscode-docs/blob/main/remote-release-notes/v1_55.md#configure-default-port-detection-behavior), we should review whether any further changes should be demonstrated in the samples to help users and raise awareness of these settings.
The text was updated successfully, but these errors were encountered: