`/groups/:id/push_rule` API does not return `commit_committer_check` or `reject_unsigned_commits` attributes
Summary
/groups/:id/push_rule API does not return commit_committer_check or reject_unsigned_commits attributes as expected. /projects/:id/push_rule does.
Steps to reproduce
- curl the API endpoint for an any group (sorry, not sure what else to say here)
Example Project
I'm not able to create public subgroups in our corporate account, and I don't think a new group would be under the "gold" plan so the attributes wouldn't show up anyway. Either way, I've created a test subgroup and test project, though they aren't public.
- group: 10638130
- project: 23644085
What is the current bug behavior?
The /groups/:id/push_rule API does not return the commit_committer_check or reject_unsigned_commits attributes. API documentation here suggests that the commit_committer_check or reject_unsigned_commits attributes should be returned for users on Premium, Silver or higher, which we are on.
The commit_committer_check and reject_unsigned_commits attributes are returned for the /projects/:id/push_rule API as expected so I don't think this is a permissions issue (I am Owner at our top level group.)
What is the expected correct behavior?
The /groups/:id/push_rule API should return commit_committer_check and reject_unsigned_commits attributes.
Relevant logs and/or screenshots
This is the /groups/:id/push_rule API which does not return the commit_committer_check or reject_unsigned_commits attributes.
$ curl --silent --header "PRIVATE-TOKEN: ${TOKEN}" "https://gitlab.com/api/v4/groups/10638130/push_rule" | jq .
{
"id": 9518000,
"created_at": "2020-10-28T17:06:26.503Z",
"commit_message_regex": "",
"commit_message_negative_regex": "",
"branch_name_regex": "^[\\w\\-]*$",
"deny_delete_tag": false,
"member_check": false,
"prevent_secrets": true,
"author_email_regex": "",
"file_name_regex": "",
"max_file_size": 0
}
This is the /projects/:id/push_rule API which does return the attributes as expected.
$ curl --silent --header "PRIVATE-TOKEN: ${TOKEN}" "https://gitlab.com/api/v4/projects/23644085/push_rule" | jq .
{
"id": 9518030,
"project_id": 23644085,
"created_at": "2020-10-28T17:06:26.503Z",
"commit_message_regex": "",
"commit_message_negative_regex": "",
"branch_name_regex": "^[\\w\\-]*$",
"deny_delete_tag": false,
"member_check": false,
"prevent_secrets": true,
"author_email_regex": "",
"file_name_regex": "",
"max_file_size": 0,
"commit_committer_check": null,
"reject_unsigned_commits": true
}
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
GitLab.com corporate account on Gold plan
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)