mibexsoftware / bamboo-plan-dsl-plugin

Configuration as code with a Groovy-based DSL or YAML for Atlassian Bamboo.
https://marketplace.atlassian.com/plugins/ch.mibex.bamboo.plandsl/
Other
40 stars 16 forks source link

Branch plan notifications not getting set correctly #78

Closed sohrab- closed 6 years ago

sohrab- commented 6 years ago

I have the following in the main plan:

notifications.custom(event: NotificationEvent.FAILED_BUILDS_AND_FIRST_SUCCESSFUL,
         pluginKey: Config.Notifications.Slack.PLUGIN_KEY) {
      configure(webhookUrl: "...")
   }
}

Which works fine on the main plan. I then set the following in my branch plans:

branches {
   notifications(Branch.NotifyOnNewBranchesType.USE_PLANS_NOTIFICATION_SETTINGS)
   ...
}

However once the seed task runs, the branch plan's notification is not configured correctly:

image

I also see no logs pretaining to branch notifications in the logs: plan.log

mrueegg commented 6 years ago

Hi,

Thank you for bringing this up to us.

I was able to reproduce this. Setting the notification type on individual branches works, but on the "branches" level doesn't. In your example, you actually don't set the notifications parameter on the individual branch parameter (as expected in the screen shot), so this action only affects the "branches" level.

Here's an example to reproduce the problem:

project(key: 'DEV', name: 'DEVOPS') {
    plan(key: 'SIMPLEPLAN', name: 'my simple plan') {
        scm {
            bitbucketCloud(name: "myBitbucketGitRepo") {
                repoSlug "project_1/java-simple"
                branch "master"
            }
        }
        branches {
            notifications(NotifyOnNewBranchesType.USE_PLANS_NOTIFICATION_SETTINGS) // DOESN'T WORK
            branch(name: 'feature_ui_improvements') {
                vcsBranchName 'feature/ui_improvements'
                notifications(NotifyOnNewBranchesType.USE_PLANS_NOTIFICATION_SETTINGS) // WORKS
            }

        }
    }
}

I'll try to fix this problem next and keep you up-to-date.

Best regards, Michael

sohrab- commented 6 years ago

Thanks for providing the work-around.

mrueegg commented 6 years ago

Hi,

We've just released a new version including a bug fix for this. Please update your plug-in installation.

Thanks again for reporting it!

Best regards, Michael