Pattern Match Labelling is not working with Bamboo Specs YAML when there's no Regex Pattern

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 8.1.9, 8.2.5
    • Affects Version/s: 8.1.2, 8.2.3
    • Component/s: Bamboo Specs
    • None
    • 1
    • Severity 3 - Minor

      Issue Summary

      Pattern Match Labelling is not working with Bamboo Specs YAML when the Regex Pattern field is empty even though the field description says "Leave blank to label every build". Leaving that field blank works fine for plans that are not managed by Specs.

      This is reproducible on Data Center: Yes.

      Steps to Reproduce

      1. Create a linked repository in Bamboo pointing to a repository type that supports Bamboo Specs (e.g. Bitbucket Server or Data Center).
        • Enable Bamboo Specs in the repository configuration and give it the following access Project creation allowed, Access all projects and Access all repositories.
      2. Create a project in Bamboo named Test with key TEST.
      3. Create a bamboo-specs folder inside your repository's root and the bamboo.yaml file inside with the following content:
        <repository-root>/bamboo-specs/bamboo.yaml
        ---
        version: 2
        plan:
          project-key: TEST
          key: PLAN
          name: Plan
        stages:
        - Default Stage:
            manual: false
            final: false
            jobs:
            - Default Job
        Default Job:
          key: JOB1
          other:
            all-other-apps:
              custom:
                auto:
                  label: test
                buildHangingConfig.enabled: 'false'
          tasks:
          - script:
              interpreter: SHELL
              scripts:
              - echo hello world
          artifact-subscriptions: []
        notifications: []
        labels: []
        dependencies:
          require-all-stages-passing: false
          enabled-for-branches: true
          block-strategy: none
          plans: []
        other:
          concurrent-build-plugin: system-default
        
      4. This will create a plan called Plan under the Test project. You should see one Specs update and one build triggered for TEST-PLAN at this stage.

      Expected Results

      The build should contain a label named test.

      Actual Results

      The build does not contain any labels.

      Workaround

      Add the regex field to your YAML file. If you're looking to label all builds you can use the following regex (otherwise customize the regex to meet your needs):

      regex: .*
      

      Following the example above you should end up with:

      <repository-root>/bamboo-specs/bamboo.yaml
      ...
      Default Job:
        key: JOB1
        other:
          all-other-apps:
            custom:
              auto:
                label: test
                regex: .*
              buildHangingConfig.enabled: 'false'
      ...
      

            Assignee:
            Marcin Gardias
            Reporter:
            Bruno Rosa
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: