-
Notifications
You must be signed in to change notification settings - Fork 140
CBG-4776: Fetch by CV REST API #7694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
revquery 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 |
…ter.GetDocVersion for general test coverage.
Redocly previews |
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.GetDocVersionThe 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
GSI=true,xattrs=truehttps://jenkins.sgwdev.com/job/SyncGatewayIntegration/0000/