[go: up one dir, main page]

Clarify DELETE behavior for push rules - inconsistent state between API deletion and UI recreation

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

There is inconsistent behavior regarding what happens when a push rule is deleted via API. What should deleting a rule semantically mean to users?

Current Behavior

GitLab currently implements two conflicting behaviors for push rule deletion:

  1. After DELETE via API: The push rule is completely removed and the project ignores group/instance push rule settings (behaves like "disable push rules for the project")

  2. After visiting repository settings page: The push rule is automatically restored to default settings from group or instance level (behaves like "reset to default settings")

This inconsistency means that a user can delete a push rule via API and push rules won't be applied to the project. But if the user visits the repository settings page, then it will automatically recreate the push rule for project.

Problem

Users experience confusing behavior where:

  • They delete a push rule via API expecting it to stay deleted
  • The push rule gets automatically recreated when they visit repository settings
  • There's no clear indication of what DELETE should actually do

Questions to Resolve

What should deleting a push rule mean to users? There are two possible definitions:

  1. Delete means "reset to default settings": When a user deletes a project push rule, the project push rule should be replaced with a default rule from either the group or instance level.

  2. Delete means "disable push rules for the project": When a user deletes a project's push rule, project push rules are completely removed, and the project will ignore group/instance push rule settings.

Expected Outcome

We need to:

  1. Define the expected behavior for DELETE operations on push rules
  2. Ensure consistent behavior between API deletion and UI interactions
  3. Update documentation to clearly explain the behavior
  4. Implement the chosen behavior consistently across all interfaces

Related Issues

This discussion originated from #578540 which addresses a different issue about push rule inheritance in the repository settings controller.

Impact

  • User Experience: Confusing and unpredictable behavior when managing push rules
  • API Consistency: DELETE operations should have predictable and documented behavior
  • Documentation: Users need clear guidance on what DELETE means in this context
Edited by 🤖 GitLab Bot 🤖