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

Null validation on the name field in AnyTrigger while it's not possible to set name on UI

    XMLWordPrintable

Details

    Description

      Steps to replicate:

      1. export the spec code from https://server-syd-bamboo.internal.atlassian.com/exportSpecs/plan.action?buildKey=CSM-CMRAP.
      which contains an AnyTrigger with no name field:

           new AnyTrigger(new AtlassianModule("com.atlassian.bamboo.triggers.atlassian-bamboo-triggers:daily"))
                          .description("Run daily at 19:00 UTC")
                          .configuration(new MapBuilder()
                                  .put("selectedBuildStrategy", "daily")
                                  .put("repository.change.daily.buildTime", "19:00")
                                  .build()))
      

      2. run the code using java or groovy and an exception will be throw:

      com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException: Argument name can not be null.
      
      	at com.atlassian.bamboo.specs.api.validators.common.ImporterUtils.checkNotNull(ImporterUtils.java:100)
      	at com.atlassian.bamboo.specs.api.validators.common.ImporterUtils.checkNotNull(ImporterUtils.java:92)
      	at com.atlassian.bamboo.specs.api.validators.common.ImporterUtils.checkNotBlank(ImporterUtils.java:140)
      	at com.atlassian.bamboo.specs.api.validators.common.ImporterUtils.checkNotBlank(ImporterUtils.java:132)
      	at com.atlassian.bamboo.specs.api.model.trigger.TriggerProperties.validate(TriggerProperties.java:72)
      	at com.atlassian.bamboo.specs.api.model.trigger.RepositoryBasedTriggerProperties.validate(RepositoryBasedTriggerProperties.java:48)
      	at com.atlassian.bamboo.specs.api.model.trigger.AnyTriggerProperties.validate(AnyTriggerProperties.java:53)
      	at com.atlassian.bamboo.specs.api.model.trigger.AnyTriggerProperties.<init>(AnyTriggerProperties.java:37)
      	at com.atlassian.bamboo.specs.api.builders.trigger.AnyTrigger.build(AnyTrigger.java:59)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.atlassian.bamboo.specs.api.util.EntityPropertiesBuilders.build(EntityPropertiesBuilders.java:21)
      	at com.atlassian.bamboo.specs.api.builders.plan.Plan.triggers(Plan.java:264)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:189)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:130)
      

      Workaround:

      • add a call to explicitly set the name in above exported script.

      Attachments

        Activity

          People

            achystoprudov Alexey Chystoprudov
            zzhou Zhenhuan Zhou (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: