Extract project push rule to service class
Push rules can be treated as a type of settings, such as application_settings, project_settings, etc. There must be only one for a given project. Therefore, it would be better to just expose the update interface and let the creation handled behind the scene. This commit extracts project push rule create and update logic to a dedicated service class. This change allows to centralize auditing and logging of actions from Project Push Rule controller and API. The POST and PUT API can handle both create and update without raising `unprocessable_entity` and `not_found` error respectively. Since the user can only manage push rule via project id and they can only ever create one, this change reduces coordinating POST request before PUT request.
Showing
Please register or sign in to comment