Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-13485

Required build rules with model branch matchers do not work

    XMLWordPrintable

Details

    Description

      Important information

      The impact of this bug will vary depending on Bitbucket version.

      • Bitbucket 8.5.0 and higher: all existing required build rules that use model branch matchers will be fixed on upgrade, and all newly created required build rules that use model matchers will function correctly.
      • Versions of Bitbucket with the bugfix (see Fix Version/s in this ticket), but before 8.5.0: all newly created required build rules that use model matchers will function correctly, but existing required build rules that use model branch matchers (created before upgrading) will not. These can be manually fixed if needed.
      • Other Bitbucket versions (without the bugfix): required build rules that use model branch matchers will not function. A branch name matcher could be used instead to give similar functionality if needed.

      Issue Summary

      Required builds rules can be added for branch matchers, which include a specific branch name, or a pattern, or a branching model. The branching model selection includes branch model categories (e.g. feature branch prefix) and branch model branches (e.g. development branch) that are enabled for the project or repository.

      Required build rules created with model branch matchers (development branch and production branch) do not work (i.e. no merge check is done for a protected target branch matching a model branch, and no exemption is made for an exempt source branch matching a model branch). All other matchers function correctly, including model category matchers (bugfix, feature, hotfix, release).

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Turn on the development branch and/or production branch matcher branch model in the repository settings (the development branch is on by default).
      2. Create a required build rule with a model branch matcher (e.g. protect the branching model "Development branch" or "Production branch", or adding an exemption for the branching model "Development branch" or "Production branch")
      3. Create a pull request that satisfies the required build rule (e.g. a pull request from or targeting the "Development branch" or "Production branch")

      Expected Results

      For a required build rule protecting the development or production branch, a pull request targeting that branch is prevented from being merged until a successful build execution for the rule is present.

      For a required build rule exempting the development or production branch, a pull request from that branch should not be prevented from being merged for that rule.

      Actual Results

      Required build rules with model branch matchers do not function.

      Workaround

      Required builds rules with model branch matchers created after upgrading to a version of Bitbucket that includes the bugfix (see fixed versions) will function correctly. Additionally, upgrading to Bitbucket 8.5.0+ will include a database migration that automatically fixes any broken model branch matchers.

      On versions of Bitbucket with the bugfix but before 8.5.0, required build rules with model branch matchers created before upgrading will show up as "INVALID" in the required build rules list after upgrade. These can be fixed by editing the rule, re-selecting the appropriate matcher and saving.

      There is no workaround for using a model branch matcher in a required build rule for versions of Bitbucket that do not include the fix. A branch name matcher could be used instead to give similar functionality.

      Attachments

        Activity

          People

            spetrucev Stefan
            spetrucev Stefan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: