Skip to content

LCORE-4762: Remove v1/conversations endpoints - #3339

Merged
tisnik merged 1 commit into
lightspeed-core:mainfrom
asimurka:remove-v1/conversations
Nov 25, 2026
Merged

tisnik merged 1 commit into
lightspeed-core:mainfrom
asimurka:remove-v1/conversations

Conversation

@asimurka

@asimurka asimurka commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

Removes the deprecated /v1/conversations REST API from Lightspeed Core Stack.

  • Deletes conversations_v1 handler and unregisters its router.
  • Regenerates docs/devel_doc/openapi.json (v1 conversation paths and schemas removed).
  • Drops v1-focused unit and integration tests; updates compaction, RH identity, router, and OpenAPI integration tests for the v2 surface.
  • Adjusts tests/configuration/rh-identity-config.yaml so identity integration exercises GET /v2/conversations with conversation cache.

Clients: use /v2/conversations for list, get, update topic, and delete. V2 remains cache-backed; behavior for those endpoints is unchanged in this PR.

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library [pyproject.toml + uv.lock]
  • Bump-up dependent library [requirements.*.txt for Konflux]
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

  • Assisted-by: Cursor (Composer)
  • Generated by: N/A

Related Tickets & Documents

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  1. uv run make verify
  2. uv run pytest tests/unit/app/endpoints/test_conversations_v2.py
  3. uv run pytest tests/integration/test_rh_identity_integration.py (v2 list path)
  4. uv run pytest tests/integration/endpoints/test_compaction_conversations_api.py
  5. Confirm OpenAPI: no /v1/conversations routes in docs/devel_doc/openapi.json
  6. Optional e2e: features/conversation_cache_v2.feature (v1 conversations.feature may still target removed API—follow-up if CI runs it against this branch)

Summary by CodeRabbit

  • API Changes
    • Removed the deprecated v1 Conversations endpoints for listing, retrieving, deleting, and updating conversations. The v2 Conversations API remains available.
    • Updated the published API specification to no longer include the v1 endpoints or their associated schemas.
  • Tests
    • Updated integration checks to use the v2 Conversations API.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The PR removes the deprecated /v1/conversations routes and their OpenAPI declarations. It updates test configuration and coverage to use /v2/conversations, and removes tests and fixtures that referenced the v1 endpoints.

Changes

Conversation API retirement

Layer / File(s) Summary
Remove v1 routes and registration
src/app/endpoints/conversations_v1.py, src/app/routers.py, src/app/main.py
The v1 endpoint module, its /v1 router registration, and its OpenAPI tag are removed.
Remove v1 OpenAPI declarations
docs/devel_doc/openapi.json
The v1 conversation operations, ConversationDetails and ConversationsListResponse schemas, and conversations_v1 tag are removed.
Update v2 integration coverage
tests/configuration/rh-identity-config.yaml, tests/integration/endpoints/test_compaction_conversations_api.py, tests/integration/test_rh_identity_integration.py
Identity integration tests request /v2/conversations and require status 200. Compaction tests are narrowed to the v2 API, and the test configuration adds a SQLite conversation cache.
Remove v1 test references
tests/integration/conftest.py, tests/integration/endpoints/test_conversations_v1_integration.py, tests/integration/test_openapi_json.py, tests/unit/app/endpoints/test_conversations.py, tests/unit/app/test_routers.py, tests/unit/utils/test_pending_turn.py
V1 endpoint tests and OpenAPI checks are removed. Router tests and fixtures no longer reference the v1 endpoint. The router count expectation changes from 25 to 24.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Possibly related PRs

Suggested reviewers: tisnik, max-svistunov, anik120

Merge Risk: Minimal · up to 2fd94

The PR removes the deprecated /v1/conversations endpoints and moves test coverage to the unchanged /v2/conversations API. No concrete defect was found. The one remaining item is that optional end-to-end feature files may still reference the removed v1 routes, which is worth a quick check if CI runs them.

Pre-merge checks: Passed 6

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "LCORE-4762: Remove v1/conversations endpoints" matches the main change. The PR removes the deprecated /v1/conversations REST API, its handler module, router registration, OpenAPI paths and …
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.
Performance And Algorithmic Complexity Passed PR #3339 removes the deprecated /v1/conversations API. The diff is almost entirely deletions: src/app/endpoints/conversations_v1.py (-608), its router registration in src/app/routers.py (-2), th…
Security And Secret Handling Passed Security and Secret Handling check: PASS. PR #3339 (asimurka, remove-v1/conversations → main) is almost entirely deletions. It removes the v1 conversations handler (`src/app/endpoints/conversations_v1…
Full details: Title check

Explanation

The title "LCORE-4762: Remove v1/conversations endpoints" matches the main change. The PR removes the deprecated /v1/conversations REST API, its handler module, router registration, OpenAPI paths and schemas, and the v1-focused tests. The ticket prefix is extra context but does not hurt clarity.

Full details: Performance And Algorithmic Complexity

Explanation

PR #3339 removes the deprecated /v1/conversations API. The diff is almost entirely deletions: src/app/endpoints/conversations_v1.py (-608), its router registration in src/app/routers.py (-2), the OpenAPI tag in src/app/main.py (-7), and the v1 OpenAPI paths and schemas (-1104). The added lines are limited to test and configuration changes. The added source/test lines include a SQLite conversation_cache YAML block, a /v2/conversations status assertion, a router-count change from 25 to 24, and test docstrings. None adds a loop, nested iteration, per-item API or DB call, regex compilation, cache, buffer, list operation, or endpoint. Checked against the criteria: 1. O(n^2)+ algorithms: none added. 2. N+1 patterns: none added. The removed v1 list and get handlers are not replaced by new per-item queries. 3. Expensive work in loops: none added. 4. Unbounded growth: no new cache, watcher, or buffer. The SQLite conversation cache appears only in test config, with a /tmp path. 5. Missing pagination: no new List endpoint. The v2 list endpoint is unchanged. Any pagination gap there predates this PR. Removing an endpoint reduces the API surface. It does not add a performance regression. The check passes.

Full details: Security And Secret Handling

Explanation

Security and Secret Handling check: PASS. PR #3339 (asimurka, remove-v1/conversations → main) is almost entirely deletions. It removes the v1 conversations handler (src/app/endpoints/conversations_v1.py), its router mount under /v1, its OpenAPI tag, its OpenAPI paths and schemas, and the v1 tests. Checks against the five criteria: 1. Secrets: No hardcoded secrets or plaintext token logging in the added lines. The only addition is a test-config SQLite conversation_cache at /tmp/rh-identity-conversation-cache.db in tests/configuration/rh-identity-config.yaml. This is not a credential. 2. Auth/authz: The remaining /v2/conversations router mount (src/app/routers.py line 69) is unchanged. Removing the v1 endpoints drops routes rather than adding unauthenticated ones. No new endpoint is added. 3. Injection: No new query, command, or path handling is added. 4. Data leakage: No new response fields or log statements are added. The integration test changes only tighten expectations from 200 or 404 to 200. 5. K8s/RH secrets: No Kubernetes Secret or RH secret manifests are changed. Residual note: the features/conversations.feature e2e file may still target the removed v1 API (per the PR description). This is a functional follow-up, not a security violation in the changed code.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Simplify code

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 48c90df and 2fd94ac.

Files selected for processing: 13

  • docs/devel_doc/openapi.json
  • src/app/endpoints/conversations_v1.py
  • src/app/main.py
  • src/app/routers.py
  • tests/configuration/rh-identity-config.yaml
  • tests/integration/conftest.py
  • tests/integration/endpoints/test_compaction_conversations_api.py
  • tests/integration/endpoints/test_conversations_v1_integration.py
  • tests/integration/test_openapi_json.py
  • tests/integration/test_rh_identity_integration.py
  • tests/unit/app/endpoints/test_conversations.py
  • tests/unit/app/test_routers.py
  • tests/unit/utils/test_pending_turn.py
Files with no reviewable changes: 7

  • docs/devel_doc/openapi.json
  • src/app/endpoints/conversations_v1.py
  • src/app/main.py
  • src/app/routers.py
  • tests/integration/endpoints/test_conversations_v1_integration.py
  • tests/integration/test_openapi_json.py
  • tests/unit/app/endpoints/test_conversations.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 16

  • GitHub Check: E2E: ci / authorized
  • GitHub Check: E2E: ci / skills
  • GitHub Check: E2E: ci / mcp
  • GitHub Check: E2E: ci / other
  • GitHub Check: E2E: ci / rbac
  • GitHub Check: E2E: ci / shields
  • GitHub Check: E2E: ci / default
  • GitHub Check: Red Hat Konflux / lightspeed-core-0-8-enterprise-contract / lightspeed-stack-0-8
  • GitHub Check: Red Hat Konflux / rag-content-0-8-e2e-tests / lightspeed-stack-0-8
  • GitHub Check: Red Hat Konflux / lightspeed-stack-0-8-e2e-tests / lightspeed-stack-0-8
  • GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-8-on-pull-request
  • GitHub Check: integration_tests (3.14)
  • GitHub Check: integration_tests (3.13)
  • GitHub Check: Pylinter
  • GitHub Check: integration_tests (3.12)
  • GitHub Check: build-pr
Additional context used

Code guidelines: 2

AGENTS.md — auto-discovered
CLAUDE.md — auto-discovered
Path-based instructions: 6

Source excerpt: **Required**: Use pytest for all unit and integration tests Source excerpt: **Forbidden**: Do not use unittest - pytest is the standard for this project Source excerpt: **Coverage**: Unit tests require 60% coverage, integrat...

CodeRabbit inference engine (AGENTS.md)

Files:

  • tests/integration/conftest.py
  • tests/integration/endpoints/test_compaction_conversations_api.py
  • tests/integration/test_rh_identity_integration.py
  • tests/unit/app/test_routers.py
  • tests/unit/utils/test_pending_turn.py
Source excerpt: **Required**: Use pytest for all unit and integration tests Source excerpt: **Forbidden**: Do not use unittest - pytest is the standard for this project Source excerpt: **Mocking**: `pytest-mock` for AsyncMock objects

CodeRabbit inference engine (CLAUDE.md)

Files:

  • tests/integration/conftest.py
  • tests/integration/endpoints/test_compaction_conversations_api.py
  • tests/integration/test_rh_identity_integration.py
  • tests/unit/app/test_routers.py
  • tests/unit/utils/test_pending_turn.py
Source excerpt: **Coverage**: Unit tests require 60% coverage, integration 10%

CodeRabbit inference engine (CLAUDE.md)

Files:

  • tests/integration/conftest.py
  • tests/integration/endpoints/test_compaction_conversations_api.py
  • tests/integration/test_rh_identity_integration.py
Source excerpt: **Coverage**: Unit tests require 60% coverage, integration 10% Source excerpt: **Async tests**: Use marker `pytest.mark.asyncio`

CodeRabbit inference engine (CLAUDE.md)

Files:

  • tests/unit/app/test_routers.py
  • tests/unit/utils/test_pending_turn.py
Source excerpt: **Mocking**: `pytest-mock` for AsyncMock objects Source excerpt: **Async tests**: Use marker `pytest.mark.asyncio`

CodeRabbit inference engine (AGENTS.md)

Files:

  • tests/unit/app/test_routers.py
  • tests/unit/utils/test_pending_turn.py
Source excerpt: **Fixtures**: Use `conftest.py` for shared fixtures

CodeRabbit inference engine (CLAUDE.md)

Files:

  • tests/integration/conftest.py
Additional comments: 1

tests/integration/test_rh_identity_integration.py: 1

161-161: Stability & Availability

The stated premise is contradicted. The SQLite cache creates its tables when it is connected, and the v2 list handler triggers that connection before it queries the cache. Fresh-database requests in test_rh_identity_integration.py do not depend on application lifespan startup for schema creation.

@asimurka asimurka changed the title Remove v1/conversations endpoints LCORE-4762: Remove v1/conversations endpoints Nov 25, 2026
@asimurka
asimurka requested a review from tisnik November 25, 2026 13:32

@tisnik tisnik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tisnik
tisnik merged commit 9614d72 into lightspeed-core:main Nov 25, 2026
62 of 65 checks passed
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.

3 participants