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

ItemListener event not fired when user changes the project label

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • core
    • jenkins LTS ver 1.565.3
      Ubuntu precise

      The jenkins ItemListener does not fire events when user updates project labels. I would expect the onUpdated event to fire.

      Steps to repro:
      1. create a new project
      2. select 'Restrict where this project can be run' box and add a label that matches a slave the save the project.
      3. now configure the same project and change the label to match a different slave then save the project.

      Note1 - No events are fired.
      Note2 - If on step #3, you un-select the option 'Restrict where this project can be run' (thereby removing the label) then save an event does get called.

          [JENKINS-25162] ItemListener event not fired when user changes the project label

          Daniel Beck added a comment -

          Daniel Beck added a comment - It really doesn't look like this should be possible without exceptions being thrown: https://github.com/jenkinsci/jenkins/blob/jenkins-1.565.3/core/src/main/java/hudson/model/Job.java#L1157 https://github.com/jenkinsci/jenkins/blob/jenkins-1.565.3/core/src/main/java/hudson/model/AbstractProject.java#L1820 Could you debug into the code to see what's going on?

          Daniel Beck added a comment -

          ItemListener.fireOnUpdated() definitely gets called when saving a project after only modifying the label. It only seems possible to happen with exceptions involved, and those would get logged.

          Please investigate further what's going on in your instance.

          Daniel Beck added a comment - ItemListener.fireOnUpdated() definitely gets called when saving a project after only modifying the label. It only seems possible to happen with exceptions involved, and those would get logged. Please investigate further what's going on in your instance.

          Khai Do added a comment -

          Sorry about that, i have double checked. This bug only occurs when updating project configurations using the REST API. Instead of updating this bug I've created a new bug so it won't be confusing. new bug is JENKINS-25175

          Khai Do added a comment - Sorry about that, i have double checked. This bug only occurs when updating project configurations using the REST API. Instead of updating this bug I've created a new bug so it won't be confusing. new bug is JENKINS-25175

            Unassigned Unassigned
            zaro Khai Do
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: