Skip to content

ECOPROJECT-4723 | fix: Remove bulk delete sources endpoint#1227

Merged
openshift-merge-bot[bot] merged 1 commit into
mainfrom
remove-delete-all
Jun 8, 2026
Merged

ECOPROJECT-4723 | fix: Remove bulk delete sources endpoint#1227
openshift-merge-bot[bot] merged 1 commit into
mainfrom
remove-delete-all

Conversation

@AvielSegev

@AvielSegev AvielSegev commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Remove the DELETE /api/v1/sources endpoint that deleted all sources
without authorization checks. E2e cleanup now lists sources and deletes
each individually via DELETE /api/v1/sources/{id}.

Signed-off-by: Aviel Segev asegev@redhat.com

Summary by CodeRabbit

  • Breaking Changes
    • Removed bulk deletion capability for sources. The DELETE /api/v1/sources endpoint is no longer available. Source deletion now requires specifying an individual source ID using the format delete source/<id>.

Remove the DELETE /api/v1/sources endpoint that deleted all sources
without authorization checks. E2e cleanup now lists sources and deletes
each individually via DELETE /api/v1/sources/{id}.

Signed-off-by: Aviel Segev <asegev@redhat.com>
@AvielSegev AvielSegev requested a review from a team as a code owner June 7, 2026 09:31
@AvielSegev AvielSegev requested review from amalimov and tupyy and removed request for a team June 7, 2026 09:31
@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 97fc7c2b-809c-495f-b28d-9778bdb20b8e

📥 Commits

Reviewing files that changed from the base of the PR and between 53de0cc and d89a8d8.

📒 Files selected for processing (12)
  • api/v1alpha1/openapi.yaml
  • api/v1alpha1/spec.gen.go
  • internal/api/client/client.gen.go
  • internal/api/server/server.gen.go
  • internal/cli/delete.go
  • internal/handlers/v1alpha1/source.go
  • internal/handlers/v1alpha1/source_test.go
  • internal/service/source.go
  • internal/service/source_test.go
  • internal/store/source.go
  • internal/store/source_test.go
  • test/e2e/service/source.go
💤 Files with no reviewable changes (9)
  • internal/store/source.go
  • internal/service/source_test.go
  • internal/service/source.go
  • internal/handlers/v1alpha1/source.go
  • internal/handlers/v1alpha1/source_test.go
  • internal/store/source_test.go
  • internal/api/client/client.gen.go
  • internal/api/server/server.gen.go
  • api/v1alpha1/openapi.yaml

📝 Walkthrough

Walkthrough

This PR removes the bulk-delete DELETE /api/v1/sources endpoint across the codebase. Changes span the OpenAPI specification, generated API client/server code, business logic layers, CLI commands, and end-to-end tests to enforce single-source deletion only.

Changes

Remove bulk DeleteSources API

Layer / File(s) Summary
OpenAPI contract and embedded specification
api/v1alpha1/openapi.yaml, api/v1alpha1/spec.gen.go
OpenAPI spec removes DELETE /api/v1/sources operation; embedded Swagger payload in spec.gen.go is regenerated.
Generated API client and server code
internal/api/client/client.gen.go, internal/api/server/server.gen.go
Generated DeleteSources methods, interfaces, route handlers, request/response wrappers, and parsers are removed from client ClientInterface, Client, ClientWithResponsesInterface, ClientWithResponses, ServerInterface, Unimplemented, StrictServerInterface, and strictHandler layers.
Handler and service layer implementation
internal/handlers/v1alpha1/source.go, internal/handlers/v1alpha1/source_test.go, internal/service/source.go, internal/service/source_test.go
DeleteSources handler method is removed; bulk-delete service method DeleteSources is removed; tests convert from bulk-delete validation to single-source deletion validation with cascading agent cleanup.
Store interface and implementation
internal/store/source.go, internal/store/source_test.go
DeleteAll method removed from Source interface and SourceStore implementation; corresponding test that validated bulk delete with agent cleanup is removed.
CLI and end-to-end test updates
internal/cli/delete.go, test/e2e/service/source.go
CLI delete command now requires source ID and returns error if missing; E2E RemoveSources helper converts from single bulk DELETE request to iterative per-source deletion via GetSources/RemoveSource loop with wrapped error handling.

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

lgtm, approved

Suggested reviewers

  • amalimov

🐰 Hops with glee!
Bulk deletion is no more, the API's reborn,
Per-source it shall be, source by blessed source!
One delete at a time, a cleaner course taken,
The rabbits approve this refactor forsaken! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing the bulk delete sources endpoint (DELETE /api/v1/sources) across the entire codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-delete-all

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot added the lgtm label Jun 8, 2026
@openshift-ci

openshift-ci Bot commented Jun 8, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tupyy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved label Jun 8, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit db4c785 into main Jun 8, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants