gitlabform: MR approvers not working in some cases
In several latest Gitlab releases, Gitlab doesn’t support the “approvers” endpoint which gitlabform has historically been using to manage approvers… and then also approver rule (a single one).
That endpoint is no longer available on Gitlab 13, 14, 15 and I’m aware that https://github.com/gitlabform/gitlabform/pull/176 is unlikely to be merged in. It’s unfortunate yet completely understandable - if this functionality isn’t essential for the author and community hasn’t managed to provide a fix (well, myself included), it’s only fair.
I wonder though, could it be useful perhaps to remove managing approvers from the feature list and mark using approvers + approver_group keys as obsolete? As it is, running Gitlabform accepts them but any configuration given has no effect.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 35 (30 by maintainers)
Commits related to this issue
- WIP: Reproduce Siythrun's issue from #388 — committed to gitlabform/gitlabform by gdubicki 2 years ago
- WIP: Reproduce Siythrun's issue from #388 — committed to gitlabform/gitlabform by gdubicki 2 years ago
- Fix Siythrun's issue from #388 by following wwkimball's advice from https://github.com/gitlabform/gitlabform/pull/467#discussion_r1064063152 tl;dr: mustexist=True is practically necessary for get_no... — committed to gitlabform/gitlabform by gdubicki a year ago
- Fix Siythrun's issue from #388 + refactor transform tests by following wwkimball's advice from https://github.com/gitlabform/gitlabform/pull/467#discussion_r1064063152 — committed to gitlabform/gitlabform by gdubicki 2 years ago
- Fix Siythrun's issue from #388 + refactor transform tests by following wwkimball's advice from https://github.com/gitlabform/gitlabform/pull/467#discussion_r1064063152 — committed to gitlabform/gitlabform by gdubicki 2 years ago
- Fix Siythrun's issue from #388 + refactor transform tests by following wwkimball's advice from https://github.com/gitlabform/gitlabform/pull/467#discussion_r1064063152 — committed to gitlabform/gitlabform by gdubicki 2 years ago
- Fix Siythrun's issue from #388 + refactor transform tests by following wwkimball's advice from https://github.com/gitlabform/gitlabform/pull/467#discussion_r1064063152 — committed to gitlabform/gitlabform by gdubicki 2 years ago
- Merge pull request #467 from gitlabform/fix_no_groups Reproduce and fix Siythrun's issue from #388 — committed to gitlabform/gitlabform by gdubicki a year ago
I am beginning working on this feature. For a start I would like to get feedback on a configuration syntax proposal.
The current syntax, f.e.:
…would remain working for users who don’t need more than 1 approval rule and related syntax complexity. The single approval rule managed this way would keep its current name - “Approvers (configured using GitLabForm)”.
But the
remove_other_approval_ruleskey would be deprecated and a more standardenforce: truekey would replace it.So the new syntax would look like this:
…where:
So to achieve what you wanted, @weakcamel, we would need to use the following config syntax:
Opinions?
cc @jimisola @amimas
Please try out v3.4.0rc1 with this feature and a syntax working like described above, @weakcamel. Let me know what you think!
What @zanella is tackling in #423 made me realize that from the implementation point of view it would be easier to treat managing Merge Requests approvals split into:
SingleEntityProcessor,MultipleEntitiesProcessor,The simplest way to do it would be to change the new syntax to this (note that
merge_requests_approvalsandmerge_requests_approval_rulesare new sections just belowgroup/project):(Of course in v3.x the old syntax would still be supported, but with a deprecation warning recommending to update to a new syntax.)
I am happy to report that the v3.4.0 with this feature has finally been released as a new stable release. 🥳
The docs are available at https://gitlabform.github.io/gitlabform/reference/merge_requests/.
Big thanks to everyone for your cooperation on this!
Please open new issues if you find any bugs in the new features.
Thanks @weakcamel! I plan to implement this feature over the next few weeks and will release a RC version and I will appreciate testing it. 😃
The proposal looks good to me @gdubicki .
For the new syntax of setting custom approval rules:
Is it more work to support/remove the usage of ids? Personally I don’t think I would use the ids, but we seem to support that for advanced branch protection settings (i.e. allowed to push, allowed to merge, etc.).
https://gitlabform.github.io/gitlabform/reference/protected_branches/#premium-only-features
So, having ids would make it consistent across gitlabform syntax. That could be useful if someone is modularizing their config using yaml anchors or other setup. Or, maybe the usage of ids in branch protection gets deprecated/removed in v4.
Also, I assume this is being planned for v3. Perhaps we create a separate issue for updating the existing approval rule syntax in v4. For example, instead of the following:
This is probably more intuitive and again keeps the overall syntax consistent with other areas of gitlabform (i.e. branch protection, members, etc.)
If anyone wants to test what will most probably be in v3.4.0 final, please check out v3.4.0rc4 released a moment ago.
Please don’t hesitate with sharing any issues you may find - I will release a final release asap after the weekend if no one will report any issue.
Big thanks for the tests @Siythrun and @weakcamel!
I did also notice that transforming from the old syntax is not working like it should too - the groups seem to not be transformed - so I definitely have some fixes to do before this goes final.
When running if i have
The rules are created but non of the groups have been added
but removing the merge_requests_approval_rules from the top level into the sub-level it works fine
I would have to check what are the options to restore the default „any eligible dev” approval rule with the API and we should come up with a proposal for config syntax that would result in it. Any suggestions about the latter, @weakcamel?