Skip to content

CE/EE separation of Branch rule details page

What does this MR do and why?

  • limit users and groups selector for a protected branch based on the license feature check
  • reorder feature specs to include test cases for custom rule in one block
  • add a test case for editing branch protection on Branch rule details
  • show predefined branch rules - All branches and All protected branches - only when their respecting settings are avaiable
  • move test cases for EE dependent predefined branch rules to the EE spec

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Context Before After
EE access levels not available Screenshot_2024-09-03_at_16.08.32 Screenshot_2024-09-03_at_14.50.08
EE access levels available Screenshot_2024-09-03_at_16.08.32 Screenshot_2024-09-03_at_14.50.34
status checks and approvals not available Screenshot_2024-09-03_at_16.07.52 Screenshot_2024-09-03_at_15.16.36
status checks and approvals available Screenshot_2024-09-03_at_16.07.52 Screenshot_2024-09-03_at_15.38.54

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Ideal GDK world

  1. Simulate a CE instance with a licensed GDK

  2. In rails console enable the experiment fully

    Feature.enable(:edit_branch_rules)
  3. Go to Project / Settings / Repository / Branch rules

  4. Click Add branch rule. Make sure you can only see Branch name or pattern

  5. Create a custom rule with Branch name or pattern

  6. In Allowed to push and merge section click Edit and change any settings. Make sure you cannot see users or groups selector.

  7. Change your GDK back to EE and make sure those sections are visible

When GDK doesn't want to run in CE

I wasn't able to simulate CE. You may try this workaround from Slack (internal only). But it didn't solve my problems. So I had to test it with rspecs. Here's how:

  1. Add live_debug to test cases with these features stubbed and not stubbed: ee-branch-rules.patch
  2. Run the specs with the preview: WEBDRIVER_HEADLESS=0 bundle exec rspec ee/spec/features/projects/settings/branch_rules_settings_spec.rb
  3. After checking each scenario, press any key in the terminal running the specs to move to the next example.

Related to #477963 (comment 2080590882)

Edited by Paulina Sedlak-Jakubowska

Merge request reports

Loading