nickva opened a new pull request #2128: Fix _scheduler/docs response for local 
replication endpoints
URL: https://github.com/apache/couchdb/pull/2128
 
 
   When the `_scheduler/docs` response is generated, the replication docs are
   parsed and credentials are stripped by `couch_replicator:strip_url_creds/1`.
   When local endpoint support was removed, that function didn't properly catch
   the parsing error for local endpoints and as a result was error-ing out the
   whole response.
   
   The fix is to catch the error and return the endpoint as is. The catch is
   specific to that error, so turned the long binary message into a shorter, but
   hopefully still obvious atom.
   
   `_scheduler/docs` response would look like:
   
   ```
   {
       "docs": [
           {
               "database": "_replicator",
               "doc_id": "r",
               "error_count": 1,
               "id": null,
               "info": "local_endpoints_not_supported",
               "last_updated": "2019-08-20T16:09:53Z",
               "source": "http://adm:*****@127.0.0.1:15984/s/";,
               "start_time": "2019-08-20T16:09:53Z",
               "state": "failed",
               "target": "t"
           }
       ],
       "offset": 0,
       "total_rows": 1
   }
   ```
   
   Interestingly, there was already a test for this case, except it wasn't
   included in the EUnit test suite list.
   
   <!-- Thank you for your contribution!
   
        Please file this form by replacing the Markdown comments
        with your text. If a section needs no action - remove it.
   
        Also remember, that CouchDB uses the Review-Then-Commit (RTC) model
        of code collaboration. Positive feedback is represented +1 from 
committers
        and negative is a -1. The -1 also means veto, and needs to be addressed
        to proceed. Once there are no objections, the PR can be merged by a
        CouchDB committer.
   
        See: http://couchdb.apache.org/bylaws.html#decisions for more info. -->
   
   ## Overview
   
   <!-- Please give a short brief for the pull request,
        what problem it solves or how it makes things better. -->
   
   ## Testing recommendations
   
   <!-- Describe how we can test your changes.
        Does it provides any behaviour that the end users
        could notice? -->
   
   ## Related Issues or Pull Requests
   
   <!-- If your changes affects multiple components in different
        repositories please put links to those issues or pull requests here.  
-->
   
   ## Checklist
   
   - [x] Code is written and works correctly
   - [x] Changes are covered by tests
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to