Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Container name feature implementation #774
Container name feature implementation #774
Changes from 13 commits
d39a873
604e5fe
c5646b0
01f84d1
e45d92b
37d9f1f
8409b45
9cce3d8
5536800
c0f1d51
5981dcf
ae7aadf
dce892d
56abfc4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Nice touch!
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: How about
_make_container_manager
instead of_get_
? Get creates the impression that you are getting an existing instance whereas this method actually creates a new instanceThere 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've chosen that name, because of the surrounding code. It has
_get_{something}
pattern. Like_get_debug_context()
which also creates a new instanceThere 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 find this import strange. I understand why but the Options shouldn't need to interact with a ContainerManger. Maybe we should place the
is_valid_container_name
somewhere else?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.
It can go to utils or something, but for me, ContainerManager should be the only one responsible for the whole Docker management cycle. It will semantically be better, what do you think?
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.
To me validation isn't part of that management cycle, it more of a attribute of the container itself not the class that manages.
@sanathkr or @thesriram what are your thoughts here. I just want to make sure we keep the right abstractions is all.
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.
@jfuss, if we treat it like an attribute we can simply inline this method here. But for me, it is more like OOP, if we leave it in
ContainerManager
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 more meant on the
Container
class instead of theContainerManger
. This isn't a huge deal for me, just something I noticed while reading through.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 am ok with this abstraction you have. I think your reasoning is good. I think we just have a slightly different model for what is in the Docker management cycle. I am more worried about the use of
container_name
outside of debugging than this :)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.
@jfuss, okay, then 😅 As for the container_name I do agree, that it is more about debugging, then something else. I will get back to PC, consider options and get back to you really nice catch.
Also, as related question, what do you think about determining whether
DebugContext
is true withdebug_port or debugger_path
as debugging port does not make sense for don't core debugging and customer would be forced to supply unused argument to get it workingThere 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.
It might make sense to add one more abstraction to debugContext, with the transport. Since technically dotnet debugging can be done over ssh or docker. I'm not sure about other languages.
We still want to be able support ssh based debugging too. Thoughts?
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 don't think we should set an Env Var for this. My biggest concern with introducing this
container_name
option is that it breaks Lambda calling Lambda locally. Having an Env Var increases the risk of this, as it becomes a set and forget.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.
The container_name options is meant to help with debugging right? Can we move this into the DebugContext?
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.
Can you fold this and the DockerImagePullFailedException into the
(InvalidSamDocumentException, OverridesNotWellDefinedError)
tuple? Make this a little less long.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.
Okay, I thought of that initially, but decided to stick to existing separation, as it seemed to me as intentional
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 wrote the DockerImagePullFailedExpection there. Not sure why I did it that way instead of what I suggested. :)