Add API endpoint to delete a generic package file
What does this MR do and why?
Adds a `DELETE` endpoint for generic package files, following the existing deletion pattern in `lib/api/package_files.rb`. The endpoint: - Enforces package deletion protection via `Packages::Protection::CheckRuleExistenceService.for_delete` (behind the `packages_protected_packages_delete` feature flag), returning 403 when a protection rule exists. - Tracks the `delete_package` event inside the `destroy_conditionally!` block so it only fires when destruction actually proceeds.
Adds a `DELETE` endpoint for the generic packages repository, allowing users to delete a generic package file directly by package name, version, and filename — aligning with the existing PUT (upload) and GET (download) endpoints.
Endpoint: `DELETE /projects/:id/packages/generic/:package_name/:package_version/:file_name`
Changelog: added Closes #536839
Database
The only write is a single-row status update on `packages_package_files` (`pending_destruction!`), scoped by primary key — equivalent to the existing generic/package_files deletion endpoint.
<!-- paste the UPDATE line from log/development.log here after hitting the endpoint once in GDK -->
References
Closes #536839
How to set up and validate locally
1. Create a Personal Access Token with `api` scope.
2. Upload a test file via the generic packages PUT endpoint.
3. Delete it with the new endpoint: `curl --request DELETE --header "PRIVATE-TOKEN: <token>" ".../packages/generic/my-package/1.0.0/test.txt"`
4. Confirm 204 on success, 403 when a matching protection rule exists.
Related to #536839