Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-23217

"Prefix/Suffix Start Slave Command" does not automatically append/prepend "&&"

      If the user wants to add a unix command like "export SOMETHING=something" to "Prefix Start Slave Command" or "Suffix Start Slave Command" in a slave configuration,
      the next slave launch will most likely fail, because "&&" is not automatically appended/prepended to the entered command(s).

      Instead of letting the user find out the hard way, Jenkins should append/prepend "&&" if necessary.

          [JENKINS-23217] "Prefix/Suffix Start Slave Command" does not automatically append/prepend "&&"

          Fred G created issue -
          Fred G made changes -
          Component/s New: ssh-slaves [ 15578 ]
          Component/s Original: core [ 15593 ]

          Daniel Beck added a comment -

          There are shells that do not support && (notably fish).

          Daniel Beck added a comment - There are shells that do not support && (notably fish ).

          Fred G added a comment -

          OK. I wasn't aware of that. So the current shell needs to be detected as well.

          Fred G added a comment - OK. I wasn't aware of that. So the current shell needs to be detected as well.

          Daniel Beck added a comment -

          An easy solution would be to (optionally create a temporary script file and) run multiple commands one after the other in the shell. One per line. All shells should support that.

          But there's a problem with that: Any change here will be backwards incompatible.

          {{LANG=en_US.UTF-8 }} should work like a charm in bash as a prefix command, but not if run independently.

          I don't see the benefit justifying the cost here.

          Daniel Beck added a comment - An easy solution would be to (optionally create a temporary script file and) run multiple commands one after the other in the shell. One per line. All shells should support that. But there's a problem with that: Any change here will be backwards incompatible. {{LANG=en_US.UTF-8 }} should work like a charm in bash as a prefix command, but not if run independently. I don't see the benefit justifying the cost here.

          Fred G added a comment -

          I agree that a solution that covers all corner cases might be costly. At the same time I value the cost of having a user stumbling over this bug quite high as well.
          At the very least, both fields need a info/help text explaining the possible problems.

          Fred G added a comment - I agree that a solution that covers all corner cases might be costly. At the same time I value the cost of having a user stumbling over this bug quite high as well. At the very least, both fields need a info/help text explaining the possible problems.
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 155774 ] New: JNJira + In-Review [ 179117 ]

          I am not really a fan of this string concatenation approach but adding operands is even more surprising. Current documentation says:

          The actual command being issued will be the concatenation of Prefix Start Slave Command, the command to launch slave.jar and Suffix Start Slave Command, without any separators.

          I so reason to keep this open.

          Oliver Gondža added a comment - I am not really a fan of this string concatenation approach but adding operands is even more surprising. Current documentation says: The actual command being issued will be the concatenation of Prefix Start Slave Command, the command to launch slave.jar and Suffix Start Slave Command, without any separators. I so reason to keep this open.
          Oliver Gondža made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

            Unassigned Unassigned
            fredg Fred G
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: