Skip to content

feat(server): delete segments command for http#2804

Open
dajneem23 wants to merge 5 commits intoapache:masterfrom
dajneem23:feature/2722-delete-segments-command-for-http
Open

feat(server): delete segments command for http#2804
dajneem23 wants to merge 5 commits intoapache:masterfrom
dajneem23:feature/2722-delete-segments-command-for-http

Conversation

@dajneem23
Copy link
Contributor

@dajneem23 dajneem23 commented Feb 24, 2026

Which issue does this PR close?

Closes #2722

Rationale

delete_segments already exists in binary/CLI/MCP and the HTTP SDK client already sends it, but the server HTTP API had no matching handler, so requests returned 404. This left HTTP behavior inconsistent with other transports.

What changed?

cargo fmt --all, cargo check -p server, cargo test -p integration --test mod --no-run cargo test --package integration --test mod -- server::general::authentication --nocapture

  • Added server-side HTTP support for delete_segments in core/server/src/http/segments.rs, following the same flow as partitions: parse path/query, validate, run permission check, -call delete_segments_base, and apply DeleteSegments state command.
  • Registered/kept the HTTP route wiring in the server HTTP router path for /streams/{stream_id}/topics/{topic_id}/partitions/{partition_id} with DELETE.
  • Enhanced core/integration/tests/server/scenarios/system_scenario.rs to call delete_segments at the end and verify partition segments_count before/after.
  • Updated web/docs/server-api.http with:
`DELETE {{url}}/streams/1/topics/1/partitions/1?segments_count=3`  
`Authorization: Bearer {{access_token}}`

(Path params: `stream_id`, `topic_id`, `partition_id`; query param: `segments_count`.)

Local Execution

  • Passed:

  • cargo fmt --all

  • cargo check -p server

  • cargo test -p integration --test mod --no-run

  • cargo test --package integration --test mod -- server::general::authentication --nocapture

  • Pre-commit hooks ran: ran

AI Usage

  1. Tool: ChatGPT (Codex)
  2. Scope: PR text drafting and test generation/updates system_scenario.rs
  3. Verification: Local formatting/check/test commands listed above
  4. Yes, every line can be explained if asked

@dajneem23 dajneem23 changed the title feat(server): delete segments command for http feat(server) (WIP): delete segments command for http Feb 24, 2026
@dajneem23 dajneem23 marked this pull request as draft February 24, 2026 08:16
@dajneem23 dajneem23 changed the title feat(server) (WIP): delete segments command for http feat(server): delete segments command for http Feb 24, 2026
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.40%. Comparing base (28e7c04) to head (843a3e1).

Files with missing lines Patch % Lines
core/server/src/http/segments.rs 82.35% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2804      +/-   ##
============================================
- Coverage     68.44%   68.40%   -0.05%     
  Complexity      656      656              
============================================
  Files           852      853       +1     
  Lines         68196    68214      +18     
  Branches      59657    59685      +28     
============================================
- Hits          46679    46661      -18     
- Misses        19187    19209      +22     
- Partials       2330     2344      +14     
Flag Coverage Δ
csharp 67.06% <ø> (-0.21%) ⬇️
java 52.19% <ø> (ø)
rust 69.58% <83.33%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
core/server/src/http/http_server.rs 48.30% <100.00%> (+0.21%) ⬆️
core/server/src/shard/system/segments.rs 89.60% <ø> (ø)
core/server/src/http/segments.rs 82.35% <82.35%> (ø)

... and 16 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dajneem23 dajneem23 force-pushed the feature/2722-delete-segments-command-for-http branch from caec235 to 94b141b Compare February 24, 2026 08:33
@dajneem23 dajneem23 marked this pull request as ready for review February 24, 2026 08:41
@dajneem23 dajneem23 marked this pull request as draft February 24, 2026 08:53
@dajneem23 dajneem23 force-pushed the feature/2722-delete-segments-command-for-http branch from 94b141b to 4625029 Compare February 24, 2026 08:55
@dajneem23 dajneem23 marked this pull request as ready for review February 24, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement delete segments command for http

1 participant