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

Consistent notification usage between stage-level and top level

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We currently have postBuild and notifications sections at the top level of pipeline. It is possible to send notifications in either of them. Notifications in postBuild are sent from a node while notifications within notifications are sent outside of a node. Some plugins like 'email-ext' must be within a node to work and will not work in the notifications section.

      Within a stage we have only a post section but no notifications section. All notifications within a stage must be done in the post block.

      This inconsistency between stage-level settings and top-level settings and support for different plugins creates unneeded complexity in trying to document best practices for usage.

      We should either create a notifications section at the stage level or document how to do notifications with post and postBuild only.

      cc: Michael Neale James Dumay

        Attachments

          Issue Links

            Activity

            Hide
            jamesdumay James Dumay added a comment -

            Some plugins like 'email-ext' must be within a node to work and will not work in the notifications section

            Why is that? How fixable is it?

            Show
            jamesdumay James Dumay added a comment - Some plugins like 'email-ext' must be within a node to work and will not work in the notifications section Why is that? How fixable is it?
            Hide
            hrmpw Patrick Wolf added a comment -

            Even if we fix all the plugins like email-ext then we still have inconsistent usage between stage-level and top-level. Email-ext's reliance on a node only compounds this inconsistency.

            Show
            hrmpw Patrick Wolf added a comment - Even if we fix all the plugins like email-ext then we still have inconsistent usage between stage-level and top-level. Email-ext's reliance on a node only compounds this inconsistency.
            Hide
            michaelneale Michael Neale added a comment -

            email-ext is not "broken" in this sense, it lets you attach files from the workspace to an email, which is a useful thing. There is no way to fix that as it needs access to a workspace (if files were archived, it could pick it form there but that seems to be making busy-work).

            I would be happy if notifications were an alias to postBuild. Its just documenting the pipeline, not behavior. If we have to explain subtle differences then we have already lost.

            Show
            michaelneale Michael Neale added a comment - email-ext is not "broken" in this sense, it lets you attach files from the workspace to an email, which is a useful thing. There is no way to fix that as it needs access to a workspace (if files were archived, it could pick it form there but that seems to be making busy-work). I would be happy if notifications were an alias to postBuild. Its just documenting the pipeline, not behavior. If we have to explain subtle differences then we have already lost.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTBuildConditionsContainer.java
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTNotifications.java
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPipelineDef.java
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidator.java
            pipeline-model-api/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorTest.java
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/AbstractBuildConditionResponder.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Notifications.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Root.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/JSONParser.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy
            pipeline-model-definition/src/main/resources/ast-schema.json
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BasicModelDefTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BuildConditionResponderTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/JobPropertiesTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ParametersTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/PostStageTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/TriggersTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/WrappersTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ExecuteConvertedTest.java
            pipeline-model-definition/src/test/resources/abortedNotification.groovy
            pipeline-model-definition/src/test/resources/buildConditionOrdering.groovy
            pipeline-model-definition/src/test/resources/errors/duplicateNotificationConditions.groovy
            pipeline-model-definition/src/test/resources/errors/emptyNotifications.groovy
            pipeline-model-definition/src/test/resources/errors/invalidBuildCondition.groovy
            pipeline-model-definition/src/test/resources/errors/notificationsSectionRemoved.groovy
            pipeline-model-definition/src/test/resources/errors/rejectParallelInNotifications.groovy
            pipeline-model-definition/src/test/resources/failingNotifications.groovy
            pipeline-model-definition/src/test/resources/failingPipeline.groovy
            pipeline-model-definition/src/test/resources/failingPostBuild.groovy
            pipeline-model-definition/src/test/resources/json/errors/emptyNotifications.json
            pipeline-model-definition/src/test/resources/json/errors/invalidBuildCondition.json
            pipeline-model-definition/src/test/resources/json/errors/notificationsSectionRemoved.json
            pipeline-model-definition/src/test/resources/json/postBuildAndNotifications.json
            pipeline-model-definition/src/test/resources/json/simpleNotification.json
            pipeline-model-definition/src/test/resources/notificationOnChangeChanged.groovy
            pipeline-model-definition/src/test/resources/notificationOnChangeFailed.groovy
            pipeline-model-definition/src/test/resources/postBuildAndNotifications.groovy
            pipeline-model-definition/src/test/resources/postOnChangeChanged.groovy
            pipeline-model-definition/src/test/resources/postOnChangeFailed.groovy
            pipeline-model-definition/src/test/resources/postStage/failingNotifications.groovy
            pipeline-model-definition/src/test/resources/postStage/globalAndLocalAlways.groovy
            pipeline-model-definition/src/test/resources/postStage/localAll.groovy
            pipeline-model-definition/src/test/resources/shInNotification.groovy
            pipeline-model-definition/src/test/resources/simpleNotification.groovy
            pipeline-model-definition/src/test/resources/unstableNotification.groovy
            pipeline-model-definition/src/test/resources/unstablePost.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/d95465079b2f354cfba69cfdbaad533de2f18044
            Log:
            JENKINS-39394 Removed notifications section.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTBuildConditionsContainer.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTNotifications.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPipelineDef.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidator.java pipeline-model-api/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorTest.java pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/AbstractBuildConditionResponder.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Notifications.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Root.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/JSONParser.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy pipeline-model-definition/src/main/resources/ast-schema.json pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BasicModelDefTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BuildConditionResponderTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/JobPropertiesTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ParametersTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/PostStageTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/TriggersTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/WrappersTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ExecuteConvertedTest.java pipeline-model-definition/src/test/resources/abortedNotification.groovy pipeline-model-definition/src/test/resources/buildConditionOrdering.groovy pipeline-model-definition/src/test/resources/errors/duplicateNotificationConditions.groovy pipeline-model-definition/src/test/resources/errors/emptyNotifications.groovy pipeline-model-definition/src/test/resources/errors/invalidBuildCondition.groovy pipeline-model-definition/src/test/resources/errors/notificationsSectionRemoved.groovy pipeline-model-definition/src/test/resources/errors/rejectParallelInNotifications.groovy pipeline-model-definition/src/test/resources/failingNotifications.groovy pipeline-model-definition/src/test/resources/failingPipeline.groovy pipeline-model-definition/src/test/resources/failingPostBuild.groovy pipeline-model-definition/src/test/resources/json/errors/emptyNotifications.json pipeline-model-definition/src/test/resources/json/errors/invalidBuildCondition.json pipeline-model-definition/src/test/resources/json/errors/notificationsSectionRemoved.json pipeline-model-definition/src/test/resources/json/postBuildAndNotifications.json pipeline-model-definition/src/test/resources/json/simpleNotification.json pipeline-model-definition/src/test/resources/notificationOnChangeChanged.groovy pipeline-model-definition/src/test/resources/notificationOnChangeFailed.groovy pipeline-model-definition/src/test/resources/postBuildAndNotifications.groovy pipeline-model-definition/src/test/resources/postOnChangeChanged.groovy pipeline-model-definition/src/test/resources/postOnChangeFailed.groovy pipeline-model-definition/src/test/resources/postStage/failingNotifications.groovy pipeline-model-definition/src/test/resources/postStage/globalAndLocalAlways.groovy pipeline-model-definition/src/test/resources/postStage/localAll.groovy pipeline-model-definition/src/test/resources/shInNotification.groovy pipeline-model-definition/src/test/resources/simpleNotification.groovy pipeline-model-definition/src/test/resources/unstableNotification.groovy pipeline-model-definition/src/test/resources/unstablePost.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/d95465079b2f354cfba69cfdbaad533de2f18044 Log: JENKINS-39394 Removed notifications section.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-api/pom.xml
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ASTSchema.java
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPipelineDef.java
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPostBuild.java
            pipeline-model-api/src/main/resources/ast-schema.json
            pipeline-model-api/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ASTSchemaTest.java
            pipeline-model-definition/pom.xml
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Root.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/Converter.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/JSONParser.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy
            pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/endpoints/ModelConverterAction.java
            pipeline-model-definition/src/main/resources/ast-schema.json
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/endpoints/ModelConverterActionTest.java
            pipeline-model-definition/src/test/resources/buildConditionOrdering.groovy
            pipeline-model-definition/src/test/resources/buildPluginParentPOM.groovy
            pipeline-model-definition/src/test/resources/errors/duplicatePostBuildConditions.groovy
            pipeline-model-definition/src/test/resources/errors/emptyPostBuild.groovy
            pipeline-model-definition/src/test/resources/errors/invalidBuildCondition.groovy
            pipeline-model-definition/src/test/resources/failingPipeline.groovy
            pipeline-model-definition/src/test/resources/failingPostBuild.groovy
            pipeline-model-definition/src/test/resources/json/errors/emptyPostBuild.json
            pipeline-model-definition/src/test/resources/json/errors/invalidBuildCondition.json
            pipeline-model-definition/src/test/resources/json/simplePostBuild.json
            pipeline-model-definition/src/test/resources/postOnChangeChanged.groovy
            pipeline-model-definition/src/test/resources/postOnChangeFailed.groovy
            pipeline-model-definition/src/test/resources/postStage/globalAndLocalAlways.groovy
            pipeline-model-definition/src/test/resources/postStage/localAll.groovy
            pipeline-model-definition/src/test/resources/simplePostBuild.groovy
            pipeline-model-definition/src/test/resources/unstablePost.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/567066b49c0b7cf582377696317f08960bcd7407
            Log:
            [FIXED JENKINS-39394] Renamed "postBuild" to "post".

            Also moved ast-schema.json to pipeline-model-api, where it should be.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-api/pom.xml pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ASTSchema.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPipelineDef.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPostBuild.java pipeline-model-api/src/main/resources/ast-schema.json pipeline-model-api/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ASTSchemaTest.java pipeline-model-definition/pom.xml pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Root.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/Converter.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/JSONParser.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/endpoints/ModelConverterAction.java pipeline-model-definition/src/main/resources/ast-schema.json pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/endpoints/ModelConverterActionTest.java pipeline-model-definition/src/test/resources/buildConditionOrdering.groovy pipeline-model-definition/src/test/resources/buildPluginParentPOM.groovy pipeline-model-definition/src/test/resources/errors/duplicatePostBuildConditions.groovy pipeline-model-definition/src/test/resources/errors/emptyPostBuild.groovy pipeline-model-definition/src/test/resources/errors/invalidBuildCondition.groovy pipeline-model-definition/src/test/resources/failingPipeline.groovy pipeline-model-definition/src/test/resources/failingPostBuild.groovy pipeline-model-definition/src/test/resources/json/errors/emptyPostBuild.json pipeline-model-definition/src/test/resources/json/errors/invalidBuildCondition.json pipeline-model-definition/src/test/resources/json/simplePostBuild.json pipeline-model-definition/src/test/resources/postOnChangeChanged.groovy pipeline-model-definition/src/test/resources/postOnChangeFailed.groovy pipeline-model-definition/src/test/resources/postStage/globalAndLocalAlways.groovy pipeline-model-definition/src/test/resources/postStage/localAll.groovy pipeline-model-definition/src/test/resources/simplePostBuild.groovy pipeline-model-definition/src/test/resources/unstablePost.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/567066b49c0b7cf582377696317f08960bcd7407 Log: [FIXED JENKINS-39394] Renamed "postBuild" to "post". Also moved ast-schema.json to pipeline-model-api, where it should be.

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                hrmpw Patrick Wolf
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: