-
Notifications
You must be signed in to change notification settings - Fork 9
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
Fix: port forwarding in VS Code #2656
base: main
Are you sure you want to change the base?
Conversation
I'm still not quite sure about the underlying issue here. I've never experienced the situation described in #2642, and it doesn't seem straightforwardly reproducible (e.g. does it happen that way every single time going through an Agency Card flow?) In any case, on Linux at least, this change appears to have no effect. I'm still seeing all the various ports on the ports tab: |
I tested this locally on my macOS. I am able to access the server and healthcheck: And the docs: http://localhost:8001/benefits/ But not the Benefits client app at http://localhost:11369/ after running the debugger. Am I mising something? |
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.
Confirmed on VS Code Insiders (pre-release) 1.97.0-insider
. Ran the app in container, opened docs, server and the client. Went through client flow.
I'm guessing, but from the screenshot it looks like maybe ![]() I would expect that very last entry to have |
So I noticed in your screenshots @lalver1 that you don't have any "Statically forwarded" ports. In mine, I have two. I've realized they correspond with the If I comment out (Side note: I'm not sure why I have two since we're just publishing one port, but I guess they are for the same port number, just with different hosts.) I'm not sure why your VS Code isn't showing you the ports corresponding to the published ports for |
I was also curious about the "Auto Forwarded" ports that y'all have, and I've learned that "auto-forwarding" is referring to a feature in VS Code where the terminal will detect ports being allocated and set up forwarding for that port. I didn't find this in any official documentation, but rather from piecing together various comments online:
I think auto-forwarding is what's happening when we click the @lalver1 Maybe the extra port that would show up and cause hanging is from the auto-forwarding feature? |
With what we know now, does @lalver1's solution seem ok? I guess there are multiple places where the behavior can be changed (Settings vs. |
Oh yeah I think it seems OK, but also maybe we should disable this automatic forwarding? Seems like it doesn't matter (you've had it disabled) and it also seems like it could be the source of the some of the problems @lalver1 and @machikoyasuda experience on Mac. |
Closes #2642
This PR changes the behavior of the dev container to only auto forward the ports associated with the
docs
andserver
services in the compose file. By setting"otherPortsAttributes": { "onAutoForward": "ignore" }
, any other ports should not be auto-forwarded at all.Reviewing
localhost:DJANGO_LOCAL_PORT/
(open the benefits app, submit the eligibility form, navigate to the admin, etc.) and that thePORTS
tab in VS Code always only shows 2 ports, theserver
anddocs
ports