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 | ||
EE access levels available | ||
status checks and approvals not available | ||
status checks and approvals available |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Ideal GDK world
-
In rails console enable the experiment fully
Feature.enable(:edit_branch_rules)
-
Go to Project / Settings / Repository / Branch rules
-
Click Add branch rule. Make sure you can only see Branch name or pattern
-
Create a custom rule with Branch name or pattern
-
In Allowed to push and merge section click Edit and change any settings. Make sure you cannot see users or groups selector.
-
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:
- Add
live_debug
to test cases with these features stubbed and not stubbed: ee-branch-rules.patch - Run the specs with the preview:
WEBDRIVER_HEADLESS=0 bundle exec rspec ee/spec/features/projects/settings/branch_rules_settings_spec.rb
- After checking each scenario, press any key in the terminal running the specs to move to the next example.
Related to #477963 (comment 2080590882)