Disable Uploading of Step Patterns from CI Server

The plugin offers you two ways to create and maintain step patterns that you use in your story writing:

  1. automatically uploading them programmatically from your CI server
  2. creating and editing them via the built in step patterns screen

You can use the two approaches simultaneously however the recommended approach would be to allow for a one time upload by your CI server when you begin using the plugin for a particular project and then to disable the automatic upload by the CI server and use only step patterns screen for further management of step patterns from then on.

The initial upload is recommended so that you don't have to create a large number of step patterns manually via the step patterns screen to match what you have accumulated in your Java source files to date. Using only step patterns management screen from then onwards ensures that you don't see unexpected changes being synchronised from your source files as developers work on the code; for example a Jira user creates a new step pattern with one parameter of particular type e.g. Integer via the step patterns screen but it could then happen that while implementing this step in code a developer uses Date for parameter type and executes CI server build to upload his step patterns to Jira - now the Jira user is confused as to why the parameter type has suddenly changed.

To disable the uploading of step patterns programmatically navigate to the plugin configuration page (see more here) and set the option titled 'Uploading of step patterns from Java client' to Off as shown in the screenshot below and click the Update button.

Note while setting this option to Off you want to ensure that the option titled 'Editing of step patterns' which controls whether editing of step patterns via the step patterns screen is enabled as opposed to being able to view them only is set to On, otherwise you would not have no way to update the step patterns.

After you set this configuration option to Off the next time a developer or your CI server tries to upload step patterns programmatically he will be presented with an error stack trace similar to the one below

Example error stack trace
java.lang.RuntimeException: Failed to upload step docs! Server returned error type response: StringResponse{payload='java.lang.RuntimeException: Uploading of step patterns via Java client is currently disabled
	at com.jbehaveforjira.plugin.rest.StepDocResource.addStepDocs(StepDocResource.java:191)
	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.plugins.rest.common.interceptor.impl.DispatchProviderHelper$TypeOutInvoker$1.invoke(DispatchProviderHelper.java:169)
	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:83)
	at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:53)
	at com.atlassian.plugins.rest.common.expand.interceptor.ExpandInterceptor.intercept(ExpandInterceptor.java:34)
	at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:53)
	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper.invokeMethodWithInterceptors(DispatchProviderHelper.java:110)
	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$TypeOutInvoker._dispatch(DispatchProviderHelper.java:167)
	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)