I use recordIssues in a step following steps with dotnet build, dotnet test, dotnet publish.

      It identifies 3 issues, 3 times, and correctly identifies them as duplicates that it collapses.

      enabledForFailure is set, and the quality gate is configured as

      qualityGates: [[threshold: 1, type: 'NEW', unstable: false]]
      

      However, it consistently uses the last successful build as a reference build.

      I used reset on the quality gate, expecting it to update the new state as the baseline.

      The log shows that the reset is recognized and used, but it then uses the reference build anyway and fails the build.

      [MSBuild] Repository miner is not configured, skipping repository mining
      [MSBuild] Reference build recorder is not configured
      [MSBuild] Obtaining reference build from same job (main)
      [MSBuild] Resetting reference build, ignoring quality gate result for one build
      [MSBuild] Using reference build '[redacted]/main #10' to compute new, fixed, and outstanding issues
      [MSBuild] Issues delta (vs. reference build): outstanding: 0, new: 3, fixed: 0
      [MSBuild] Evaluating quality gates
      [MSBuild] -> FAILED - New (any severity): 3 - Quality Gate: 1
      
      [MSBuild] -> Some quality gates have been missed: overall result is FAILED
      [MSBuild] Health report is disabled - skipping
      [MSBuild] Created analysis result for 3 issues (found 3 new issues, fixed 0 issues)
      [MSBuild] Attaching ResultAction with ID 'msbuild' to build '[redacted]/main #20'.
      
                  stage('MSBuild Gate') {
                    steps {
                      recordIssues(
                        sourceCodeEncoding: 'UTF-8',
                        enabledForFailure: true,
                        tools: [
                          msBuild(),
                        ],
                        qualityGates: [[threshold: 1, type: 'NEW', unstable: false]]
                      )
                    }
                  }
      

      In the past I’ve used reset quality gate in another job a while ago just fine.

          [JENKINS-68832] Reset quality gate does not work

          Jan Klass added a comment - - edited

          Using unstable: true instead and enabledForFailure: true,, resetting the quality gate works fine.

          Jan Klass added a comment - - edited Using unstable: true instead and enabledForFailure: true,, resetting the quality gate works fine.

          Ulli Hafner added a comment -

          And using `unstable: false` and `enabledForFailure: true`? I think the algorithm currently does not work if the builds are failing.

          Ulli Hafner added a comment - And using `unstable: false` and `enabledForFailure: true`? I think the algorithm currently does not work if the builds are failing.

          Jan Klass added a comment -

          I don’t remember which of the two I flipped and tested before it was both.

          I don’t have the failure state to test with anymore now.

          Jan Klass added a comment - I don’t remember which of the two I flipped and tested before it was both. I don’t have the failure state to test with anymore now.

          Jan Klass added a comment - - edited

          I think the algorithm currently does not work if the builds are failing.

          Do you mean the reset, unstable or enabledForFailure?

          Jan Klass added a comment - - edited I think the algorithm currently does not work if the builds are failing. Do you mean the reset, unstable or enabledForFailure?

          Ulli Hafner added a comment -

          The reset algorithm. It works already in your case, but after the selection of the previous build as reference it is overruled by the other algorithm that skips all builds that are failed.

          Ulli Hafner added a comment - The reset algorithm. It works already in your case, but after the selection of the previous build as reference it is overruled by the other algorithm that skips all builds that are failed.

            Unassigned Unassigned
            jk Jan Klass
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: