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

Form validation considers the rename "no op" to be an error

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None

      Currently just going to the /job/whatever/confirmRename form results in a form validation error: "The name whatever is already in use".

      Instead this should be an informational message about this being the current name, or something like that.

       

          [JENKINS-49906] Form validation considers the rename "no op" to be an error

          Devin Nusbaum added a comment - - edited

          danielbeck what do you think about just leaving the name blank by default on that page? You'd still get an error ("No name is specified"), but since you have to pick something for the new name anyway that doesn't seem like a problem.

          I can also improve the error message in the case where the name is the same as before to "The new name is identical to the current name".

          EDIT: I should clarify, do you think renaming to the same name should succeed as a no-op, fail, or do something else?

          Devin Nusbaum added a comment - - edited danielbeck what do you think about just leaving the name blank by default on that page? You'd still get an error ("No name is specified"), but since you have to pick something for the new name anyway that doesn't seem like a problem. I can also improve the error message in the case where the name is the same as before to "The new name is identical to the current name". EDIT: I should clarify, do you think renaming to the same name should succeed as a no-op, fail, or do something else?

          Daniel Beck added a comment -

          I expect that it is rather likely that new job names will be similar to old job names, so would keep the default value to make minor changes easier. If you could detect it's the current job's name, just showing nothing, or an info message "same name" would be useful.

          EDIT: I should clarify, do you think renaming to the same name should succeed as a no-op, fail, or do something else?

          Not sure. Either could work. Since form submission that would change nothing is unlikely to be intended, it should probably remain an error.

          Daniel Beck added a comment - I expect that it is rather likely that new job names will be similar to old job names, so would keep the default value to make minor changes easier. If you could detect it's the current job's name, just showing nothing, or an info message "same name" would be useful. EDIT: I should clarify, do you think renaming to the same name should succeed as a no-op, fail, or do something else? Not sure. Either could work. Since form submission that would change nothing is unlikely to be intended, it should probably remain an error.

          Devin Nusbaum added a comment -

          It feels wrong to me to not show a message or to have an info message if it causes an error during submission. Would you be ok with just changing it from an error to a warning, and making the message more specific, or do you feel strongly that there should be no warnings or errors when the page is opened?

          Devin Nusbaum added a comment - It feels wrong to me to not show a message or to have an info message if it causes an error during submission. Would you be ok with just changing it from an error to a warning, and making the message more specific, or do you feel strongly that there should be no warnings or errors when the page is opened?

          Daniel Beck added a comment -

          Warning (or unstyled info) would be fine, but it needs to be more specific than "name already taken". "Please specify a different name than the current one" or similar perhaps.

          Daniel Beck added a comment - Warning (or unstyled info) would be fine, but it needs to be more specific than "name already taken". "Please specify a different name than the current one" or similar perhaps.

          Oleg Nenashev added a comment -

          The patch has been integrated towards 2.111

          Oleg Nenashev added a comment - The patch has been integrated towards 2.111

          Daniel Beck added a comment -

          This UI is not in 2.107.x.

          Daniel Beck added a comment - This UI is not in 2.107.x.

            dnusbaum Devin Nusbaum
            danielbeck Daniel Beck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: