IBM Support

Overriding property values with patterns does not enforce validation

Troubleshooting


Problem

Attempts to save an overridden property value using IBM UrbanCode Deploy 6.0.0 does not result in a validation error, even if the property is defined with a pattern (regular expression) that should be violated.

Symptom

The following steps reproduce the problem. The first scenario shows the expected validation of a default property value against the specified pattern:

  1. Create a component template called MyTemplate

  2. Open the Configuration > Environment Properties tab

  3. Add a property called MyProperty with:


    - Pattern: \d+
    - Default value: 30s






  4. Attempt to save the property

  5. Note the error Alert: Value for property definition named MyProperty is not valid. Check that it matches any pattern defined by the property definition!
    as in the screenshot:


  6. Save the property anyway

  7. Edit the property and change the Default value to 30


  8. Attempt to save the property. This time it succeeds without showing the Alert.

The next scenario shows the unexpected lack of validation of the actual property value against the specified pattern:
  1. Create a Component based on the template MyCompWithTemplate

  2. Create an Application called MyApplication

  3. Add the Component to the Application

  4. Add an Environment called MyEnvironment to the Application

  5. Select the Environment > Configuration > Environment Properties

  6. Set the value for the property to: 30s

  7. Note that there is no Alert and you are allowed to save the property:

Cause

This problem is the result of a product defect.

Resolving The Problem

SOLUTION

There are two possible resolutions for this issue:

  • Upgrade to UrbanCode Deploy 6.0.1. This will show the Alert
    also in the second scenario:


OR
  • As a workaround in UrbanCode Deploy 6.0.0.0, you could define the Pattern as: - Pattern: ^\d+$. This will show the Alert in both scenarios. The meaning of this Regular Expression is that you ask for the contents of the Property value to be exactly as the pattern, instead of just containing the pattern.

[{"Product":{"code":"SS4GSP","label":"IBM UrbanCode Deploy"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"General Information","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF022","label":"OS X"},{"code":"PF034","label":"Windows Mobile"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
17 June 2018

UID

swg21659211