Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

lalver1
Copy link
Member

@lalver1 lalver1 commented Jan 31, 2025

Closes #2642

This PR changes the behavior of the dev container to only auto forward the ports associated with the docs and server services in the compose file. By setting "otherPortsAttributes": { "onAutoForward": "ignore" }, any other ports should not be auto-forwarded at all.

Reviewing

  1. Exit your current dev container
  2. Switch to this branch
  3. Rebuild and reopen the dev container
  4. Start the debugger
  5. Verify that the app is always reachable from your browser at localhost:DJANGO_LOCAL_PORT/ (open the benefits app, submit the eligibility form, navigate to the admin, etc.) and that the PORTS tab in VS Code always only shows 2 ports, the server and docs ports

@lalver1 lalver1 self-assigned this Jan 31, 2025
@github-actions github-actions bot added the docker Application container, devcontainer, Compose, etc. label Jan 31, 2025
Copy link

Coverage report

This PR does not seem to contain any modification to coverable code.

@lalver1 lalver1 marked this pull request as ready for review January 31, 2025 21:54
@lalver1 lalver1 requested a review from a team as a code owner January 31, 2025 21:54
@thekaveman
Copy link
Member

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:

image

@thekaveman thekaveman added the chore Chores and tasks for code cleanup, dev experience, admin/configuration settings, etc. label Feb 1, 2025
@machikoyasuda machikoyasuda self-requested a review February 3, 2025 17:14
@machikoyasuda
Copy link
Member

I tested this locally on my macOS.

My ports tab looks like this:
image

I am able to access the server and healthcheck:
image

And the docs: http://localhost:8001/benefits/
image

But not the Benefits client app at http://localhost:11369/ after running the debugger. Am I mising something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chores and tasks for code cleanup, dev experience, admin/configuration settings, etc. docker Application container, devcontainer, Compose, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port Forwarding in VS Code is unstable
3 participants