-
Notifications
You must be signed in to change notification settings - Fork 642
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
- restore ability to use a random container name #1410
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1410 +/- ##
=========================================
Coverage 59.03% 59.03%
- Complexity 1981 1985 +4
=========================================
Files 162 162
Lines 9019 9023 +4
Branches 1363 1364 +1
=========================================
+ Hits 5324 5327 +3
Misses 3205 3205
- Partials 490 491 +1
|
da929bf
to
447efa3
Compare
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.
Hi @jgangemi, nice to meet you again ;-) Hope you are doing well !
See my comment below, but I really wonder, which feature worked for you in the past and is now broken. Did we already had a %r
placeholder ? Sorry for my ignorance, but I'm working on this plugin only in intervals, and its really in kind of a maintenance mode (i don't use it actively, nor do I currently program in Java at all ;-)
@@ -50,6 +50,9 @@ When specifying the container name pattern the following placeholders can be use | |||
| *%i* | |||
| An index which is incremented if a container has already been created. With this parameter it is easily possible to have multiple, similar containers. See the example below for more details. | |||
|
|||
| *%r* |
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.
Is it required that %r is given as a single argument ? What happens to any additional character added to the pattern ? Are they just ignored ? If so, then %r is not the same like the other "placeholders" as it just indicates a different behaviour that e.g. no name should be set at all. While the feature to have random containers names is desirable, its probably not a good fit to introduce it via a placeholder pattern.
Maybe you could just check, whether the patterns contains a single "%r" with no extra chars. If this is the case, don't set a name. If the pattern contains a %r with additional characters, then throw an error. So I just would add it as a special case, and don't try to push it into the regular placeholder handling. |
prior to this #1004 being merged, if i did not specify any options for the container name it would be started with a random one from the docker engine. since being merged, i can find no other way to get a random container name, hence this PR. what if the naming pattern was intentionally assigned as always, i'm happy to make whatever changes are necessary to get this functionality back. it seems this is the general code area the change needs to occur in either way. |
Well, what if you want to call your container
I think, this is probably the best way to reintroduce. In retrospective, it would have been better to let the default be an empty name, not the one that is currently chosen. |
i agree. i'm quite surprised this hasn't been a bigger issue b/c it prevents you from doing multiple builds in a CI environment. having just re-read the docs, i see this:
but that doesn't seem to work the current version if the plugin i am using - i'll try upgrading to see if it's working in the latest. either way, i would still prefer to have random name functionality so i'll make the suggested changes. |
51ec870
to
de6730f
Compare
de6730f
to
e020faf
Compare
Kudos, SonarCloud Quality Gate passed! |
any chance of seeing movement on this? right now there is still some bug that exists w/ the |
Sorry just back for the weekend (tbh, I can't spend more than once every x months on this plugin anymore, but working on to hand it over to @rohanKanojia and anybody else would like to continue to work here). The more I read through the history of this issue, the more I think we should revert back to a default of a random container name (as it is also used by Docker itself when no name is specified). In retrospective, it was indeed an error to change the default value I've seen that @rohanKanojia already added the desired change, so happy to merge this PR now. |
@@ -50,6 +50,9 @@ When specifying the container name pattern the following placeholders can be use | |||
| *%i* | |||
| An index which is incremented if a container has already been created. With this parameter it is easily possible to have multiple, similar containers. See the example below for more details. | |||
|
|||
| *%r* | |||
| A random container name choosen by the docker engine. |
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.
| A random container name choosen by the docker engine. | |
| An empty name that triggers are random container name chosen by the docker engine. If using `%r` this must be the only content of this pattern. Otherwise, an error is thrown. |
@@ -50,6 +50,9 @@ When specifying the container name pattern the following placeholders can be use | |||
| *%i* | |||
| An index which is incremented if a container has already been created. With this parameter it is easily possible to have multiple, similar containers. See the example below for more details. | |||
|
|||
| *%r* |
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.
| *%r* | |
| *%e* |
Can we use something different than %r
please ? Because in the future we might also to add %r
as a placeholder for a client-side random number, that we add to some pattern.
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.
wait a second with merging, just want to improve it a bit an change the replacement parameter name.
f75d04c
to
16c15b4
Compare
16c15b4
to
4a2486a
Compare
@rohanKanojia could you give my update a quick look ? If it looks ok, happy to merge it now. |
thanks @rhuss!! i'm always happy to help w/ things when time allows as well. i use this plugin heavily in a lot of places, so best it stays around. :) |
this addresses #1352 and restores the ability to get a random container name chosen by the docker engine by specifying
%r
as the container pattern.the loss of this functionality from previous plugin versions is a regression for me. none of the current naming schemes allows me to run multiple PRs for a project on the same instance b/c i get container naming conflicts.
@rhuss 👋