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

Builds get double promotions after promotion has been renamed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: promoted-builds-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.421
      Jenkins Promoted Builds Plugin 2.2
    • Similar Issues:

      Description

      When a promotion is renamed, all subsequent promotions of the new name will also promote it with the old name.

      To reproduce, I did the following:

      1. Create a job test-downstream, leave all settings as-is.
      2. Create a job test-upstream, and set the following:
        • Promote builds when ...
          • Name: First promotion
          • When the following downstream projects build successfully: test-downstream
        • Post-build actions, build other projects: test-downstream
      3. Save settings, and then click Configure again.
      4. Change the name of the promotion from First promotion to Second promotion.
      5. Save.
      6. Run the build of test-upstream, wait for the build of test-upstream and test-downstream to complete (about 10s with quiet periods etc).

      Now you'll observe that the new build has two gold stars: First promotion and Second promotion. Going to /job/test-upstream/1/promotion/ will show First promotion as "Pending promotion" for some reason. It shouldn't be there at all!

        Attachments

          Issue Links

            Activity

            Hide
            stephenconnolly Stephen Connolly added a comment -

            @Jørgen

            It depends on why the promotion process was renamed.

            If the promotion process is renamed, you may want to retain the old promotions with the old name, or you may want to rename all the old promotions too. In reality JENKINS-8783 should be fixed by adding a three button confirm rather than [Yes]/[No] it should be [Rename process and all previous promotions of this process]/[Rename process leaving all previous promotions with the old name]/[No]

            That would make it clear why/how you can have disabled processes left lying around after a rename IMHO

            Show
            stephenconnolly Stephen Connolly added a comment - @Jørgen It depends on why the promotion process was renamed. If the promotion process is renamed, you may want to retain the old promotions with the old name, or you may want to rename all the old promotions too. In reality JENKINS-8783 should be fixed by adding a three button confirm rather than [Yes] / [No] it should be [Rename process and all previous promotions of this process] / [Rename process leaving all previous promotions with the old name] / [No] That would make it clear why/how you can have disabled processes left lying around after a rename IMHO
            Hide
            jorgenpt Jørgen Tjernø added a comment -

            Oh, thanks Stephen, now it makes much more sense to me. I didn't realize that it leaves the old promotions with the old name when you rename. Thanks for the fix!

            Show
            jorgenpt Jørgen Tjernø added a comment - Oh, thanks Stephen, now it makes much more sense to me. I didn't realize that it leaves the old promotions with the old name when you rename. Thanks for the fix!
            Hide
            mpeters Michael Peters added a comment -

            I'm seeing this happen again on v2.22 of this plugin.

            We renamed a promotion process and it resulted in double stars. We changed the name back and added a 2nd identical promotion process with the new name and deleted the old one. Still results in double stars. This is happening with a job that is inside one of the new folders. I don't know if that makes a difference or not.

            Show
            mpeters Michael Peters added a comment - I'm seeing this happen again on v2.22 of this plugin. We renamed a promotion process and it resulted in double stars. We changed the name back and added a 2nd identical promotion process with the new name and deleted the old one. Still results in double stars. This is happening with a job that is inside one of the new folders. I don't know if that makes a difference or not.
            Hide
            gradalajage Kyle Estes added a comment - - edited

            I saw this in v2.19. I thought updating to latest might fix it, but it continues to happen in v2.23.1. Like Michael Peters this is happening for a job in a folder.

            Show
            gradalajage Kyle Estes added a comment - - edited I saw this in v2.19. I thought updating to latest might fix it, but it continues to happen in v2.23.1. Like Michael Peters this is happening for a job in a folder.
            Hide
            aheritier Arnaud Héritier added a comment -

            This is not related to the usage of folders (the same problem exists without it).

            Workaround:

            • Open you job configuration
            • Add new promotion with the previous name before the renaming. They can be empty. Myself I just checked "Promote immediately once the build is complete"
            • Save your configuration
            • Open you job configuration a second time
            • Remove the promotion with the old name
            • Save your configuration

            Your job should now work correctly without breaking old promotions and the object model.

            The issue will be fixed by JENKINS-27716 in promotion plugin > 2.23.1 if you are running on Jenkins >= 1.585

            Show
            aheritier Arnaud Héritier added a comment - This is not related to the usage of folders (the same problem exists without it). Workaround: Open you job configuration Add new promotion with the previous name before the renaming. They can be empty. Myself I just checked "Promote immediately once the build is complete" Save your configuration Open you job configuration a second time Remove the promotion with the old name Save your configuration Your job should now work correctly without breaking old promotions and the object model. The issue will be fixed by JENKINS-27716 in promotion plugin > 2.23.1 if you are running on Jenkins >= 1.585

              People

              • Assignee:
                Unassigned
                Reporter:
                jorgenpt Jørgen Tjernø
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: