gitlabform: Breaking inheritance validation error in 4.1.2
We have the higher level config:
"viator/infrastructure/*":
project_settings:
jobs_enabled: true
project_push_rules:
max_file_size: 20 # MB
branches:
master: *default_branch_settings
develop: *default_branch_settings
production: *default_branch_settings
main: *default_branch_settings
merge_requests_approval_rules:
inherit: false
infrastructure:
name: "Any approver in the Infrastructure team"
approvals_required: 1
groups:
- viator/org/infrastructure
enforce: true
and with 4.1.1 it applied the merge_requests_approval_rules on below fine without merge_requests_approval_rules (checked on Gitlab settings page)
"viator/infrastructure/terraform/database-users"
.....
4.1.2 show error
🏗 GitLabForm version: 4.1.2 = the latest stable 😊
Warning: Connected as non-admin. You may encounter permission issues.
Running in dry-run mode...
>>> Getting requested groups or projects...
Error: The inheritance-break flag set in "viator/infrastructure/aws/aws-workspace-scripts" under key "merge_requests_approval_rules" is invalid
because it has no higher level setting to inherit from.
project config:
"viator/infrastructure/aws/aws-workspace-scripts":
merge_requests_approval_rules:
inherit: false
infrastructure_or_devx: *infrastructure_or_devx_merge_requests_approval_rule
enforce: true
These same configuration show no above error when run using 4.1.1 Is there any major change to this breaking inheritance feature in 4.1.2 ??
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 16 (6 by maintainers)
Commits related to this issue
- test: validate approval rules can be overridden - #942 — committed to TimKnight-DWP/gitlabform by TimKnight-DWP 2 years ago
- test: fix issues with eventual consistency in tests and cover an mr_approval_rules use case (#969) * test: validate approval rules can be overridden - #942 * test: use for_function methods to preve... — committed to gitlabform/gitlabform by TimKnight-DWP 2 years ago
@TimKnight-DWP - Thanks for confirming. Glad we’re on the same page. Based on my explanation, I’d say you’re simply seeing existing behaviour of gitlabform. It’s not a new bug and also not related to the original question that was brought up in this issue.
Could you please move your comments into a separate new issue? Let’s delete or scratch the comments related to your case in this issue. We can discuss any potential changes or improvements in the new issue. Otherwise this original case mentioned in this issue will easily get lost.
@amimas I will take a look through this issue and code changes, looks like we’re seeing something similar too on merge_request_approval_rules
@gosoly - Did you get a chance to review my finding? Are you using
skip_group?Regardless, I think it’s worth discussing it a bit more.
I had been thinking about this for a bit. My initial thought was that the current behaviour makes sense. But, I can see how it might be expected the other way too. I think it really depends on the definition of
skip_group. If a group is being skipped, what does that mean?Maybe
skip_grouponly means, don’t apply the changes to that “group” but use it for config processing. In that case, projects under that group should continue to inherit configs from the group. But, is that an appropriate expectation? What if someone expects it the way it is now?What’s your thought @gdubicki @TimKnight-DWP @jimisola ?
@amimas here is the short config I try to test it
and here is when run it same config above between 4.1.1 vs 4.1.2 4.1.1 run without any issue
but it failed validation on 4.1.2