[GitHub] garrensmith commented on a change in pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
garrensmith commented on a change in pull request #986: Refactor map/reduce 
views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#discussion_r142065605
 
 

 ##
 File path: app/addons/documents/index-results/api.js
 ##
 @@ -17,6 +17,41 @@ import Constants from '../constants';
 import FauxtonAPI from '../../../core/api';
 
 export const queryAllDocs = (fetchUrl, params) => {
+  // Exclude params 'group', 'reduce' and 'group_level' if present since they 
not allowed for '_all_docs'
+  params.group = undefined;
 
 Review comment:
   Would an object.assign work here? It might be a little neater:
   ```
   Object.assign(params, {group: undefined, reduce...})`
   ```
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] garrensmith commented on a change in pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
garrensmith commented on a change in pull request #986: Refactor map/reduce 
views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#discussion_r142067253
 
 

 ##
 File path: app/addons/documents/sidebar/SidebarControllerContainer.js
 ##
 @@ -0,0 +1,126 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy 
of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations 
under
+// the License.
+
+// import React from 'react';
+import { connect } from 'react-redux';
+import SidebarComponents from './sidebar';
+import ActionTypes from './actiontypes';
+// import IndexResults from '../components/results/IndexResults';
+// import { fetchDocs, bulkDeleteDocs } from '../actions/fetch';
+// import { queryOptionsToggleIncludeDocs } from '../actions/queryoptions';
+// import {
+//   selectDoc,
+//   changeLayout,
+//   bulkCheckOrUncheck,
+//   changeTableHeaderAttribute,
+//   resetState
+// } from '../actions/base';
+// import {
+//   getDocs,
+//   getSelectedDocs,
+//   getIsLoading,
+//   getHasResults,
+//   getDataForRendering,
+//   getIsEditable,
+//   getSelectedLayout,
+//   getAllDocsSelected,
+//   getHasDocsSelected,
+//   getNumDocsSelected,
+//   getTextEmptyIndex,
+//   getDocType,
+//   getFetchParams,
+//   getQueryOptionsParams
+// } from '../reducers';
+
+
+// const mapStateToProps = ({indexResults}, ownProps) => {
+//   return {
+// docs: getDocs(indexResults),
+// selectedDocs: getSelectedDocs(indexResults),
+// isLoading: getIsLoading(indexResults),
+// hasResults: getHasResults(indexResults),
+// results: getDataForRendering(indexResults, ownProps.databaseName, 
ownProps.deleteEnabled),
+// isEditable: getIsEditable(indexResults),
+// selectedLayout: getSelectedLayout(indexResults),
+// allDocumentsSelected: getAllDocsSelected(indexResults),
+// hasSelectedItem: getHasDocsSelected(indexResults),
+// numDocsSelected: getNumDocsSelected(indexResults),
+// textEmptyIndex: getTextEmptyIndex(indexResults),
+// docType: getDocType(indexResults),
+// fetchParams: getFetchParams(indexResults),
+// queryOptionsParams: getQueryOptionsParams(indexResults)
+//   };
+// };
+
+// const mapDispatchToProps = (dispatch, ownProps) => {
 
 Review comment:
   Can you remove these?
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] garrensmith commented on a change in pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
garrensmith commented on a change in pull request #986: Refactor map/reduce 
views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#discussion_r142064985
 
 

 ##
 File path: app/addons/documents/index-editor/components/DesignDocSelector.js
 ##
 @@ -0,0 +1,116 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy 
of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations 
under
+// the License.
+
+import React, { Component } from "react";
+import ReactDOM from "react-dom";
+import FauxtonAPI from "../../../../core/api";
+import ReactComponents from "../../../components/react-components";
+
+const StyledSelect = ReactComponents.StyledSelect;
+
+export default class DesignDocSelector extends Component {
+
+  constructor(props) {
+super(props);
+  }
+
+  validate() {
+if (this.props.selectedDesignDocName === 'new-doc' && 
this.props.newDesignDocName === '') {
+  FauxtonAPI.addNotification({
+msg: 'Please name your design doc.',
+type: 'error'
+  });
+  ReactDOM.findDOMNode(this.refs.newDesignDoc).focus();
+  return false;
+}
+return true;
+  }
+
+  getDocList() {
+return _.map(this.props.designDocList, function (designDoc) {
+  return ({designDoc});
+});
+  }
+
+  selectDesignDoc(e) {
+this.props.onSelectDesignDoc(e.target.value);
+  }
+
+  updateDesignDocName(e) {
+this.props.onChangeNewDesignDocName(e.target.value);
+  }
+
+  getNewDDocField() {
+if (this.props.selectedDesignDocName !== 'new-doc') {
+  return;
+}
+return (
+  
+_design/
+
+  

[GitHub] garrensmith commented on a change in pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
garrensmith commented on a change in pull request #986: Refactor map/reduce 
views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#discussion_r142064928
 
 

 ##
 File path: app/addons/documents/index-editor/components/DesignDocSelector.js
 ##
 @@ -0,0 +1,116 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy 
of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations 
under
+// the License.
+
+import React, { Component } from "react";
+import ReactDOM from "react-dom";
+import FauxtonAPI from "../../../../core/api";
+import ReactComponents from "../../../components/react-components";
+
+const StyledSelect = ReactComponents.StyledSelect;
+
+export default class DesignDocSelector extends Component {
+
+  constructor(props) {
+super(props);
+  }
+
+  validate() {
+if (this.props.selectedDesignDocName === 'new-doc' && 
this.props.newDesignDocName === '') {
+  FauxtonAPI.addNotification({
+msg: 'Please name your design doc.',
+type: 'error'
+  });
+  ReactDOM.findDOMNode(this.refs.newDesignDoc).focus();
+  return false;
+}
+return true;
+  }
+
+  getDocList() {
+return _.map(this.props.designDocList, function (designDoc) {
 
 Review comment:
   Can you change to `this.props.designDocList.map` with fat arrow
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] garrensmith commented on a change in pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
garrensmith commented on a change in pull request #986: Refactor map/reduce 
views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#discussion_r142064808
 
 

 ##
 File path: app/addons/documents/index-editor/components.js
 ##
 @@ -10,364 +10,15 @@
 // License for the specific language governing permissions and limitations 
under
 // the License.
 
-import app from "../../../app";
-import FauxtonAPI from "../../../core/api";
-import React from "react";
-import ReactDOM from "react-dom";
-import Stores from "./stores";
-import Actions from "./actions";
 import ReactComponents from "../../components/react-components";
+import DesignDocSelector from './components/DesignDocSelector';
+import IndexEditor from './components/IndexEditor';
+import ReduceEditor from './components/ReduceEditor';
 
-var store = Stores.indexEditorStore;
-var getDocUrl = app.helpers.getDocUrl;
-var StyledSelect = ReactComponents.StyledSelect;
-var CodeEditorPanel = ReactComponents.CodeEditorPanel;
-var ConfirmButton = ReactComponents.ConfirmButton;
-var LoadLines = ReactComponents.LoadLines;
-
-
-var DesignDocSelector = React.createClass({
-  propTypes: {
-designDocList: React.PropTypes.array.isRequired,
-onSelectDesignDoc: React.PropTypes.func.isRequired,
-onChangeNewDesignDocName: React.PropTypes.func.isRequired,
-selectedDesignDocName: React.PropTypes.string.isRequired,
-newDesignDocName: React.PropTypes.string.isRequired,
-designDocLabel: React.PropTypes.string,
-docURL: React.PropTypes.string
-  },
-
-  getDefaultProps: function () {
-return {
-  designDocLabel: 'Design Document'
-};
-  },
-
-  validate: function () {
-if (this.props.selectedDesignDocName === 'new-doc' && 
this.props.newDesignDocName === '') {
-  FauxtonAPI.addNotification({
-msg: 'Please name your design doc.',
-type: 'error'
-  });
-  ReactDOM.findDOMNode(this.refs.newDesignDoc).focus();
-  return false;
-}
-return true;
-  },
-
-  getDocList: function () {
-return _.map(this.props.designDocList, function (designDoc) {
-  return ({designDoc});
-});
-  },
-
-  selectDesignDoc: function (e) {
-this.props.onSelectDesignDoc(e.target.value);
-  },
-
-  updateDesignDocName: function (e) {
-this.props.onChangeNewDesignDocName(e.target.value);
-  },
-
-  getNewDDocField: function () {
-if (this.props.selectedDesignDocName !== 'new-doc') {
-  return;
-}
-return (
-  
-_design/
-
-  
-
-  
-);
-  },
-
-  getDocLink: function () {
-if (!this.props.docLink) {
-  return null;
-}
-return (
-  
-
-  
-);
-  },
-
-  render: function () {
-const selectContent =
-  
-New document
-{this.getDocList()}
-  ;
-
-return (
-  
-
-  {this.props.designDocLabel}
-{this.getDocLink()}
-  
-  
-
-{this.getNewDDocField()}
-  
-);
-  }
-});
-
-
-var ReduceEditor = React.createClass({
-
-  getStoreState: function () {
-return {
-  reduce: store.getReduce(),
-  reduceOptions: store.reduceOptions(),
-  reduceSelectedOption: store.reduceSelectedOption(),
-  hasCustomReduce: store.hasCustomReduce(),
-  hasReduce: store.hasReduce()
-};
-  },
-
-  getInitialState: function () {
-return this.getStoreState();
-  },
-
-  getOptionsList: function () {
-return _.map(this.state.reduceOptions, function (reduce, i) {
-  return {reduce};
-}, this);
-  },
-
-  getReduceValue: function () {
-if (!this.state.hasReduce) {
-  return null;
-}
-
-if (!this.state.hasCustomReduce) {
-  return this.state.reduce;
-}
-
-return this.refs.reduceEditor.getValue();
-  },
-
-  getEditor: function () {
-return this.refs.reduceEditor.getEditor();
-  },
-
-  render: function () {
-var reduceOptions = this.getOptionsList(),
-customReduceSection;
-
-if (this.state.hasCustomReduce) {
-  customReduceSection = ;
-}
-
-return (
-  
-
-  
-Reduce (optional)
-
-  
-
-  
-  
-
-
-{customReduceSection}
-  
-);
-  },
-
-  updateReduceCode: function (code) {
-Actions.updateReduceCode(code);
-  },
-
-  selectChange: function (event) {
-Actions.selectReduceChanged(event.target.value);
-  },
-
-  onChange: function () {
-this.setState(this.getStoreState());
-  },
-
-  componentDidMount: function () {
-store.on('change', this.onChange, this);
-  },
-
-  componentWillUnmount: function () {
-store.off('change', this.onChange);
-  }
-});
-
-
-var EditorController = React.createClass({
-
-  getStoreState: function () {
-return {
-  database: store.getDatabase(),
-  isNewView: store.isNewView(),
-  viewName: store.getViewName(),
-  designDocs: store.getDesignDocs(),
- 

[GitHub] garrensmith commented on a change in pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
garrensmith commented on a change in pull request #986: Refactor map/reduce 
views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#discussion_r142065141
 
 

 ##
 File path: app/addons/documents/index-editor/components/IndexEditor.js
 ##
 @@ -0,0 +1,170 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy 
of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations 
under
+// the License.
+
+import React, { Component } from "react";
+import ReactDOM from "react-dom";
+import app from "../../../../app";
+import FauxtonAPI from "../../../../core/api";
+import ReactComponents from "../../../components/react-components";
+import Stores from "../stores";
+import Actions from "../actions";
+import DesignDocSelector from './DesignDocSelector';
+import ReduceEditor from './ReduceEditor';
+
+const getDocUrl = app.helpers.getDocUrl;
+const CodeEditorPanel = ReactComponents.CodeEditorPanel;
 
 Review comment:
   Could you change this to:
   ` const {CodeEditorPanel, ConfirmButton, ... } = ReactComponents`
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] garrensmith commented on a change in pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
garrensmith commented on a change in pull request #986: Refactor map/reduce 
views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#discussion_r142065354
 
 

 ##
 File path: app/addons/documents/index-editor/components/IndexEditor.js
 ##
 @@ -0,0 +1,170 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy 
of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations 
under
+// the License.
+
+import React, { Component } from "react";
+import ReactDOM from "react-dom";
+import app from "../../../../app";
+import FauxtonAPI from "../../../../core/api";
+import ReactComponents from "../../../components/react-components";
+import Stores from "../stores";
+import Actions from "../actions";
+import DesignDocSelector from './DesignDocSelector';
+import ReduceEditor from './ReduceEditor';
+
+const getDocUrl = app.helpers.getDocUrl;
+const CodeEditorPanel = ReactComponents.CodeEditorPanel;
+const store = Stores.indexEditorStore;
+const ConfirmButton = ReactComponents.ConfirmButton;
+const LoadLines = ReactComponents.LoadLines;
+
+export default class IndexEditor extends Component {
+
+  constructor(props) {
+super(props);
+this.state = this.getStoreState();
+  }
+
+  getStoreState() {
+return {
+  database: store.getDatabase(),
+  isNewView: store.isNewView(),
+  viewName: store.getViewName(),
+  designDocs: store.getDesignDocs(),
+  designDocList: store.getAvailableDesignDocs(),
+  originalViewName: store.getOriginalViewName(),
+  originalDesignDocName: store.getOriginalDesignDocName(),
+  newDesignDoc: store.isNewDesignDoc(),
+  designDocId: store.getDesignDocId(),
+  newDesignDocName: store.getNewDesignDocName(),
+  saveDesignDoc: store.getSaveDesignDoc(),
+  map: store.getMap(),
+  isLoading: store.isLoading()
+};
+  }
+
+  onChange() {
+this.setState(this.getStoreState());
+  }
+
+  componentDidMount() {
+store.on('change', this.onChange, this);
+  }
+
+  componentWillUnmount() {
+store.off('change', this.onChange);
+  }
+
+  // the code editor is a standalone component, so if the user goes from one 
edit view page to another, we need to
+  // force an update of the editor panel
+  componentDidUpdate(prevProps, prevState) {
+if (this.state.map !== prevState.map && this.refs.mapEditor) {
+  this.refs.mapEditor.update();
+}
+  }
+
+  saveView(el) {
+el.preventDefault();
+
+if (!this.refs.designDocSelector.validate()) {
+  return;
+}
+
+Actions.saveView({
+  database: this.state.database,
+  newView: this.state.isNewView,
+  viewName: this.state.viewName,
+  designDoc: this.state.saveDesignDoc,
+  designDocId: this.state.designDocId,
+  newDesignDoc: this.state.newDesignDoc,
+  originalViewName: this.state.originalViewName,
+  originalDesignDocName: this.state.originalDesignDocName,
+  map: this.refs.mapEditor.getValue(),
+  reduce: this.refs.reduceEditor.getReduceValue(),
+  designDocs: this.state.designDocs
+});
+  }
+
+  viewChange(el) {
+Actions.changeViewName(el.target.value);
+  }
+
+  updateMapCode(code) {
+Actions.updateMapCode(code);
+  }
+
+  render() {
+if (this.state.isLoading) {
+  return (
+
+  
+
+  );
+}
+
+var pageHeader = (this.state.isNewView) ? 'New View' : 'Edit View';
+var btnLabel = (this.state.isNewView) ? 'Create Document and then Build 
Index' : 'Save Document and then Build Index';
+
+var cancelLink = '#' + FauxtonAPI.urls('view', 'showView', 
this.state.database.id, this.state.designDocId, this.state.viewName);
+return (
+  
+
+  {pageHeader}
+
+  
+
+  
+
+  
+
+  Index name
+  
+
+  
+
+
+  
+  
+  
 
 Review comment:
   can you change to callback ref
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] garrensmith commented on a change in pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
garrensmith commented on a change in pull request #986: Refactor map/reduce 
views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#discussion_r142065307
 
 

 ##
 File path: app/addons/documents/index-editor/components/IndexEditor.js
 ##
 @@ -0,0 +1,170 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy 
of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations 
under
+// the License.
+
+import React, { Component } from "react";
+import ReactDOM from "react-dom";
+import app from "../../../../app";
+import FauxtonAPI from "../../../../core/api";
+import ReactComponents from "../../../components/react-components";
+import Stores from "../stores";
+import Actions from "../actions";
+import DesignDocSelector from './DesignDocSelector';
+import ReduceEditor from './ReduceEditor';
+
+const getDocUrl = app.helpers.getDocUrl;
+const CodeEditorPanel = ReactComponents.CodeEditorPanel;
+const store = Stores.indexEditorStore;
+const ConfirmButton = ReactComponents.ConfirmButton;
+const LoadLines = ReactComponents.LoadLines;
+
+export default class IndexEditor extends Component {
+
+  constructor(props) {
+super(props);
+this.state = this.getStoreState();
+  }
+
+  getStoreState() {
+return {
+  database: store.getDatabase(),
+  isNewView: store.isNewView(),
+  viewName: store.getViewName(),
+  designDocs: store.getDesignDocs(),
+  designDocList: store.getAvailableDesignDocs(),
+  originalViewName: store.getOriginalViewName(),
+  originalDesignDocName: store.getOriginalDesignDocName(),
+  newDesignDoc: store.isNewDesignDoc(),
+  designDocId: store.getDesignDocId(),
+  newDesignDocName: store.getNewDesignDocName(),
+  saveDesignDoc: store.getSaveDesignDoc(),
+  map: store.getMap(),
+  isLoading: store.isLoading()
+};
+  }
+
+  onChange() {
+this.setState(this.getStoreState());
+  }
+
+  componentDidMount() {
+store.on('change', this.onChange, this);
+  }
+
+  componentWillUnmount() {
+store.off('change', this.onChange);
+  }
+
+  // the code editor is a standalone component, so if the user goes from one 
edit view page to another, we need to
+  // force an update of the editor panel
+  componentDidUpdate(prevProps, prevState) {
+if (this.state.map !== prevState.map && this.refs.mapEditor) {
+  this.refs.mapEditor.update();
+}
+  }
+
+  saveView(el) {
+el.preventDefault();
+
+if (!this.refs.designDocSelector.validate()) {
+  return;
+}
+
+Actions.saveView({
+  database: this.state.database,
+  newView: this.state.isNewView,
+  viewName: this.state.viewName,
+  designDoc: this.state.saveDesignDoc,
+  designDocId: this.state.designDocId,
+  newDesignDoc: this.state.newDesignDoc,
+  originalViewName: this.state.originalViewName,
+  originalDesignDocName: this.state.originalDesignDocName,
+  map: this.refs.mapEditor.getValue(),
+  reduce: this.refs.reduceEditor.getReduceValue(),
+  designDocs: this.state.designDocs
+});
+  }
+
+  viewChange(el) {
+Actions.changeViewName(el.target.value);
+  }
+
+  updateMapCode(code) {
+Actions.updateMapCode(code);
+  }
+
+  render() {
+if (this.state.isLoading) {
+  return (
+
+  
+
+  );
+}
+
+var pageHeader = (this.state.isNewView) ? 'New View' : 'Edit View';
 
 Review comment:
   Can you make these all `const`
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] garrensmith commented on a change in pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
garrensmith commented on a change in pull request #986: Refactor map/reduce 
views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#discussion_r142065413
 
 

 ##
 File path: app/addons/documents/index-editor/components/ReduceEditor.js
 ##
 @@ -0,0 +1,124 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy 
of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations 
under
+// the License.
+
+import React, { Component } from "react";
+import ReactDOM from "react-dom";
+import app from "../../../../app";
+import ReactComponents from "../../../components/react-components";
+import Stores from "../stores";
+import Actions from "../actions";
+
+const getDocUrl = app.helpers.getDocUrl;
+const StyledSelect = ReactComponents.StyledSelect;
 
 Review comment:
   can you change to `{StyledSelect ...} = ReactComponents`
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] garrensmith commented on a change in pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
garrensmith commented on a change in pull request #986: Refactor map/reduce 
views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#discussion_r142067322
 
 

 ##
 File path: app/addons/documents/tests/document-test-helper.js
 ##
 @@ -26,15 +26,6 @@ function createDocColumn (docs) {
   return new Documents.AllDocs(docs, opts);
 }
 
-function createMangoIndexDocColumn (docs) {
-  docs = docs.map(function (doc) {
-return Documents.MangoIndex.prototype.parse(doc);
-  });
-
-  return new Documents.MangoIndexCollection(docs, opts);
-}
-
 export default {
-  createDocColumn: createDocColumn,
-  createMangoIndexDocColumn: createMangoIndexDocColumn
+  createDocColumn: createDocColumn
 
 Review comment:
   Could you make this:
   
   ```
   export default {
  createDocColumn
   }
   ```
   
   Why repeat ourselves when we don't have too ? 
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] garrensmith commented on a change in pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
garrensmith commented on a change in pull request #986: Refactor map/reduce 
views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#discussion_r142065276
 
 

 ##
 File path: app/addons/documents/index-editor/components/IndexEditor.js
 ##
 @@ -0,0 +1,170 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy 
of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations 
under
+// the License.
+
+import React, { Component } from "react";
+import ReactDOM from "react-dom";
+import app from "../../../../app";
+import FauxtonAPI from "../../../../core/api";
+import ReactComponents from "../../../components/react-components";
+import Stores from "../stores";
+import Actions from "../actions";
+import DesignDocSelector from './DesignDocSelector';
+import ReduceEditor from './ReduceEditor';
+
+const getDocUrl = app.helpers.getDocUrl;
+const CodeEditorPanel = ReactComponents.CodeEditorPanel;
+const store = Stores.indexEditorStore;
+const ConfirmButton = ReactComponents.ConfirmButton;
+const LoadLines = ReactComponents.LoadLines;
+
+export default class IndexEditor extends Component {
+
+  constructor(props) {
+super(props);
+this.state = this.getStoreState();
+  }
+
+  getStoreState() {
+return {
+  database: store.getDatabase(),
+  isNewView: store.isNewView(),
+  viewName: store.getViewName(),
+  designDocs: store.getDesignDocs(),
+  designDocList: store.getAvailableDesignDocs(),
+  originalViewName: store.getOriginalViewName(),
+  originalDesignDocName: store.getOriginalDesignDocName(),
+  newDesignDoc: store.isNewDesignDoc(),
+  designDocId: store.getDesignDocId(),
+  newDesignDocName: store.getNewDesignDocName(),
+  saveDesignDoc: store.getSaveDesignDoc(),
+  map: store.getMap(),
+  isLoading: store.isLoading()
+};
+  }
+
+  onChange() {
+this.setState(this.getStoreState());
+  }
+
+  componentDidMount() {
+store.on('change', this.onChange, this);
+  }
+
+  componentWillUnmount() {
+store.off('change', this.onChange);
+  }
+
+  // the code editor is a standalone component, so if the user goes from one 
edit view page to another, we need to
+  // force an update of the editor panel
+  componentDidUpdate(prevProps, prevState) {
+if (this.state.map !== prevState.map && this.refs.mapEditor) {
+  this.refs.mapEditor.update();
+}
+  }
+
+  saveView(el) {
+el.preventDefault();
+
+if (!this.refs.designDocSelector.validate()) {
+  return;
+}
+
+Actions.saveView({
+  database: this.state.database,
+  newView: this.state.isNewView,
+  viewName: this.state.viewName,
+  designDoc: this.state.saveDesignDoc,
+  designDocId: this.state.designDocId,
+  newDesignDoc: this.state.newDesignDoc,
+  originalViewName: this.state.originalViewName,
+  originalDesignDocName: this.state.originalDesignDocName,
+  map: this.refs.mapEditor.getValue(),
+  reduce: this.refs.reduceEditor.getReduceValue(),
+  designDocs: this.state.designDocs
+});
+  }
+
+  viewChange(el) {
+Actions.changeViewName(el.target.value);
+  }
+
+  updateMapCode(code) {
+Actions.updateMapCode(code);
+  }
+
+  render() {
+if (this.state.isLoading) {
+  return (
+
+  
+
+  );
+}
+
+var pageHeader = (this.state.isNewView) ? 'New View' : 'Edit View';
+var btnLabel = (this.state.isNewView) ? 'Create Document and then Build 
Index' : 'Save Document and then Build Index';
+
+var cancelLink = '#' + FauxtonAPI.urls('view', 'showView', 
this.state.database.id, this.state.designDocId, this.state.viewName);
+return (
+  
+
+  {pageHeader}
+
+  
+

[GitHub] garrensmith closed issue #977: While viewing a document, changing the url and hitting enter doesn't change the document editor contents

2017-10-02 Thread git
garrensmith closed issue #977: While viewing a document, changing the url and 
hitting enter doesn't change the document editor contents
URL: https://github.com/apache/couchdb-fauxton/issues/977
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] garrensmith closed pull request #987: Update code editor's contents when a new document is loaded

2017-10-02 Thread git
garrensmith closed pull request #987: Update code editor's contents when a new 
document is loaded
URL: https://github.com/apache/couchdb-fauxton/pull/987
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] natcohen opened a new issue #857: Fuzzy, aggregation and other cool query functions

2017-10-02 Thread git
natcohen opened a new issue #857: Fuzzy, aggregation and other cool query 
functions
URL: https://github.com/apache/couchdb/issues/857
 
 
   Databases are not only used to store data, they are used to query it very 
quickly. IMHO one of the weakest point of CouchDB vs MongoDB (even though they 
have different functions) is querying. Is there a plan in order to catch up 
with MongoDB large set of query functions 
(https://docs.mongodb.com/manual/reference/operator/query/)? Such as fuzzy or 
aggregation?
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] calonso commented on issue #823: Healthcheck endpoint authentication should be optional

2017-10-02 Thread git
calonso commented on issue #823: Healthcheck endpoint authentication should be 
optional
URL: https://github.com/apache/couchdb/issues/823#issuecomment-333489119
 
 
   Amazing, thanks!!
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] garrensmith opened a new pull request #988: Basic upgrades in preparation for React 16

2017-10-02 Thread git
garrensmith opened a new pull request #988: Basic upgrades in preparation for 
React 16
URL: https://github.com/apache/couchdb-fauxton/pull/988
 
 
   Some smaller library changes so that we can start preparing to move to React 
16.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (COUCHDB-3338) rexi_server timeout

2017-10-02 Thread Wilhelm Uschtrin (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-3338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16187894#comment-16187894
 ] 

Wilhelm Uschtrin commented on COUCHDB-3338:
---

[~tiago.pereira] Did you ever solve this?

> rexi_server timeout
> ---
>
> Key: COUCHDB-3338
> URL: https://issues.apache.org/jira/browse/COUCHDB-3338
> Project: CouchDB
>  Issue Type: Bug
>  Components: Database Core, JavaScript View Server, Replication
>Reporter: Tiago Pereira
>
> Hi,
> I've recently went to production with a CouchDB 2 instance, however I'm 
> experiencing some severe issues that started appearing when I had an increase 
> in usage that are causing my database to slow down, stop indexing / returning 
> my views, and ultimately crash because it is consuming too much memory 
> (Usually when the instance is fresh started it runs at ~300MBs RAM, and after 
> a few hours it jumps to almost 3GB RAM usage, which is when it crashes 
> because the system runs OOM).
> I'm running my CouchDB instance on a kubernetes cluster hosted on Google 
> Cloud, and I'm using klaemo/couchdb2 's latest 2.0.0 image as a base Docker 
> image.
> This instance currently has 792 active, continuous replications running, 
> which I assume might be what is causing this slow down, since I tried 
> disabling them and, after a reboot, the database appeared to be running fine 
> without the replications.
> When I consult the logs, I get a lot of these errors messages which I' 
> assuming might be the culprit:
> ```
> [error] 2017-03-23T09:55:06.804700Z nonode@nohost <0.14942.246> 6388d61064 
> rexi_server 
> exit:{timeout,{gen_server,call,[couch_server,{open,<<"shards/-1fff/db_name.1478875836">>,[{timeout,100},{user_ctx,{user_ctx,<<"replications">>,[<<"services_replicator">>,<<"b
> udgets_replicator">>,<<"tasks_replicator">>,<<"comments_replicator">>],<<"default">>}}]},100]}}
>  
> [{gen_server,call,3,[{file,"gen_server.erl"},{line,190}]},{couch_server,open,2,[{file,"src/couch_server.erl"},{line,86}]},{couch_db,open,2,[{file,"src/couch_db.erl"},{line,91}]},
> {fabric_rpc,open_shard,2,[{file,"src/fabric_rpc.erl"},{line,248}]},{rexi_server,init_p,3,[{file,"src/rexi_server.erl"},{line,139}]}]
> [error] 2017-03-23T09:55:06.834468Z nonode@nohost <0.28090.247> 6aa0e19144 
> rexi_server 
> exit:{timeout,{gen_server,call,[couch_server,{open,<<"shards/2000-3fff/db_name">>,[{timeout,200},{user_ctx,{user_ctx,<<"replications">>,[<<"services_repl
> icator">>,<<"budgets_replicator">>,<<"tasks_replicator">>,<<"comments_replicator">>],<<"default">>}}]},200]}}
>  
> [{gen_server,call,3,[{file,"gen_server.erl"},{line,190}]},{couch_server,open,2,[{file,"src/couch_server.erl"},{line,86}]},{couch_db,open,2,[{file,"src/couch_db.erl"
> },{line,91}]},{fabric_rpc,open_shard,2,[{file,"src/fabric_rpc.erl"},{line,248}]},{rexi_server,init_p,3,[{file,"src/rexi_server.erl"},{line,139}]}]
> [error] 2017-03-23T09:55:06.834516Z nonode@nohost <0.1093.212> 1c317bf387 
> rexi_server 
> exit:{timeout,{gen_server,call,[couch_server,{open,<<"shards/2000-3fff/db_name">>,[{timeout,200},{user_ctx,{user_ctx,<<"replications">>,[<<"services_repli
> cator">>,<<"budgets_replicator">>,<<"tasks_replicator">>,<<"comments_replicator">>],<<"default">>}}]},200]}}
>  
> [{gen_server,call,3,[{file,"gen_server.erl"},{line,190}]},{couch_server,open,2,[{file,"src/couch_server.erl"},{line,86}]},{couch_db,open,2,[{file,"src/couch_db.erl"}
> ,{line,91}]},{fabric_rpc,open_shard,2,[{file,"src/fabric_rpc.erl"},{line,248}]},{rexi_server,init_p,3,[{file,"src/rexi_server.erl"},{line,139}]}]
> ```
> Could I have some help with this issue? I'm not sure if this might be an 
> actual memory leak, or if, for the number of replications I currently have, I 
> should be expected to actually have a node with more RAM in order to process 
> all the live replications.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] GeorgeAppleton commented on issue #776: Error status zero, Index shutdown by monitor notice for db

2017-10-02 Thread git
GeorgeAppleton commented on issue #776: Error status zero, Index shutdown by 
monitor notice for db
URL: https://github.com/apache/couchdb/issues/776#issuecomment-333525878
 
 
   Hi wohali,
   
   > Root cause that replication fails is that you can't access CouchDB from 
off-machine. 
   
   That was the whole problem
   
   Yeah I know about the security risk for 5986 being bound to 0.0.0.0, I was 
just trying stuff out. The config error never got fixed, no idea what the 
problem was or is. Doesn't matter now anyway since I have the production 
database up and working just fine so I'm using that for testing until launch. 
This issue already gave me enough headaches and it was likely just something 
wrong with my machines config since other couchdb setups I've done work just 
fine.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] GeorgeAppleton closed issue #776: Error status zero, Index shutdown by monitor notice for db

2017-10-02 Thread git
GeorgeAppleton closed issue #776: Error status zero, Index shutdown by monitor 
notice for db
URL: https://github.com/apache/couchdb/issues/776
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao commented on issue #988: Basic upgrades in preparation for React 16

2017-10-02 Thread git
Antonio-Maranhao commented on issue #988: Basic upgrades in preparation for 
React 16
URL: https://github.com/apache/couchdb-fauxton/pull/988#issuecomment-333552843
 
 
   +1 @garrensmith 
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wohali commented on issue #857: Fuzzy, aggregation and other cool query functions

2017-10-02 Thread git
wohali commented on issue #857: Fuzzy, aggregation and other cool query 
functions
URL: https://github.com/apache/couchdb/issues/857#issuecomment-333562139
 
 
   This is a really broad request for a single "bug" report. We can't provide 
any meaningful response here.
   
   If you're looking to have a discussion with the developers on this point, 
please bring it to our mailing list, `u...@couchdb.apache.org`.
   
   New options available right now include rich querying using full-text search 
(Lucene query style) via the clouseau/dreyfus addons, and geospatial sesarch 
via the hastings addon. Lots of people are able to get the rich querying they 
need from these.
   
   If you're specifically asking about Mango, we explain in our documentation:
   
   >The general API exposes a set of actions that are similar to what MongoDB 
exposes (although not all of MongoDB's API is supported). These are meant to be 
loosely and obviously inspired by MongoDB but without too much attention to 
maintaining the exact behavior.
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wohali closed issue #857: Fuzzy, aggregation and other cool query functions

2017-10-02 Thread git
wohali closed issue #857: Fuzzy, aggregation and other cool query functions
URL: https://github.com/apache/couchdb/issues/857
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] garrensmith closed pull request #988: Basic upgrades in preparation for React 16

2017-10-02 Thread git
garrensmith closed pull request #988: Basic upgrades in preparation for React 16
URL: https://github.com/apache/couchdb-fauxton/pull/988
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wohali commented on issue #856: Bypass authentication check for /_up

2017-10-02 Thread git
wohali commented on issue #856: Bypass authentication check for /_up
URL: https://github.com/apache/couchdb/pull/856#issuecomment-333575446
 
 
   from IRC:
   
   ```irc
   11:41 <+rnewson> hm, yes, I see your point.
   11:41 <+Wohali> if i don't punch a hole through
   couch_httpd_auth:default_authentication_handler, there's no 
way
   to actually get to chttpd_auth_request
   11:41 <+Wohali> and chttpd_auth_request already has the right settings for 
_up
   11:42 <+rnewson> well, that hole won't be sufficient but I understand
   11:42 <+rnewson> a request with a cookie would not go through there (etc)
   11:43 <+Wohali> yeah
   11:43 <+Wohali> but the assumption is this is just for healthcheck services
   that won't supply any creds
   11:44 <+rnewson> yes, understood.
   11:44 <+rnewson> but require_valid_user=true is defined as requiring
authentication for every request (even _session, which is at
least as silly as _up)
   11:44 <+Wohali> i guess i could add an entirely new {couch_httpd_auth,
   massive_security_hole_authentication_handler}
   11:44 <+rnewson> so we'd need another config to punch a hole in that, rather
than change what require_valid_user=true means.
   11:45 <+rnewson> so long as there's a config setting (default to current
behaviour) I'm ok with the proposed change (though not
necessarily the impl)
   11:45 <+Wohali> ok, will look at later
   ```
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wohali opened a new issue #858: Cannot change shard map for system databases

2017-10-02 Thread git
wohali opened a new issue #858: Cannot change shard map for system databases
URL: https://github.com/apache/couchdb/issues/858
 
 
   Ported over from 
[COUCHDB-3221](https://issues.apache.org/jira/browse/COUCHDB-3221)
   
   ## Expected Behaviour
   Should be able to update the shard map for `_users`, `_dbs`, `_replicator`, 
`_global_changes` databases
   
   ## Current Behaviour
   `{"error":"bad_request","reason":"Only reserved document ids may start with 
underscore."}`
   
   ## Possible Solution
   Specifically whitelist these as database names internally, possibly via a 
config setting
   
   ## Context
   Unable to replace or add nodes to a cluster, then adjust the shard map for 
these 4 system databases as well.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Closed] (COUCHDB-3221) Shard maps for reserved database names cannot be updated

2017-10-02 Thread Joan Touzet (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-3221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joan Touzet closed COUCHDB-3221.

Resolution: Auto Closed

Migrated to https://github.com/apache/couchdb/issues/858

> Shard maps for reserved database names cannot be updated
> 
>
> Key: COUCHDB-3221
> URL: https://issues.apache.org/jira/browse/COUCHDB-3221
> Project: CouchDB
>  Issue Type: Bug
>  Components: Database Core
>Affects Versions: 2.0.0
>Reporter: Simon Keary
>
> I'm still seeing the same problem as described in COUCHDB-2424 with CouchDB 
> 2.0.0 (Ubuntu) but it doesn't appear that I can reopen that issue.
> What I'm trying to do trying to get a newly added cluster node to participate 
> in all the databases already created in the cluster so that I can then remove 
> an existing node and replace it with the new one. The workflow I have is:
> * Add the new node to the cluster using the _nodes endpoint. This works.
> * For each database edit the shard metadata document (e.g. _db/db_name) and 
> add all shards to the new node.
> This appears to work for all databases except the system databases. 
> Essentially this means that you can't move the shards for these database off 
> a node in order to retire that node.
> An easy way to reproduce the issue is to open 
> http://localhost:5986/_utils/#/database/_dbs/_metadata and then click "Save 
> Changes" in Fauxton. The error "Save failed: Only reserved document ids may 
> start with underscore." is displayed. Doing the same process for a user 
> database works fine. Similarly, editing the document via curl also fails with 
> the same error.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] wohali commented on issue #858: Cannot change shard map for system databases

2017-10-02 Thread git
wohali commented on issue #858: Cannot change shard map for system databases
URL: https://github.com/apache/couchdb/issues/858#issuecomment-333579565
 
 
   Original context:
   
   > I'm still seeing the same problem as described in COUCHDB-2424 with 
CouchDB 2.0.0 (Ubuntu) but it doesn't appear that I can reopen that issue.
   >
   > What I'm trying to do trying to get a newly added cluster node to 
participate in all the databases already created in the cluster so that I can 
then remove an existing node and replace it with the new one. The workflow I 
have is:
   >
   > -Add the new node to the cluster using the _nodes endpoint. This works.
   > -For each database edit the shard metadata document (e.g. _db/db_name) 
and add all shards to the new node.
   > 
   > This appears to work for all databases except the system databases. 
Essentially this means that you can't move the shards for these database off a 
node in order to retire that node.
   > 
   > An easy way to reproduce the issue is to open 
http://localhost:5986/_utils/#/database/_dbs/_metadata and then click "Save 
Changes" in Fauxton. The error "Save failed: Only reserved document ids may 
start with underscore." is displayed. Doing the same process for a user 
database works fine. Similarly, editing the document via curl also fails with 
the same error.
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] uschtwill opened a new issue #859: Various error messages and breakage

2017-10-02 Thread git
uschtwill opened a new issue #859: Various error messages and breakage
URL: https://github.com/apache/couchdb/issues/859
 
 
   I do realise this is (probably) not a bug report, but I had to write down 
all of this somewhere, right?
   
   And I feel like it would be nice to document the explanations for the 
various error messages and their root cause(s) somewhere (that someone 
hopefully will be able to provide), so other people who might be getting these 
errors in the future may then have more to go by then I do now.
   
   Please let me know if I can be more precise, add additional information or 
do anything else to improve this inquiry.
   
   ## Context
   We are using CouchDB to store documents which are read out with Logstash and 
its [couchdb_changes 
plugin](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-couchdb_changes.html),
 which then modifies it and pushes it downstream for further processing. 
   
   We have 3 single node instances, which all exhibit the behaviour described 
below: prod and staging are holding around 10M documents, and a dev instance 
just a couple of thousands. All instances are running as Docker containers on a 
single Dockerhost which is also running a lot of other containers (80+). 
   
   ## Current Behavior
   We are getting the following errors which I don't know how to interpret. I 
have yet to properly and predictably reproduce these errors, and I am not sure 
what all of the consequences are and what the root cause is. So I am pretty 
much lost.
   
   The error that is concerning me the most is:
   ```
   [error] 2017-10-02T15:14:56.440179Z nonode@nohost <0.23835.5135> 1c9aabe372 
req_err(527034634) timeout : nil
 
[{rexi,stream2,3,[{file,"src/rexi.erl"},{line,213}]},{fabric_rpc,changes_enumerator,2,[{file,"src/fabric_rpc.erl"},{line,349}]},{couch_btree,stream_kv_node2,8,[{file,"src/couch_btree.erl"},{line,783}]},{couch_btree,stream_kp_node,7,[{file,"src/couch_btree.erl"},{line,710}]},{couch_btree,stream_kp_node,8,[{file,"src/couch_btree.erl"},{line,754}]},{couch_btree,fold,4,[{file,"src/couch_btree.erl"},{line,220}]},{couch_db,changes_since,5,[{file,"src/couch_db.erl"},{line,1244}]},{fabric_rpc,changes,4,[{file,"src/fabric_rpc.erl"},{line,83}]}]
   [error] 2017-10-02T15:14:56.440653Z nonode@nohost <0.23835.5135> 1c9aabe372 
Response abnormally terminated: 
{timeout,nil,[{rexi,stream2,3,[{file,"src/rexi.erl"},{line,213}]},{fabric_rpc,changes_enumerator,2,[{file,"src/fabric_rpc.erl"},{line,349}]},{couch_btree,stream_kv_node2,8,[{file,"src/couch_btree.erl"},{line,783}]},{couch_btree,stream_kp_node,7,[{file,"src/couch_btree.erl"},{line,710}]},{couch_btree,stream_kp_node,8,[{file,"src/couch_btree.erl"},{line,754}]},{couch_btree,fold,4,[{file,"src/couch_btree.erl"},{line,220}]},{couch_db,changes_since,5,[{file,"src/couch_db.erl"},{line,1244}]},{fabric_rpc,changes,4,[{file,"src/fabric_rpc.erl"},{line,83}]}]}
   ```
   This one makes Logstash reset/lose track of the file it uses to track which 
update_sequence it is at. This is actually how I noticed it, because Logstash 
jumped back a couple of million updates. Ouch.
   
   Another error that regularly keeps popping up around the former one (in 
batches of up to 10 or so) is:
   ```
   [error] 2017-10-02T12:58:21.722899Z nonode@nohost <0.18748.5131> 1c9aabe372 
rexi_server exit:timeout 
[{rexi,stream2,3,[{file,"src/rexi.erl"},{line,213}]},{fabric_rpc,changes_enumerator,2,[{file,"src/fabric_rpc.erl"},{line,349}]},{couch_btree,stream_kv_node2,8,[{file,"src/couch_btree.erl"},{line,783}]},{couch_btree,stream_kp_node,7,[{file,"src/couch_btree.erl"},{line,710}]},{couch_btree,stream_kp_node,8,[{file,"src/couch_btree.erl"},{line,754}]},{couch_btree,fold,4,[{file,"src/couch_btree.erl"},{line,220}]},{couch_db,changes_since,5,[{file,"src/couch_db.erl"},{line,1244}]},{fabric_rpc,changes,4,[{file,"src/fabric_rpc.erl"},{line,83}]}]
   ```
   ... or as a shorter variation:
   ```
   [error] 2017-10-01T09:55:45.098141Z nonode@nohost <0.26324.4873> 1bc0992f85 
rexi_server exit:timeout 
[{rexi,init_stream,1,[{file,"src/rexi.erl"},{line,256}]},{rexi,stream2,3,[{file,"src/rexi.erl"},{line,204}]},{fabric_rpc,view_cb,2,[{file,"src/fabric_rpc.erl"},{line,286}]},{couch_mrview,finish_fold,2,[{file,"src/couch_mrview.erl"},{line,632}]},{couch_mrview,query_view,5,[{file,"src/couch_mrview.erl"},{line,255}]},{rexi_server,init_p,3,[{file,"src/rexi_server.erl"},{line,139}]}]
   ```
   This one also occurs in batches:
   ```
   [error] 2017-10-02T13:50:21.375009Z nonode@nohost <0.17003.82>  OS 
Process Error <0.26804.77> :: {os_process_error,"OS process timed out."}
   ```
   and so is occasionally:
   ```
   [error] 2017-10-02T13:48:12.959135Z nonode@nohost emulator  Error in 
process <0.10836.82> with exit value: {{nocatch,{os_process_error,"OS process 
timed 
out."}},[{couch_os_process,prompt,2,[{file,"src/couch_os_process.erl"},{line,59}]},{couch_query_servers,map_doc_raw,2,[{file,"src/couch_query_servers.erl

[GitHub] wohali commented on issue #859: Various error messages and breakage

2017-10-02 Thread git
wohali commented on issue #859: Various error messages and breakage
URL: https://github.com/apache/couchdb/issues/859#issuecomment-333616984
 
 
   Please try again with the apache/couchdb:2.1.0 image and see if this helps. 
The klaemo/couchdb images are deprecated.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nickva opened a new pull request #860: Remove usage of deprecated random module.

2017-10-02 Thread git
nickva opened a new pull request #860: Remove usage of deprecated random module.
URL: https://github.com/apache/couchdb/pull/860
 
 
   Replace with util compatibility functions which use `crypto:rand_uniform/2`
   
   `crypto:rand_uniform/2` will also be deprecated in the future, hopefully by
   then we'd move to 18 as the minimum version.
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao commented on issue #872: Invalid map/reduce functions do not show an error to the user

2017-10-02 Thread git
Antonio-Maranhao commented on issue #872: Invalid map/reduce functions do not 
show an error to the user
URL: https://github.com/apache/couchdb-fauxton/issues/872#issuecomment-333618928
 
 
   @garrensmith This works now. The UI shows the error notification.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wohali commented on issue #859: Various error messages and breakage

2017-10-02 Thread git
wohali commented on issue #859: Various error messages and breakage
URL: https://github.com/apache/couchdb/issues/859#issuecomment-333619692
 
 
   Basically all of your errors are timeouts. Your system is overloaded. You 
can keep bumping up timeouts, but this only sweeps the problem under the rug.
   
   You should consider moving to a proper CouchDB 2.x 3-node cluster to start, 
with a load balancer in front. You may need to experiment to determine the 
correct `q` value for this database as well. By spreading the load across more 
nodes you should be able to scale this horizontally. You could consider running 
the nodes all on the same Docker host, but only you know what load you have and 
what that machine is capable of handling. For redundancy it would be better to 
use separate physical hosts, even if those machines are also running Docker 
containers.
   
   Another thing to consider is, if you are using filtered `_changes` feeds 
(could relate to your `couchjs` os process timeouts), to switch to [Mango-style 
selectors](http://docs.couchdb.org/en/2.1.0/api/database/changes.html?highlight=selector#selector)
 which are significantly better performance than JavaScript filters.
   
   None of the error messages above suggest you're hitting file handle limits 
(you'd see `emfile` or `enfile` errors).
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nickva opened a new pull request #861: Replace deprecated crypto:rand_bytes call

2017-10-02 Thread git
nickva opened a new pull request #861: Replace deprecated crypto:rand_bytes call
URL: https://github.com/apache/couchdb/pull/861
 
 
   Replaced with crypto:strong_rand_bytes
   
   Also fixed a missing newline at the end of file.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] couchdb-khash pull request #7: Replace deprecated random module

2017-10-02 Thread nickva
GitHub user nickva opened a pull request:

https://github.com/apache/couchdb-khash/pull/7

Replace deprecated random module

Replaced with crypto:rand_uniform functions.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/couchdb-khash 
replace-deprecated-random-module

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-khash/pull/7.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #7


commit c777cee7717f75199b298a6888bbea77a7ea599d
Author: Nick Vatamaniuc 
Date:   2017-10-02T18:51:32Z

Replace deprecated random module

Replaced with crypto:rand_uniform functions.




---


[GitHub] couchdb-khash issue #7: Replace deprecated random module

2017-10-02 Thread wohali
Github user wohali commented on the issue:

https://github.com/apache/couchdb-khash/pull/7
  
Would you mind tweaking `.travis.yml` in this PR to drop the R14 builds so 
the checks pass please?

Assuming everything passes once you do so, +1


---


[GitHub] couchdb-khash issue #7: Replace deprecated random module

2017-10-02 Thread nickva
Github user nickva commented on the issue:

https://github.com/apache/couchdb-khash/pull/7
  
Will do! Good idea. I just noticed it was wonky


---


[GitHub] couchdb-khash pull request #7: Replace deprecated random module

2017-10-02 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/couchdb-khash/pull/7


---


[GitHub] Antonio-Maranhao commented on issue #954: Save document does not prompt invalid JSON

2017-10-02 Thread git
Antonio-Maranhao commented on issue #954: Save document does not prompt invalid 
JSON
URL: https://github.com/apache/couchdb-fauxton/issues/954#issuecomment-333641366
 
 
   The error message is displayed on the latest version in master using Firefox 
56 (64bit) on Mac.
   Ctrl+S also triggers the save operation.
   
   
![image](https://user-images.githubusercontent.com/30349380/31095505-0d775284-a787-11e7-8def-0db69558b6ae.png)
   
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao closed pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao closed pull request #986: Refactor map/reduce views to use 
Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao commented on issue #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao commented on issue #986: Refactor map/reduce views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#issuecomment-333641627
 
 
   @garrensmith 
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao opened a new pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao opened a new pull request #986: Refactor map/reduce views to 
use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986
 
 
   
   ## Overview
   
   
   - [x] Updated map/reduce views to use Redux version of IndexResults 
components
   - [x] Removed non-Redux components from `index-results` 
   - [x] Removed Mango resources from `documents/resources.js` 
   - [x] Query Options are now preserved when switching between different 
views, all docs, design docs. Also, if any of the options is enabled (except 
for All docs) the header is highlighted to indicate this fact.
   
   Extra 
   - [x] Bug fix: when creating a new view in an existing design doc, an error 
message is showed and the page doesn't change to the new view.
   
   ## Testing recommendations
   
   - Select a view and browse the results
 - Change display mode (Table/Metadata/JSON)
 - Click on next/previous page
 - Change the num of 
 - Set query options and click Run Query
   - Check that {}JSON link includes options from Query Options
   - Check that Reduce option only shows for views that contain a reduce 
function
  - When the Reduce option is enabled, only the Metadata layout is 
enabled
- Create a new view in an existing design doc
   
   ## 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 GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao opened a new pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao opened a new pull request #986: Refactor map/reduce views to 
use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986
 
 
   
   ## Overview
   
   
   - [x] Updated map/reduce views to use Redux version of IndexResults 
components
   - [x] Removed non-Redux components from `index-results` 
   - [x] Removed Mango resources from `documents/resources.js` 
   - [x] Query Options are now preserved when switching between different 
views, all docs, design docs. Also, if any of the options is enabled (except 
for All docs) the header is highlighted to indicate this fact.
   
   Extra 
   - [x] Bug fix: when creating a new view in an existing design doc, an error 
message is showed and the page doesn't change to the new view.
   
   ## Testing recommendations
   
   - Select a view and browse the results
 - Change display mode (Table/Metadata/JSON)
 - Click on next/previous page
 - Change the num of 
 - Set query options and click Run Query
   - Check that {}JSON link includes options from Query Options
   - Check that Reduce option only shows for views that contain a reduce 
function
  - When the Reduce option is enabled, only the Metadata layout is 
enabled
- Create a new view in an existing design doc
   
   ## 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 GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao closed pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao closed pull request #986: Refactor map/reduce views to use 
Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao opened a new pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao opened a new pull request #986: Refactor map/reduce views to 
use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986
 
 
   
   ## Overview
   
   
   - [x] Updated map/reduce views to use Redux version of IndexResults 
components
   - [x] Removed non-Redux components from `index-results` 
   - [x] Removed Mango resources from `documents/resources.js` 
   - [x] Query Options are now preserved when switching between different 
views, all docs, design docs. Also, if any of the options is enabled (except 
for All docs) the header is highlighted to indicate this fact.
   
   Extra 
   - [x] Bug fix: when creating a new view in an existing design doc, an error 
message is showed and the page doesn't change to the new view.
   
   ## Testing recommendations
   
   - Select a view and browse the results
 - Change display mode (Table/Metadata/JSON)
 - Click on next/previous page
 - Change the num of 
 - Set query options and click Run Query
   - Check that {}JSON link includes options from Query Options
   - Check that Reduce option only shows for views that contain a reduce 
function
  - When the Reduce option is enabled, only the Metadata layout is 
enabled
- Create a new view in an existing design doc
   
   ## 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 GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] couchdb-khash pull request #8: Fix iterator expiry test

2017-10-02 Thread nickva
GitHub user nickva opened a pull request:

https://github.com/apache/couchdb-khash/pull/8

Fix iterator expiry test

This test started failing with Erlang 20.0 release. The reason is that 
opaaque
NIF resources stopped being identifed as empty binaries in Erlang so 
previously
it matched but once refs were used it stopped matching.

Fixes #855

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/couchdb-khash fix-iterator-test

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-khash/pull/8.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #8


commit 8048aaf74994b1f21a6259adcbe69ace3af4bbb3
Author: Nick Vatamaniuc 
Date:   2017-10-02T20:37:56Z

Fix iterator expiry test

This test started failing with Erlang 20.0 release. The reason is that 
opaaque
NIF resources stopped being identifed as empty binaries in Erlang so 
previously
it matched but once refs were used it stopped matching.

Fixes #855




---


[GitHub] Antonio-Maranhao closed pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao closed pull request #986: Refactor map/reduce views to use 
Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] couchdb-khash issue #8: Fix iterator expiry test

2017-10-02 Thread wohali
Github user wohali commented on the issue:

https://github.com/apache/couchdb-khash/pull/8
  
+1 once Travis passes


---


[GitHub] couchdb-khash pull request #8: Fix iterator expiry test

2017-10-02 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/couchdb-khash/pull/8


---


[GitHub] nickva commented on issue #860: Remove usage of deprecated random module.

2017-10-02 Thread git
nickva commented on issue #860: Remove usage of deprecated random module.
URL: https://github.com/apache/couchdb/pull/860#issuecomment-333671154
 
 
   Turns out crypto:rand_uniform/2 is also deprecated but docs don't show it. 
Only shows up during compiling. Will go a different route and do a check if 
rand module is present to call that.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wohali commented on issue #861: Replace deprecated crypto:rand_bytes call

2017-10-02 Thread git
wohali commented on issue #861: Replace deprecated crypto:rand_bytes call
URL: https://github.com/apache/couchdb/pull/861#issuecomment-333672660
 
 
   +1
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nickva closed pull request #861: Replace deprecated crypto:rand_bytes call

2017-10-02 Thread git
nickva closed pull request #861: Replace deprecated crypto:rand_bytes call
URL: https://github.com/apache/couchdb/pull/861
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao opened a new pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao opened a new pull request #986: Refactor map/reduce views to 
use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986
 
 
   
   ## Overview
   
   
   - [x] Updated map/reduce views to use Redux version of IndexResults 
components
   - [x] Removed non-Redux components from `index-results` 
   - [x] Removed Mango resources from `documents/resources.js` 
   - [x] Query Options are now preserved when switching between different 
views, all docs, design docs. Also, if any of the options is enabled (except 
for All docs) the header is highlighted to indicate this fact.
   
   Extra 
   - [x] Bug fix: when creating a new view in an existing design doc, an error 
message is showed and the page doesn't change to the new view.
   
   ## Testing recommendations
   
   - Select a view and browse the results
 - Change display mode (Table/Metadata/JSON)
 - Click on next/previous page
 - Change the num of 
 - Set query options and click Run Query
   - Check that {}JSON link includes options from Query Options
   - Check that Reduce option only shows for views that contain a reduce 
function
  - When the Reduce option is enabled, only the Metadata layout is 
enabled
- Create a new view in an existing design doc
   
   ## 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 GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao closed pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao closed pull request #986: Refactor map/reduce views to use 
Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[Jenkins] FAILURE: CouchDB » master #95

2017-10-02 Thread Apache Jenkins Server
Boo, we failed. https://builds.apache.org/job/CouchDB/job/master/95/

[GitHub] Antonio-Maranhao opened a new pull request #989: Basic validation of key values provided in the Query Options panel

2017-10-02 Thread git
Antonio-Maranhao opened a new pull request #989: Basic validation of key values 
provided in the Query Options panel
URL: https://github.com/apache/couchdb-fauxton/pull/989
 
 
   
   ## Overview
   
   A common (newbiew) user mistake is to forget to include double quotes in the 
By Keys and Between Keys fields (Query Options panel) for String values. (See 
https://github.com/apache/couchdb-fauxton/issues/957)
   Since CouchDB accepts arbitrary JSON values as key, automatically adding the 
quotes is not ideal. Instead, the panel does some basic validation and displays 
a warning when necessary.
   
   ## Testing recommendations
   
   - Between Keys filter
 - It should display the warning for String values without quotes (e.g.: 
abc)
 - It should NOT display the warning for numbers and boolean.
   - By Keys filter
 - It should display the warning if the value is not enclosed in square 
brackets (e.g.: "abc")
   
   ## GitHub issue number
   
   Related to https://github.com/apache/couchdb-fauxton/issues/957
   
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wohali commented on issue #860: Remove usage of deprecated random module.

2017-10-02 Thread git
wohali commented on issue #860: Remove usage of deprecated random module.
URL: https://github.com/apache/couchdb/pull/860#issuecomment-333688367
 
 
   +1 but I defer to @rnewson who just recently removed `couch_crypto` about 
the reasonableness of sticking these function in `couch_util`. Probably fine, 
though.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[Jenkins] SUCCESS: CouchDB » master #96

2017-10-02 Thread Apache Jenkins Server
Yay, we passed. https://builds.apache.org/job/CouchDB/job/master/96/

[GitHub] kocolosk commented on issue #602: Security objects cannot be synced if nodes are in maintenance mode

2017-10-02 Thread git
kocolosk commented on issue #602: Security objects cannot be synced if nodes 
are in maintenance mode
URL: https://github.com/apache/couchdb/issues/602#issuecomment-333706653
 
 
   @janl no, that wasn't what I was suggesting; I was only explaining why this 
sort of thing tends to not crop up in production.
   
   I'd agree that a user should not voluntarily put a majority of cluster nodes 
into maintenance, but if that user is unlucky enough to lose 2/3 of a cluster 
and she still wants predictable responses to view queries then she may well end 
up in this position.
   
   I was suggesting setting a flag somewhere in the codepath of 
`mem3_sync_security` that would allow it to retrieve security objects from 
nodes in maintenance mode. One (slightly hacky) way to do that would be to set 
a custom IO priority for the request.
   
   This is not without its own issues, though ... in the case I described above 
where 2/3 of the cluster was destroyed a sync process patched in this way could 
actually remove the security settings from the remaining healthy nodes, since 
the shards on the rebuilding nodes would constitute a simple majority of all 
database shards and "outvote" the healthy ones.
   
   The proper fix here is to introduce versioning into security objects. I 
recall some attempts at doing so over the years but also recall those attempts 
running into unexpectedly gnarly corner cases. @davisp and @chewbranca may 
remember more.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wohali opened a new pull request #862: [WIP] Configurably whitelist certain db/docids as valid

2017-10-02 Thread git
wohali opened a new pull request #862: [WIP] Configurably whitelist certain 
db/docids as valid
URL: https://github.com/apache/couchdb/pull/862
 
 
   Currently, it is impossible to `PUT/POST` these documents:
   * `_dbs/_users`
   * `_dbs/_replicator`
   * `_dbs/_global_changes`
   
   because the document `_ids` are reserved. This change permits these
   specific `db/docid` combinations as valid so `PUT/POST` operations can
   succeed. The specific list is configurable.
   
   This is a WIP to make sure the approach is acceptable. I had to dig
   really deep into `couch_doc` to make these changes, and while I'm not
   very happy with the encapsulation violation it introduces, I'm afraid we
   have little choice without a complete rewrite.
   
   If the approach is acceptable, proper tests will be forthcoming:
   * config checks
   * `PUT/POST` positive and negative test cases
   
   /cc @davisp @rnewson @nickva 
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao closed pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao closed pull request #986: Refactor map/reduce views to use 
Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao opened a new pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao opened a new pull request #986: Refactor map/reduce views to 
use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986
 
 
   
   ## Overview
   
   
   - [x] Updated map/reduce views to use Redux version of IndexResults 
components
   - [x] Removed non-Redux components from `index-results` 
   - [x] Removed Mango resources from `documents/resources.js` 
   - [x] Query Options are now preserved when switching between different 
views, all docs, design docs. Also, if any of the options is enabled (except 
for All docs) the header is highlighted to indicate this fact.
   
   Extra 
   - [x] Bug fix: when creating a new view in an existing design doc, an error 
message is showed and the page doesn't change to the new view.
   
   ## Testing recommendations
   
   - Select a view and browse the results
 - Change display mode (Table/Metadata/JSON)
 - Click on next/previous page
 - Change the num of 
 - Set query options and click Run Query
   - Check that {}JSON link includes options from Query Options
   - Check that Reduce option only shows for views that contain a reduce 
function
  - When the Reduce option is enabled, only the Metadata layout is 
enabled
- Create a new view in an existing design doc
   
   ## 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 GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao opened a new pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao opened a new pull request #986: Refactor map/reduce views to 
use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986
 
 
   ## Overview
   
   
   - [x] Updated map/reduce views to use Redux version of IndexResults 
components
   - [x] Removed non-Redux components from `index-results` 
   - [x] Removed Mango resources from `documents/resources.js` 
   - [x] Query Options are now preserved when switching between different 
views, all docs, design docs. Also, if any of the options is enabled (except 
for All docs) the header is highlighted to indicate this fact.
   
   Extra 
   - [x] Bug fix: when creating a new view in an existing design doc, an error 
message is showed and the page doesn't change to the new view.
   - [x] Bug fix: handle error when saving view. Closes #914 
   
   ## Testing recommendations
   
   - Select a view and browse the results
 - Change display mode (Table/Metadata/JSON)
 - Click on next/previous page
 - Change the num of 
 - Set query options and click Run Query
   - Check that {}JSON link includes options from Query Options
   - Check that Reduce option only shows for views that contain a reduce 
function
  - When the Reduce option is enabled, only the Metadata layout is 
enabled
- Create a new view in an existing design doc
   
   ## 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 GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao closed pull request #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao closed pull request #986: Refactor map/reduce views to use 
Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] Antonio-Maranhao commented on issue #986: Refactor map/reduce views to use Redux

2017-10-02 Thread git
Antonio-Maranhao commented on issue #986: Refactor map/reduce views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#issuecomment-333729669
 
 
   @garrensmith finally got it to pass.
   Fixed issue #914 as well since I was modifying that page.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nickva commented on a change in pull request #862: [WIP] Configurably whitelist certain db/docids as valid

2017-10-02 Thread git
nickva commented on a change in pull request #862: [WIP] Configurably whitelist 
certain db/docids as valid
URL: https://github.com/apache/couchdb/pull/862#discussion_r142310651
 
 

 ##
 File path: rel/overlay/etc/default.ini
 ##
 @@ -49,9 +49,12 @@ changes_doc_ids_optimization_threshold = 100
 ; applied conservatively. For example 1.0e+16 could be encoded as 1e16, so 4 
used
 ; for size calculation instead of 7.
 ;max_document_size = 4294967296 ; bytes
-
 ; Maximum attachment size.
 ; max_attachment_size = infinity
+;
+; Whitelisted reserved document names (to allow modification of shard maps)
+; List of tuples of the form {dbname, [docid, ...]}
+;whitelist_doc_ids = [{"_dbs", ["_users", "_replicator", "_global_changes"]}]
 
 Review comment:
   Technically dbs is already a configured parameter, `mem3.shards_db` I 
believe,  maybe just read `config:get("mem3", "shards_db", "_dbs")` when 
validating.
   
   _replicator is a hard-coded maybe we don't need it to be configurable.  
`_users` is from `chttpd_auth.authentication_db` so there can read from config 
and `_global_changes` I think is also hard coded like replicator.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wohali commented on a change in pull request #862: [WIP] Configurably whitelist certain db/docids as valid

2017-10-02 Thread git
wohali commented on a change in pull request #862: [WIP] Configurably whitelist 
certain db/docids as valid
URL: https://github.com/apache/couchdb/pull/862#discussion_r142312897
 
 

 ##
 File path: rel/overlay/etc/default.ini
 ##
 @@ -49,9 +49,12 @@ changes_doc_ids_optimization_threshold = 100
 ; applied conservatively. For example 1.0e+16 could be encoded as 1e16, so 4 
used
 ; for size calculation instead of 7.
 ;max_document_size = 4294967296 ; bytes
-
 ; Maximum attachment size.
 ; max_attachment_size = infinity
+;
+; Whitelisted reserved document names (to allow modification of shard maps)
+; List of tuples of the form {dbname, [docid, ...]}
+;whitelist_doc_ids = [{"_dbs", ["_users", "_replicator", "_global_changes"]}]
 
 Review comment:
   I want to see what @rnewson says here; I can certainly derive the values but 
he specifically said he wanted the list configurable. *shrug*
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nickva commented on issue #860: Remove usage of deprecated random module.

2017-10-02 Thread git
nickva commented on issue #860: Remove usage of deprecated random module.
URL: https://github.com/apache/couchdb/pull/860#issuecomment-333751138
 
 
   Another update. The previous approach was similar to the couch_crypto, 
however that didn't work for this case because it turns out 
`erlang:function_exported/3` will return `false` even module is there and 
function is exported but it hasn't been loaded yet. In case of the `rand` 
module there was nothing loading it, so that check was failing. 
   
   Switched to explicitly checking versions instead and calling the appropriate 
module. ERTS was used for version check instead of OTP version since ERTS is a 
nice numeric value, and OTP one changed its format (R16B0y-x to 17.x.y).
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] nickva commented on issue #860: Remove usage of deprecated random module.

2017-10-02 Thread git
nickva commented on issue #860: Remove usage of deprecated random module.
URL: https://github.com/apache/couchdb/pull/860#issuecomment-333751138
 
 
   Another update. The previous approach was similar to the couch_crypto, 
however that didn't work for this case because it turns out 
`erlang:function_exported/3` will return `false` even if module is there and 
function is exported but it hasn't been loaded yet. In case of the `rand` 
module there was nothing loading it, so that check was failing. 
   
   Switched to explicitly checking versions instead and calling the appropriate 
module. ERTS was used for version check instead of OTP version since ERTS is a 
nice numeric value, and OTP one changed its format (R16B0y-x to 17.x.y).
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services