fix(packages): show error for duplicate cleanup rules #37820 (#38786)

## Issue

Gitea does not display a clear error message when a user tries to create
a cleanup rule for a package type that already has an existing cleanup
rule.

Although the duplicate rule is detected, the user is not informed why
the cleanup rule cannot be created.

## Solution

Add a user-facing error message when a cleanup rule already exists for
the selected package type.

Also add an integration test to verify that the appropriate error
message is displayed when attempting to create a duplicate cleanup rule.

Fixes #37820
This commit is contained in:
Mitrahsoft
2026-08-06 07:06:32 +00:00
committed by GitHub
parent 92ac357b1a
commit caf2e03605
3 changed files with 30 additions and 1 deletions
+2 -1
View File
@@ -3932,5 +3932,6 @@
"actions.general.cross_repo_desc": "Allow the selected repositories to be accessed (read-only) by all the repositories in this owner with GITEA_TOKEN when running Actions jobs.",
"actions.general.cross_repo_selected": "Selected repositories",
"actions.general.cross_repo_target_repos": "Target Repositories",
"actions.general.cross_repo_add": "Add Target Repository"
"actions.general.cross_repo_add": "Add Target Repository",
"packages.owner.settings.cleanuprules.type.already_exists": "A cleanup rule for this package type already exists."
}