Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-17349

When editing plan notifications changes do not take effect

    XMLWordPrintable

Details

    Description

      While working on a notification plugin for Bamboo 5.10.1 I noticed a odd behavior when add/editing notifications. Initially I though my implementation of AbstractNotificationRecipient might be wrong causing the edit not to be saved but I verified the same thing happens with other recipient types.

      After initially adding a new notification if you try and edit that same notification the changes do not appear to save until you try and delete the notification. Then the page will reload and your notification with the changes will appear.

      I ended up adding some debug statments to output the result of the populateContext() function and I see this:

      [INFO] [talledLocalContainer] 2016-03-14 20:12:02,946 INFO [http-nio-6990-exec-7] [AccessLogFilter] admin GET http://localhost:6990/bamboo/chain/admin/ajax/addNotification.action?saved=true&buildKey=TBP-BP&lastModified=0&returnUrl=%2Fchain%2Fadmin%2Fconfig%2FdefaultChain
      Notification.action%3FbuildKey%3DTBP-BP%26saved%3Dtrue&bamboo.successReturnMode=json&decorator=nothing&confirm=true&_=1458000720168 116169kb
      [INFO] [talledLocalContainer] 2016-03-14 20:12:02,997 WARN [http-nio-6990-exec-7] [TextProviderHelper] The first TextProvider in the ValueStack (com.atlassian.bamboo.ww2.actions.chains.admin.ConfigureChainNotification) could not locate the message resource with key 'hipc
      hat.api.token'
      [INFO] [talledLocalContainer] 2016-03-14 20:12:02,997 WARN [http-nio-6990-exec-7] [TextProviderHelper] The default value expression 'hipchat.api.token' was evaluated and did not match a property.  The literal value 'hipchat.api.token' will be used.
      [INFO] [talledLocalContainer] 2016-03-14 20:12:03,004 WARN [http-nio-6990-exec-7] [TextProviderHelper] The first TextProvider in the ValueStack (com.atlassian.bamboo.ww2.actions.chains.admin.ConfigureChainNotification) could not locate the message resource with key 'hipc
      hat.room'
      [INFO] [talledLocalContainer] 2016-03-14 20:12:03,004 WARN [http-nio-6990-exec-7] [TextProviderHelper] The default value expression 'hipchat.room' was evaluated and did not match a property.  The literal value 'hipchat.room' will be used.
      [INFO] [talledLocalContainer] 2016-03-14 20:12:03,011 WARN [http-nio-6990-exec-7] [TextProviderHelper] The first TextProvider in the ValueStack (com.atlassian.bamboo.ww2.actions.chains.admin.ConfigureChainNotification) could not locate the message resource with key 'hipc
      hat.notify'
      [INFO] [talledLocalContainer] 2016-03-14 20:12:03,011 WARN [http-nio-6990-exec-7] [TextProviderHelper] The default value expression 'hipchat.notify' was evaluated and did not match a property.  The literal value 'hipchat.notify' will be used.
      [INFO] [talledLocalContainer] populateContext = {}
      [INFO] [talledLocalContainer] 2016-03-14 20:12:15,325 INFO [http-nio-6990-exec-8] [AutoReloadFilter] No reload detected
      [INFO] [talledLocalContainer] 2016-03-14 20:12:15,326 INFO [http-nio-6990-exec-8] [AccessLogFilter] admin GET http://localhost:6990/bamboo/ajax/planStatusHistoryNeighbouringSummaries.action?planKey=TBP-BP&_=1458000720170 103150kb
      [INFO] [talledLocalContainer] 2016-03-14 20:12:21,725 INFO [http-nio-6990-exec-4] [AutoReloadFilter] No reload detected
      [INFO] [talledLocalContainer] 2016-03-14 20:12:21,726 INFO [http-nio-6990-exec-4] [AccessLogFilter] admin POST http://localhost:6990/bamboo/chain/admin/config/configureChainNotification.action 101301kb
      [INFO] [talledLocalContainer] next = selectFields
      [INFO] [talledLocalContainer] next = decorator
      [INFO] [talledLocalContainer] next = notificationEmailString
      [INFO] [talledLocalContainer] next = bamboo.successReturnMode
      [INFO] [talledLocalContainer] next = buildKey
      [INFO] [talledLocalContainer] next = numFailedTimes
      [INFO] [talledLocalContainer] next = checkBoxFields
      [INFO] [talledLocalContainer] next = room
      [INFO] [talledLocalContainer] next = confirm
      [INFO] [talledLocalContainer] next = notificationRecipientType
      [INFO] [talledLocalContainer] next = apiToken
      [INFO] [talledLocalContainer] next = conditionKey
      [INFO] [talledLocalContainer] next = notificationIMString
      [INFO] [talledLocalContainer] next = jobEquiv
      [INFO] [talledLocalContainer] next = atl_token
      [INFO] [talledLocalContainer] next = firstErrorOccuranceOnly
      [INFO] [talledLocalContainer] next = notificationGroupString
      [INFO] [talledLocalContainer] next = roompw
      [INFO] [talledLocalContainer] next = returnUrl
      [INFO] [talledLocalContainer] next = chainEquiv
      [INFO] [talledLocalContainer] next = notificationUserString
      [INFO] [talledLocalContainer] 2016-03-14 20:12:21,857 INFO [http-nio-6990-exec-5] [AutoReloadFilter] No reload detected
      [INFO] [talledLocalContainer] 2016-03-14 20:12:21,858 INFO [http-nio-6990-exec-5] [AccessLogFilter] admin GET http://localhost:6990/bamboo/chain/admin/config/defaultChainNotification.action?notificationRecipientType=com.ipsoft.plugins.bamboo.xmppmuc%3Arecipient.xmppmuc&c
      onditionKey=com.atlassian.bamboo.plugin.system.notifications%3AchainCompleted.allBuilds&saved=true&buildKey=TBP-BP&lastModified=4653058 133736kb
      [INFO] [talledLocalContainer] populateContext = {room=sometestroom@conferance.jabber.org}
      [INFO] [talledLocalContainer] populateContext = {room=sometestroom@conferance.jabber.org}
      [INFO] [talledLocalContainer] 2016-03-14 20:12:22,319 INFO [http-nio-6990-exec-6] [AccessLogFilter] admin GET http://localhost:6990/bamboo/rest/pref/latest/user/?expand=preferences.preference 81922kb
      [INFO] [talledLocalContainer] 2016-03-14 20:12:22,423 INFO [http-nio-6990-exec-3] [AutoReloadFilter] No reload detected
      [INFO] [talledLocalContainer] 2016-03-14 20:12:22,423 INFO [http-nio-6990-exec-3] [AccessLogFilter] admin GET http://localhost:6990/bamboo/plugins/servlet/dev-toolbar 81791kb
      

      Now if I go and edit the var this is what I see

      [INFO] [talledLocalContainer] 2016-03-14 20:13:11,127 INFO [http-nio-6990-exec-10] [AutoReloadFilter] No reload detected
      [INFO] [talledLocalContainer] 2016-03-14 20:13:11,128 INFO [http-nio-6990-exec-10] [AccessLogFilter] admin GET http://localhost:6990/bamboo/chain/admin/config/editChainNotification.action?buildKey=TBP-BP&notificationId=4653058&edit=true&bamboo.successReturnMode=json&deco
      rator=nothing&confirm=true&_=1458000742285 71102kb
      [INFO] [talledLocalContainer] 2016-03-14 20:13:11,141 WARN [http-nio-6990-exec-10] [ServletUrlRenderer] No configuration found for the specified action: '/chain/admin/config/updateChainNotification.action' in namespace: '/chain/admin/config'. Form action defaulting to 'a
      ction' attribute's literal value.
      [INFO] [talledLocalContainer] 2016-03-14 20:13:11,180 WARN [http-nio-6990-exec-10] [TextProviderHelper] The first TextProvider in the ValueStack (com.atlassian.bamboo.ww2.actions.chains.admin.ConfigureChainNotification) could not locate the message resource with key 'hip
      chat.api.token'
      [INFO] [talledLocalContainer] 2016-03-14 20:13:11,180 WARN [http-nio-6990-exec-10] [TextProviderHelper] The default value expression 'hipchat.api.token' was evaluated and did not match a property.  The literal value 'hipchat.api.token' will be used.
      [INFO] [talledLocalContainer] 2016-03-14 20:13:11,191 WARN [http-nio-6990-exec-10] [TextProviderHelper] The first TextProvider in the ValueStack (com.atlassian.bamboo.ww2.actions.chains.admin.ConfigureChainNotification) could not locate the message resource with key 'hip
      chat.room'
      [INFO] [talledLocalContainer] 2016-03-14 20:13:11,191 WARN [http-nio-6990-exec-10] [TextProviderHelper] The default value expression 'hipchat.room' was evaluated and did not match a property.  The literal value 'hipchat.room' will be used.
      [INFO] [talledLocalContainer] 2016-03-14 20:13:11,200 WARN [http-nio-6990-exec-10] [TextProviderHelper] The first TextProvider in the ValueStack (com.atlassian.bamboo.ww2.actions.chains.admin.ConfigureChainNotification) could not locate the message resource with key 'hip
      chat.notify'
      [INFO] [talledLocalContainer] 2016-03-14 20:13:11,200 WARN [http-nio-6990-exec-10] [TextProviderHelper] The default value expression 'hipchat.notify' was evaluated and did not match a property.  The literal value 'hipchat.notify' will be used.
      [INFO] [talledLocalContainer] populateContext = {room=sometestroom@conferance.jabber.org}
      [INFO] [talledLocalContainer] 2016-03-14 20:13:11,246 WARN [http-nio-6990-exec-10] [ServletUrlRenderer] No configuration found for the specified action: '/chain/admin/config/updateChainNotification.action' in namespace: '/chain/admin/config'. Form action defaulting to 'a
      ction' attribute's literal value.
      [INFO] [talledLocalContainer] 2016-03-14 20:13:16,543 INFO [http-nio-6990-exec-3] [AutoReloadFilter] No reload detected
      [INFO] [talledLocalContainer] 2016-03-14 20:13:16,543 INFO [http-nio-6990-exec-3] [AccessLogFilter] admin POST http://localhost:6990/bamboo/chain/admin/config/updateChainNotification.action?buildKey=TBP-BP 59036kb
      [INFO] [talledLocalContainer] next = selectFields
      [INFO] [talledLocalContainer] next = decorator
      [INFO] [talledLocalContainer] next = notificationEmailString
      [INFO] [talledLocalContainer] next = edit
      [INFO] [talledLocalContainer] next = bamboo.successReturnMode
      [INFO] [talledLocalContainer] next = buildKey
      [INFO] [talledLocalContainer] next = numFailedTimes
      [INFO] [talledLocalContainer] next = checkBoxFields
      [INFO] [talledLocalContainer] next = room
      [INFO] [talledLocalContainer] next = confirm
      [INFO] [talledLocalContainer] next = notificationRecipientType
      [INFO] [talledLocalContainer] next = apiToken
      [INFO] [talledLocalContainer] next = conditionKey
      [INFO] [talledLocalContainer] next = notificationIMString
      [INFO] [talledLocalContainer] next = jobEquiv
      [INFO] [talledLocalContainer] next = atl_token
      [INFO] [talledLocalContainer] next = firstErrorOccuranceOnly
      [INFO] [talledLocalContainer] next = notificationGroupString
      [INFO] [talledLocalContainer] next = notificationId
      [INFO] [talledLocalContainer] next = roompw
      [INFO] [talledLocalContainer] next = chainEquiv
      [INFO] [talledLocalContainer] next = notificationUserString
      [INFO] [talledLocalContainer] 2016-03-14 20:13:16,577 INFO [http-nio-6990-exec-1] [AutoReloadFilter] No reload detected
      [INFO] [talledLocalContainer] 2016-03-14 20:13:16,578 INFO [http-nio-6990-exec-1] [AccessLogFilter] admin GET http://localhost:6990/bamboo/chain/admin/config/defaultChainNotification.action?saved=true&buildKey=TBP-BP&lastModified=4653059 57119kb
      [INFO] [talledLocalContainer] populateContext = {room=sometestroom@conferance.jabber.org}
      [INFO] [talledLocalContainer] populateContext = {room=sometestroom@conferance.jabber.org}
      [INFO] [talledLocalContainer] 2016-03-14 20:13:17,061 INFO [http-nio-6990-exec-2] [AccessLogFilter] admin GET http://localhost:6990/bamboo/rest/pref/latest/user/?expand=preferences.preference 126672kb
      [INFO] [talledLocalContainer] 2016-03-14 20:13:17,164 INFO [http-nio-6990-exec-7] [AutoReloadFilter] No reload detected
      [INFO] [talledLocalContainer] 2016-03-14 20:13:17,164 INFO [http-nio-6990-exec-7] [AccessLogFilter] admin GET http://localhost:6990/bamboo/plugins/servlet/dev-toolbar 126000kb
      

      Notice there is a post but the returned context has the old configuration...

      Now if I hit delete...it magically shows up

      [INFO] [talledLocalContainer] 2016-03-14 20:15:14,000 INFO [http-nio-6990-exec-5] [AutoReloadFilter] No reload detected
      [INFO] [talledLocalContainer] 2016-03-14 20:15:14,001 INFO [http-nio-6990-exec-5] [AccessLogFilter] admin POST http://localhost:6990/bamboo/chain/admin/config/deleteChainNotification.action?buildKey=TBP-BP&notificationId=4653058 61240kb
      [INFO] [talledLocalContainer] 2016-03-14 20:15:14,030 INFO [http-nio-6990-exec-6] [AutoReloadFilter] No reload detected
      [INFO] [talledLocalContainer] 2016-03-14 20:15:14,031 INFO [http-nio-6990-exec-6] [AccessLogFilter] admin GET http://localhost:6990/bamboo/chain/admin/config/defaultChainNotification.action?buildKey=TBP-BP&saved=true 60857kb
      [INFO] [talledLocalContainer] populateContext = {room=sometestroom@conferance.jabber.orgchanged}
      [INFO] [talledLocalContainer] populateContext = {room=sometestroom@conferance.jabber.orgchanged}
      [INFO] [talledLocalContainer] 2016-03-14 20:15:14,456 INFO [http-nio-6990-exec-10] [AccessLogFilter] admin GET http://localhost:6990/bamboo/rest/pref/latest/user/?expand=preferences.preference 130120kb
      [INFO] [talledLocalContainer] 2016-03-14 20:15:14,566 INFO [http-nio-6990-exec-3] [AutoReloadFilter] No reload detected
      [INFO] [talledLocalContainer] 2016-03-14 20:15:14,567 INFO [http-nio-6990-exec-3] [AccessLogFilter] admin GET http://localhost:6990/bamboo/plugins/servlet/dev-toolbar 129882kb
      

      I'm currently running version 5.10.1 Build 51017, I did try and compile against 5.10.2 but didn't see any difference. I've attached my NotificationRecipient file for reference.

      Attachments

        Issue Links

          Activity

            People

              pbruski Przemek Bruski
              da2c547d60e5 Andy Snowden
              Votes:
              5 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: