Skip to content

Check server API version and warn if it's too old#89

Merged
atimin merged 10 commits into
mainfrom
88-policy-for-supporting-deprecated-http-api-endpoints
May 15, 2025
Merged

Check server API version and warn if it's too old#89
atimin merged 10 commits into
mainfrom
88-policy-for-supporting-deprecated-http-api-endpoints

Conversation

@atimin
Copy link
Copy Markdown
Member

@atimin atimin commented May 13, 2025

Closes #88

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • CHANGELOG.md has been updated (for bug fixes / features / docs)

What kind of change does this PR introduce?

Feature

What was changed?

The PR adds a check for the version of the server API and compares it with the current version . If it's 3 minor versions older then the SDK prints warnings.

Related issues

(Add links to related issues)

Does this PR introduce a breaking change?

(What changes might users need to make in their application due to this PR?)

Other information:

@atimin atimin linked an issue May 13, 2025 that may be closed by this pull request
@atimin atimin marked this pull request as draft May 13, 2025 18:18
@atimin atimin changed the title 88 policy for supporting deprecated http api endpoints Check server API version and warn if it's too old May 15, 2025
@atimin atimin requested a review from Copilot May 15, 2025 08:44
@atimin atimin marked this pull request as ready for review May 15, 2025 08:45
Copy link
Copy Markdown
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 adds a check for the server API version and warns when the server is too far behind the SDK, while also updating tests and deprecation notices to reflect the newer API expectations. Key changes include:

  • Updating the test expectations and payload parameters for bucket record removal.
  • Enhancing the HTTP client to parse and validate the API version header.
  • Revising deprecation messages and removing legacy URL‐based query generation.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/reduct/entry_api_test.cc Adjusted test cases to match the new query payload and expected outcomes.
src/reduct/internal/http_client.{h,cc} Updated API version parsing and warning logic.
src/reduct/http_options.h Changed API prefix constant to constexpr.
src/reduct/client.h Updated deprecation messages with additional removal version notes.
src/reduct/bucket.{h,cc} Removed legacy URL query building and refined deprecation messages.
src/CMakeLists.txt & CMakeLists.txt Updated compile definitions and minimum CMake requirements.
README.md & CHANGELOG.md Updated documentation to reflect supported API versions and deprecations.
.github/workflows/ci.yml Adjusted CI workflow filters to accommodate the new API version tag.
Comments suppressed due to low confidence (1)

src/reduct/bucket.cc:241

  • The fallback branch for URL-based queries has been removed in favor of always using a JSON payload; please confirm that this design change is fully compatible with all expected server API versions.
auto [json_payload, json_err] = QueryOptionsToJsonString("REMOVE", start, stop, options);

Comment thread tests/reduct/entry_api_test.cc
Comment thread src/reduct/internal/http_client.cc
Comment thread src/reduct/bucket.h Outdated
Comment thread src/reduct/bucket.h Outdated
atimin and others added 2 commits May 15, 2025 10:49
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@atimin atimin merged commit 5dd741a into main May 15, 2025
2 checks passed
@atimin atimin deleted the 88-policy-for-supporting-deprecated-http-api-endpoints branch May 15, 2025 08:49
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.

Policy for supporting deprecated HTTP API endpoints

2 participants