dajneem23 opened a new pull request, #2804:
URL: https://github.com/apache/iggy/pull/2804

   ## 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?
   
   - Added server-side HTTP support for `delete_segments` in 
[`core/server/src/http/segments.rs`](./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`](./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`](./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`
   - 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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to