• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • ownership-plugin
    • None

      If VCS checkout/update fails, you can't send emails to job owners since the variables are not injected.

      Can I somehow set a default, e.g. an admin, and let every job override it? That would make for a nice workaround in case it's not possible to inject the variables at the start of a build (before code is checked out).

          [JENKINS-23926] Job Ownership not available if VCS fails

          Oleg Nenashev added a comment -

          Hello Hubert,

          As a workaround, you could use Token Macro in Mail-Ext plugin.
          See wiki for available macro descriptions.

          Macros correctly define owners on any build stage.

          Best regards,
          Oleg Nenashev

          Oleg Nenashev added a comment - Hello Hubert, As a workaround, you could use Token Macro in Mail-Ext plugin. See wiki for available macro descriptions. Macros correctly define owners on any build stage. Best regards, Oleg Nenashev

          I'll try that. thanks. Do you by chance know if one can set a default value nonetheless? If i set default recipients to job owners globally and a job doesn't define owners or doesn't inject them I'd like to forward the emails to an admin.

          Hubert Grzeskowiak added a comment - I'll try that. thanks. Do you by chance know if one can set a default value nonetheless? If i set default recipients to job owners globally and a job doesn't define owners or doesn't inject them I'd like to forward the emails to an admin.

          Oleg Nenashev added a comment -

          Currently, there's no such support in the plugin.
          BTW, there's nothing complex to do it. If you create a JIRA issue, I'll try to handle it on the next week (I'm on the business trip now).

          Oleg Nenashev added a comment - Currently, there's no such support in the plugin. BTW, there's nothing complex to do it. If you create a JIRA issue, I'll try to handle it on the next week (I'm on the business trip now).

          Thanks for the fast reply. I've created two new issues JENKINS-23947 and JENKINS-23948 because I'm not sure what's the best solution here - maybe a mix of both. Feel free to reject any of them.

          Hubert Grzeskowiak added a comment - Thanks for the fast reply. I've created two new issues JENKINS-23947 and JENKINS-23948 because I'm not sure what's the best solution here - maybe a mix of both. Feel free to reject any of them.

          Oleg Nenashev added a comment -

          Added links to issues

          Oleg Nenashev added a comment - Added links to issues

          Oleg Nenashev added a comment -

          I'll try that. thanks. Do you by chance know if one can set a default value nonetheless?

          I'll add the default value to token macros

          Oleg Nenashev added a comment - I'll try that. thanks. Do you by chance know if one can set a default value nonetheless? I'll add the default value to token macros

          Oleg Nenashev added a comment -

          Oleg Nenashev added a comment - I'm working on the issue. PR: https://github.com/jenkinsci/ownership-plugin/pull/30

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPlugin.java
          src/test/java/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapperTest.java
          http://jenkins-ci.org/commit/ownership-plugin/d7d2c1496aaec81daa0750fbeb5ce923f3763b4c
          Log:
          JENKINS-23926 - Direct unit test for the issue

          Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPlugin.java src/test/java/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapperTest.java http://jenkins-ci.org/commit/ownership-plugin/d7d2c1496aaec81daa0750fbeb5ce923f3763b4c Log: JENKINS-23926 - Direct unit test for the issue Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/JobOwnerHelper.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/OwnershipBuildListener.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapper.java
          http://jenkins-ci.org/commit/ownership-plugin/9871283990bd76c8f04bb61cfdeb4a1c30159a4c
          Log:
          [FIXED JENKINS-23926] - Use OwnershipBuildListener to inject environment variables even if the build fails before wrapper steps.

          Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          Conflicts:
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/JobOwnerHelper.java

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/JobOwnerHelper.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/OwnershipBuildListener.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapper.java http://jenkins-ci.org/commit/ownership-plugin/9871283990bd76c8f04bb61cfdeb4a1c30159a4c Log: [FIXED JENKINS-23926] - Use OwnershipBuildListener to inject environment variables even if the build fails before wrapper steps. Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com> Conflicts: src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/JobOwnerHelper.java

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/JobOwnerHelper.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/OwnershipBuildListener.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapper.java
          src/main/java/org/jenkinsci/plugins/ownership/model/runs/OwnershipRunListener.java
          src/main/java/org/jenkinsci/plugins/ownership/model/runs/RunOwnershipAction.java
          src/main/java/org/jenkinsci/plugins/ownership/model/runs/RunOwnershipListener.java
          http://jenkins-ci.org/commit/ownership-plugin/c62137339f8c24caf4baf2db5724d10c18bcf2c5
          Log:
          JENKINS-23926 - Gracefully integrate changes with #29

          Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/JobOwnerHelper.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/OwnershipBuildListener.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapper.java src/main/java/org/jenkinsci/plugins/ownership/model/runs/OwnershipRunListener.java src/main/java/org/jenkinsci/plugins/ownership/model/runs/RunOwnershipAction.java src/main/java/org/jenkinsci/plugins/ownership/model/runs/RunOwnershipListener.java http://jenkins-ci.org/commit/ownership-plugin/c62137339f8c24caf4baf2db5724d10c18bcf2c5 Log: JENKINS-23926 - Gracefully integrate changes with #29 Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPlugin.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPluginConfiguration.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/JobOwnerHelper.java
          src/main/java/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapper.java
          src/main/java/org/jenkinsci/plugins/ownership/model/runs/OwnershipRunListener.java
          src/main/java/org/jenkinsci/plugins/ownership/model/runs/RunOwnershipAction.java
          src/main/java/org/jenkinsci/plugins/ownership/model/runs/RunOwnershipHelper.java
          src/main/java/org/jenkinsci/plugins/ownership/model/runs/RunOwnershipListener.java
          src/main/java/org/jenkinsci/plugins/ownership/util/environment/EnvSetupOptions.java
          src/main/resources/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPluginConfiguration/config.jelly
          src/main/resources/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPluginConfiguration/config.properties
          src/main/resources/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPluginConfiguration/help-globalEnvSetupOptions.html
          src/main/resources/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapper/config.jelly
          src/main/resources/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapper/help-injectJobOwnership.html
          src/main/resources/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapper/help-injectNodeOwnership.html
          src/main/resources/org/jenkinsci/plugins/ownership/util/environment/EnvSetupOptions/config.jelly
          src/main/resources/org/jenkinsci/plugins/ownership/util/environment/EnvSetupOptions/help-injectJobOwnership.html
          src/main/resources/org/jenkinsci/plugins/ownership/util/environment/EnvSetupOptions/help-injectNodeOwnership.html
          src/test/java/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapperTest.java
          http://jenkins-ci.org/commit/ownership-plugin/6112cfac239903f8d012e8db967b986d29a5f6cf
          Log:
          Merge pull request #30 from oleg-nenashev/JENKINS-23926

          JENKINS-23926 - Inject ownership variables even if SCM fails

          Compare: https://github.com/jenkinsci/ownership-plugin/compare/514858631f11...6112cfac2399

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: src/main/java/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPlugin.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPluginConfiguration.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/jobs/JobOwnerHelper.java src/main/java/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapper.java src/main/java/org/jenkinsci/plugins/ownership/model/runs/OwnershipRunListener.java src/main/java/org/jenkinsci/plugins/ownership/model/runs/RunOwnershipAction.java src/main/java/org/jenkinsci/plugins/ownership/model/runs/RunOwnershipHelper.java src/main/java/org/jenkinsci/plugins/ownership/model/runs/RunOwnershipListener.java src/main/java/org/jenkinsci/plugins/ownership/util/environment/EnvSetupOptions.java src/main/resources/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPluginConfiguration/config.jelly src/main/resources/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPluginConfiguration/config.properties src/main/resources/com/synopsys/arc/jenkins/plugins/ownership/OwnershipPluginConfiguration/help-globalEnvSetupOptions.html src/main/resources/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapper/config.jelly src/main/resources/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapper/help-injectJobOwnership.html src/main/resources/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapper/help-injectNodeOwnership.html src/main/resources/org/jenkinsci/plugins/ownership/util/environment/EnvSetupOptions/config.jelly src/main/resources/org/jenkinsci/plugins/ownership/util/environment/EnvSetupOptions/help-injectJobOwnership.html src/main/resources/org/jenkinsci/plugins/ownership/util/environment/EnvSetupOptions/help-injectNodeOwnership.html src/test/java/com/synopsys/arc/jenkins/plugins/ownership/wrappers/OwnershipBuildWrapperTest.java http://jenkins-ci.org/commit/ownership-plugin/6112cfac239903f8d012e8db967b986d29a5f6cf Log: Merge pull request #30 from oleg-nenashev/ JENKINS-23926 JENKINS-23926 - Inject ownership variables even if SCM fails Compare: https://github.com/jenkinsci/ownership-plugin/compare/514858631f11...6112cfac2399

          Big thanks for this, Oleg. I'll try to test this next week.

          Hubert Grzeskowiak added a comment - Big thanks for this, Oleg. I'll try to test this next week.

          Tested for two months - working perfectly. This helped us a lot at debugging SVN errors in Jenkins.

          Hubert Grzeskowiak added a comment - Tested for two months - working perfectly. This helped us a lot at debugging SVN errors in Jenkins.

          Oleg Nenashev added a comment -

          Thanks for the response. It works well on our installations too.
          I'm closing the issue.

          Oleg Nenashev added a comment - Thanks for the response. It works well on our installations too. I'm closing the issue.

            oleg_nenashev Oleg Nenashev
            huuugo Hubert Grzeskowiak
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: