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

Views with ViewJobFilters should not automatically add newly created jobs

      Hello !

      We use a fancy "All Failing Jobs" view on our installation , using Job Status filter : Failed & Unstable

      To be sure we don't miss those I make that view the default one on the system, similar to : http://ci.jenkins-ci.org/

      We do see the failed and unstable jobs but after addition of a new job it ends up on the view as well. On the configure page the faulty appears being checked, although nobody did such thing manually... It will start gray (never run) but even after success it will be displayed on the All failing jobs view.

      Only work around is :

      Job Statuses: Failed & Unstable
      Include Matched - Add jobs that match this filter

      plus

      Job Statuses: Failed & Unstable
      Exclude Unmatched - Filter out jobs that don't match this filter

      but I don't think it should be necessary. I really think something fishy happens when a new job is created.

      Let me know if you need more information in order to reproduce and thanks for this awesome plugin.

      Jenkins - 1.458
      View Job Filters - 1.22

          [JENKINS-14799] Views with ViewJobFilters should not automatically add newly created jobs

          You are right that there is "something fishy". The default behavior of Jenkins when you create a job is to automatically under the covers add that job to the view you were in when you clicked the "create new job" link. This is unfortunate, but I don't know the likelihood that this is something that's going to change. I've added the "core" component to this ticket and renamed the ticket to highlight that this would require a change to the core. However for now, the "best practice" that I follow is to add a filter as the first filter that removes all jobs, and then add all your "real" filters after that one. This way, no one in the future can mess up your filter by adding new jobs.

          Jacob Robertson added a comment - You are right that there is "something fishy". The default behavior of Jenkins when you create a job is to automatically under the covers add that job to the view you were in when you clicked the "create new job" link. This is unfortunate, but I don't know the likelihood that this is something that's going to change. I've added the "core" component to this ticket and renamed the ticket to highlight that this would require a change to the core. However for now, the "best practice" that I follow is to add a filter as the first filter that removes all jobs, and then add all your "real" filters after that one. This way, no one in the future can mess up your filter by adding new jobs.

          Daniel Beck added a comment -

          This duplicates JENKINS-19142 (or rather the other way around, but the other issue has more watchers).

          Daniel Beck added a comment - This duplicates JENKINS-19142 (or rather the other way around, but the other issue has more watchers).

            jacob_robertson Jacob Robertson
            jnrg Julien R.
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: