Skip to content

Add reject_non_dco_commits to push rules REST API

What does this MR do and why?

  • reject_non_dco_commits is an existing field to configure group & project push rules. But it was missing from the REST API.
  • This MR just adds that field to the push rules REST API

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.

How to set up and validate locally

  1. Get a personal access token as a group & project maintainer
  2. Use that token for running following API requests. The API requests can be run for both groups and projects
# Create a push rule
curl --header "Authorization: Bearer <TOKEN>" --request POST --header "Content-Type: application/json" \
--data '{"reject_non_dco_commits": true}' "http://gdk.test:3000/api/v4/groups/<ID>/push_rule"
# Get a push rule
curl --header "Authorization: Bearer <TOKEN>" "http://gdk.test:3000/api/v4/groups/<ID>/push_rule"
# Update a push rule
curl --header "Authorization: Bearer <TOKEN>" --request POST --header "Content-Type: application/json" \
--data '{"id": <PUSH_RULE_ID>, "reject_non_dco_commits": false}' "http://gdk.test:3000/api/v4/groups/<ID>/push_rule"

Related to #459959 (closed)

Edited by Hinam Mehra

Merge request reports

Loading