Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: prioritysorter-plugin
    • Labels:
      None
    • Environment:
      CentOS6, Jenkins 2.32.2, PrioritySorter 3.5.0
    • Similar Issues:

      Description

      Priority sorter global configuration:

      • Strategy: Absolute
      • Number of priorities: 5
      • Default priority: 3

      Job priorities: A single job group:

      • Jobs to include: All
      • Priority: Default
      • Use additional rules when assigning a priority to a Job: checked
        • Job Triggered by a Upstream Build (" Use the same priority as assigned to the Upstream Build that caused this Jobs to start.")
        • Job Triggered by a User: Priority 1

      Jobs:

      • "A" (upstream), triggering "B" via Parameterized Trigger Plugin with "Block until the triggered projects finish their builds" checked
      • "B" (downstream)

      With this configuration, I'd expect that job "B" gets scheduled with priority 1, if "A" was started manually. Or am I wrong? However, it runs with the default priority according to the logs. The same happens if "B" gets started from "A" from a post-build step ("Build other projects").

      The plugin correctly recognizes that "B" was triggered by "A" ("Job Triggered by a Upstream Build"), but cannot determine the priority correctly.

        Attachments

          Activity

          Show
          rschuetz73 Ronny Schuetz added a comment - - edited WIP. Current state here: https://github.com/rschuetz/priority-sorter-plugin/tree/feature/JENKINS-42584-Upstream-job-priority-ignored
          Show
          rschuetz Ronny Schuetz added a comment - Pull request: https://github.com/jenkinsci/priority-sorter-plugin/pull/38
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ronny Schuetz
          Path:
          .gitignore
          src/main/java/jenkins/advancedqueue/priority/strategy/UpstreamCauseStrategy.java
          src/main/java/jenkins/advancedqueue/sorter/AdvancedQueueSorter.java
          src/main/java/jenkins/advancedqueue/sorter/StartedJobItemCache.java
          http://jenkins-ci.org/commit/priority-sorter-plugin/685c572109995a83df57350ed147a453ed470fef
          Log:
          JENKINS-42584 Fix upstream job priority retrieval

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ronny Schuetz Path: .gitignore src/main/java/jenkins/advancedqueue/priority/strategy/UpstreamCauseStrategy.java src/main/java/jenkins/advancedqueue/sorter/AdvancedQueueSorter.java src/main/java/jenkins/advancedqueue/sorter/StartedJobItemCache.java http://jenkins-ci.org/commit/priority-sorter-plugin/685c572109995a83df57350ed147a453ed470fef Log: JENKINS-42584 Fix upstream job priority retrieval
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ronny Schuetz
          Path:
          src/main/java/jenkins/advancedqueue/sorter/StartedJobItemCache.java
          http://jenkins-ci.org/commit/priority-sorter-plugin/dc1278989d1a513255b821dbc9dbeb0d8024aa26
          Log:
          JENKINS-42584 Fix upstream job priority retrieval

          • ClassCast fix
          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ronny Schuetz Path: src/main/java/jenkins/advancedqueue/sorter/StartedJobItemCache.java http://jenkins-ci.org/commit/priority-sorter-plugin/dc1278989d1a513255b821dbc9dbeb0d8024aa26 Log: JENKINS-42584 Fix upstream job priority retrieval ClassCast fix
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ronny Schuetz
          Path:
          src/main/java/jenkins/advancedqueue/PriorityConfigurationPlaceholderTaskHelper.java
          http://jenkins-ci.org/commit/priority-sorter-plugin/be0592c259ab6f217c2fd0061cbea217949953b7
          Log:
          JENKINS-42584 Fix upstream job priority retrieval

          • NPE fix
          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ronny Schuetz Path: src/main/java/jenkins/advancedqueue/PriorityConfigurationPlaceholderTaskHelper.java http://jenkins-ci.org/commit/priority-sorter-plugin/be0592c259ab6f217c2fd0061cbea217949953b7 Log: JENKINS-42584 Fix upstream job priority retrieval NPE fix
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ronny Schuetz
          Path:
          src/main/java/jenkins/advancedqueue/sorter/StartedJobItemCache.java
          src/test/java/jenkins/advancedqueue/test/UpstreamTest.java
          src/test/java/jenkins/advancedqueue/testutil/JobHelper.java
          src/test/resources/jenkins/advancedqueue/test/UpstreamTest/config.xml
          src/test/resources/jenkins/advancedqueue/test/UpstreamTest/jenkins.advancedqueue.PriorityConfiguration.xml
          src/test/resources/jenkins/advancedqueue/test/UpstreamTest/jenkins.advancedqueue.PrioritySorterConfiguration.xml
          http://jenkins-ci.org/commit/priority-sorter-plugin/df09df3dc0f0d2b4c3130c8dced22f45d46f99cc
          Log:
          JENKINS-42584 Fix upstream job priority retrieval

          • Tests added
          • incorporated PR change requests
          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ronny Schuetz Path: src/main/java/jenkins/advancedqueue/sorter/StartedJobItemCache.java src/test/java/jenkins/advancedqueue/test/UpstreamTest.java src/test/java/jenkins/advancedqueue/testutil/JobHelper.java src/test/resources/jenkins/advancedqueue/test/UpstreamTest/config.xml src/test/resources/jenkins/advancedqueue/test/UpstreamTest/jenkins.advancedqueue.PriorityConfiguration.xml src/test/resources/jenkins/advancedqueue/test/UpstreamTest/jenkins.advancedqueue.PrioritySorterConfiguration.xml http://jenkins-ci.org/commit/priority-sorter-plugin/df09df3dc0f0d2b4c3130c8dced22f45d46f99cc Log: JENKINS-42584 Fix upstream job priority retrieval Tests added incorporated PR change requests
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          .gitignore
          src/main/java/jenkins/advancedqueue/PriorityConfigurationPlaceholderTaskHelper.java
          src/main/java/jenkins/advancedqueue/priority/strategy/UpstreamCauseStrategy.java
          src/main/java/jenkins/advancedqueue/sorter/AdvancedQueueSorter.java
          src/main/java/jenkins/advancedqueue/sorter/StartedJobItemCache.java
          src/test/java/jenkins/advancedqueue/test/UpstreamTest.java
          src/test/java/jenkins/advancedqueue/testutil/JobHelper.java
          src/test/resources/jenkins/advancedqueue/test/UpstreamTest/config.xml
          src/test/resources/jenkins/advancedqueue/test/UpstreamTest/jenkins.advancedqueue.PriorityConfiguration.xml
          src/test/resources/jenkins/advancedqueue/test/UpstreamTest/jenkins.advancedqueue.PrioritySorterConfiguration.xml
          http://jenkins-ci.org/commit/priority-sorter-plugin/ca2ba818d4c9b17533d9b550883a1064354f6f1b
          Log:
          Merge pull request #38 from rschuetz/feature/JENKINS-42584-Upstream-job-priority-ignored

          JENKINS-42584 upstream job priority ignored

          Compare: https://github.com/jenkinsci/priority-sorter-plugin/compare/20af6e44ef0a...ca2ba818d4c9

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: .gitignore src/main/java/jenkins/advancedqueue/PriorityConfigurationPlaceholderTaskHelper.java src/main/java/jenkins/advancedqueue/priority/strategy/UpstreamCauseStrategy.java src/main/java/jenkins/advancedqueue/sorter/AdvancedQueueSorter.java src/main/java/jenkins/advancedqueue/sorter/StartedJobItemCache.java src/test/java/jenkins/advancedqueue/test/UpstreamTest.java src/test/java/jenkins/advancedqueue/testutil/JobHelper.java src/test/resources/jenkins/advancedqueue/test/UpstreamTest/config.xml src/test/resources/jenkins/advancedqueue/test/UpstreamTest/jenkins.advancedqueue.PriorityConfiguration.xml src/test/resources/jenkins/advancedqueue/test/UpstreamTest/jenkins.advancedqueue.PrioritySorterConfiguration.xml http://jenkins-ci.org/commit/priority-sorter-plugin/ca2ba818d4c9b17533d9b550883a1064354f6f1b Log: Merge pull request #38 from rschuetz/feature/ JENKINS-42584 -Upstream-job-priority-ignored JENKINS-42584 upstream job priority ignored Compare: https://github.com/jenkinsci/priority-sorter-plugin/compare/20af6e44ef0a...ca2ba818d4c9
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          The fix has been released in 3.5.1

          Show
          oleg_nenashev Oleg Nenashev added a comment - The fix has been released in 3.5.1

            People

            • Assignee:
              rschuetz73 Ronny Schuetz
              Reporter:
              rschuetz Ronny Schuetz
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: