Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Multiview request changes to support Couch3#502

Merged
ricellis merged 1 commit intomasterfrom
multiview-queries-couch3
Feb 18, 2020
Merged

Multiview request changes to support Couch3#502
ricellis merged 1 commit intomasterfrom
multiview-queries-couch3

Conversation

@ricellis
Copy link
Copy Markdown
Member

@ricellis ricellis commented Feb 17, 2020

Checklist

  • Tick to sign-off your agreement to the Developer Certificate of Origin (DCO) 1.1
  • Added tests for code changes or test/build only changes
  • Updated the change log file (CHANGES.md|CHANGELOG.md) or test/build only changes
  • Completed the PR template below:

Description

Updated view multi-query to work with CouchDB 3

For PRs without an associated issue and/or test/build issues

1. Steps to reproduce and the simplest code sample possible to demonstrate the issue

Run com.cloudant.tests.ViewsTest#multiRequest against CouchDB 3.

2. What you expected to happen

Test to pass.

3. What actually happened

Test fails because POST to {db}/_design/{ddoc}/_view/{viewname} with queries was deprecated since CouchDB 2.2 and is removed in CouchDB 3.

Approach

Replace POST of { "queries": [...]} body to {db}/_design/{ddoc}/_view/{viewname} with POST to {db}/_design/{ddoc}/_view/{viewname}/queries.
On badmatch failure fallback to original POST to maintain compatibility with CouchDB versions < 2.2.

Schema & API Changes

  • "No change"

Security and Privacy

  • "No change"

Testing

  • No new tests because existing tests cover this functionality and test matrix ensures coverage of new and old endpoints.

Monitoring and Logging

  • "No change"

@ricellis ricellis self-assigned this Feb 17, 2020
@ricellis ricellis added this to the 2.next milestone Feb 17, 2020
@ricellis ricellis force-pushed the multiview-queries-couch3 branch 3 times, most recently from 98725f7 to 89f4798 Compare February 18, 2020 09:43
@ricellis ricellis mentioned this pull request Feb 18, 2020
4 tasks
POST directly to the view was deprecated in CouchDB 2.2 and is now removed in Couch3.
Try POST to /queries first and if that fails, fallback to POST to the view.
@ricellis ricellis force-pushed the multiview-queries-couch3 branch from 89f4798 to 2294284 Compare February 18, 2020 13:06
@ricellis ricellis merged commit 5166646 into master Feb 18, 2020
@ricellis ricellis deleted the multiview-queries-couch3 branch February 18, 2020 13:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants