Skip to content

Conversation

@bbrks
Copy link
Member

@bbrks bbrks commented Aug 21, 2025

CBG-4776

This was already implemented, so this is a tiny clean-up exercise and ensuring there's general test coverage of CV in GETs via RestTester.GetDocVersion

The few test changes that had to be made were small corner-cases that only work in RevTree fetches - we don't take old revision backups in exactly the same way for CV so the test assumptions didn't hold up when using CV instead of RevTreeID.

Dependencies

Integration Tests

@bbrks bbrks requested a review from Copilot August 21, 2025 00:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables CV (Current Version) support in the REST API's GET document endpoints, extending the existing capability to fetch documents by both RevTree ID and CV values. The changes ensure that when users request a document with a CV parameter, the response includes appropriate CV-based ETags for optimistic concurrency control.

  • Updates GET document handlers to support CV values in the rev query parameter
  • Modifies ETag generation to return CV-based ETags when CV is requested
  • Updates OpenAPI documentation to reflect CV support in GET endpoints

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
rest/doc_api.go Core handler changes to support CV in GET requests and generate appropriate ETags
rest/utilities_testing_resttester.go Test utility updates to handle CV in document fetching and cleanup of deprecated methods
rest/attachment_test.go Test fixes to handle CV/RevTree ID differences in revision backup behavior
docs/api/paths/public/keyspace-docid.yaml Updated OpenAPI spec for ETag description to include CV
docs/api/components/parameters.yaml Updated parameter documentation to include CV support
db/crud.go Parameter naming cleanup and documentation update

torcolvin
torcolvin previously approved these changes Aug 21, 2025
@bbrks bbrks changed the title CBG-4751: Fetch by CV REST API CBG-4776: Fetch by CV REST API Aug 21, 2025
@bbrks bbrks marked this pull request as ready for review August 21, 2025 18:07
Base automatically changed from CBG-4751 to main August 21, 2025 19:18
@bbrks bbrks dismissed torcolvin’s stale review August 21, 2025 19:18

The base branch was changed.

…ter.GetDocVersion for general test coverage.
@github-actions
Copy link

github-actions bot commented Aug 21, 2025

Redocly previews

@torcolvin torcolvin merged commit 651e624 into main Aug 21, 2025
45 checks passed
@torcolvin torcolvin deleted the CBG-4776 branch August 21, 2025 20:24
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