-
Notifications
You must be signed in to change notification settings - Fork 223
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
Added a new debug host field to AWS plugin global settings #1402
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1402 +/- ##
=============================================
- Coverage 54.48% 39.95% -14.53%
+ Complexity 1183 922 -261
=============================================
Files 297 297
Lines 11255 11123 -132
Branches 1451 1418 -33
=============================================
- Hits 6132 4444 -1688
- Misses 4452 6168 +1716
+ Partials 671 511 -160
Continue to review full report at Codecov.
|
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.
Thanks for the contribution!
What's the motivation around having this as a global setting vs it being part of the Run Configuration itself where it'll be more discoverable? Is this something you see working for the ECS cloud debugging feature too?
Are there other IntelliJ-wide settings we could/should use instead? I imagine that remote debug of regular applications runs into the same problem right?
...-core/src/software/aws/toolkits/jetbrains/services/lambda/execution/local/SamDebugSupport.kt
Outdated
Show resolved
Hide resolved
@kiiadi thanks for taking the time to review. To my understanding the Sam executable setting is unlikely to change per run/debug configuration and so is the location of the cloud debug cli executable, and this is why they are global (I could be very wrong). I also considered the debugger host to be a setting that is unlikely to change per run/debug configuration, this is why I made it global. I don't see this working with the ECS cloud debugger feature as they both seem very specific to the type of code, lambda VS code sitting in an Amazon ECS with AWS Fargate. I do not think there are other intellij wide settings that can be used instead. Not sure about the remote debugging of regular applications and this problem, but I think the issue would be the same. |
Just circling back here - I want to understand a bit more about your setup to see why we need this? Is there a way we can 'infer' the "local" connection? e.g would replacing hard-coded |
The only way I can see this working without allowing a user to explicitly set the IP of their debug host, is to determine if Intellij is connected to Docker via Docker Machine and then grabbing the IP of the Docker host somehow.
|
Are you able to connect to Docker from the IDE? |
Yes indeed, I am able to connect from the IDE. |
Querying the Docker plugin isnt too difficult, the Does your Docker Config API URL contain the same IP you need to debug? |
Yes it does contain the same IP I need to debug. |
#1484 stores it in the run config and queries it from Docker plugin |
Types of changes
Description
Added a new text field above cloud debug called 'Local debug host', this value is saved on a global AWS plugin level and is then used by each debug extension in place of the hardcoded "localhost" host.
In the event that the local debug host field is left blank, the debug host defaults to "localhost".
Motivation and Context
The hard coded debugger host in the debug extensions support files, made it impossible to debug lamda functions locally when the debug host is not accessible via "localhost". This change exposes that setting allowing better flexibility.
Related Issue(s)
#642 #784
Testing
Tested changes by running local gradle tests and making sure those passed, and by building the plugin and running it in intellij ultimate using the debugging locally guide. Also testing both scenarios where no value is specified and where value is specified.
Testing environment:
Windows 10 - Slow ring build 19033
SAM CLI: 0.31.1
AWS CLI: 1.16.280
Pycharm & Intellij Ultimate
Screenshots
Checklist
gradlew check
succeedsLicense
I confirm that my contribution is made under the terms of the Apache 2.0 license.