You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/01/07 15:39:54 UTC
[GitHub] [couchdb-fauxton] willholley opened a new pull request #1245:
Mango: support multiple server-side warnings
willholley opened a new pull request #1245: Mango: support multiple server-side warnings
URL: https://github.com/apache/couchdb-fauxton/pull/1245
<!-- 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
Changes the handling of mango warnings to support multiple warnings
delimited by a newline, as added in https://github.com/apache/couchdb/pull/2410.
This also removes the client-side warning for too many docs scanned as that is now generated on the server.
## Testing recommendations
When https://github.com/apache/couchdb/pull/2410 is merged, run some Mango queries with bad / no indexes to generate warnings.
## GitHub issue number
<!-- If this is a significant change, please file a separate issue at:
https://github.com/apache/couchdb-fauxton/issues
and include the number here and in commit message(s) using
syntax like "Fixes #472" or "Fixes apache/couchdb#472". -->
## Related Pull Requests
<!-- If your changes affects multiple components in different
repositories please put links to those pull requests here. -->
## Checklist
- [ ] Code is written and works correctly;
- [ ] Changes are covered by tests;
- [ ] Documentation reflects the changes;
- [ ] Update [rebar.config.script](https://github.com/apache/couchdb/blob/master/rebar.config.script) with the correct tag once a new Fauxton release is made
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb-fauxton] Antonio-Maranhao commented on a change in pull
request #1245: Mango: support multiple server-side warnings
Posted by GitBox <gi...@apache.org>.
Antonio-Maranhao commented on a change in pull request #1245: Mango: support multiple server-side warnings
URL: https://github.com/apache/couchdb-fauxton/pull/1245#discussion_r364484568
##########
File path: app/addons/documents/mango/components/ExecutionStats.js
##########
@@ -37,18 +35,10 @@ export default class ExecutionStats extends React.Component {
return [minutes, ' ', minuteText, ', ', seconds, ' ', secondsText].join('');
}
- getWarning(executionStats, warning) {
- if (!executionStats) { return warning; }
-
- // warn if many documents scanned in relation to results returned
- if (!warning && executionStats.results_returned) {
- const docsExamined = executionStats.total_docs_examined || executionStats.total_quorum_docs_examined;
- if (docsExamined / executionStats.results_returned > 10) {
- return TOO_MANY_DOCS_SCANNED_WARNING;
- }
+ getWarning(warning) {
+ if (warning) {
+ return warning.split('\n').join('<br>');
Review comment:
This will print `<br>` instead of adding a line break. You can use this instead:
```
getWarning(warnings) {
if (warnings) {
const lines = warnings.split('\n').map((warnText, i) => {
return <React.Fragment key={i}>{warnText}<br/></React.Fragment>;
});
return <span>{lines}</span>;
}
}
```
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb-fauxton] willholley commented on issue #1245: Mango:
support multiple server-side warnings
Posted by GitBox <gi...@apache.org>.
willholley commented on issue #1245: Mango: support multiple server-side warnings
URL: https://github.com/apache/couchdb-fauxton/pull/1245#issuecomment-572584043
hmm - looks like CI against `couchdb:dev` is broken...
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb-fauxton] willholley commented on a change in pull request
#1245: Mango: support multiple server-side warnings
Posted by GitBox <gi...@apache.org>.
willholley commented on a change in pull request #1245: Mango: support multiple server-side warnings
URL: https://github.com/apache/couchdb-fauxton/pull/1245#discussion_r364708522
##########
File path: app/addons/documents/mango/components/ExecutionStats.js
##########
@@ -37,18 +35,10 @@ export default class ExecutionStats extends React.Component {
return [minutes, ' ', minuteText, ', ', seconds, ' ', secondsText].join('');
}
- getWarning(executionStats, warning) {
- if (!executionStats) { return warning; }
-
- // warn if many documents scanned in relation to results returned
- if (!warning && executionStats.results_returned) {
- const docsExamined = executionStats.total_docs_examined || executionStats.total_quorum_docs_examined;
- if (docsExamined / executionStats.results_returned > 10) {
- return TOO_MANY_DOCS_SCANNED_WARNING;
- }
+ getWarning(warning) {
+ if (warning) {
+ return warning.split('\n').join('<br>');
Review comment:
thanks @Antonio-Maranhao - updated with those changes
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb-fauxton] Antonio-Maranhao commented on a change in pull
request #1245: Mango: support multiple server-side warnings
Posted by GitBox <gi...@apache.org>.
Antonio-Maranhao commented on a change in pull request #1245: Mango: support multiple server-side warnings
URL: https://github.com/apache/couchdb-fauxton/pull/1245#discussion_r364484568
##########
File path: app/addons/documents/mango/components/ExecutionStats.js
##########
@@ -37,18 +35,10 @@ export default class ExecutionStats extends React.Component {
return [minutes, ' ', minuteText, ', ', seconds, ' ', secondsText].join('');
}
- getWarning(executionStats, warning) {
- if (!executionStats) { return warning; }
-
- // warn if many documents scanned in relation to results returned
- if (!warning && executionStats.results_returned) {
- const docsExamined = executionStats.total_docs_examined || executionStats.total_quorum_docs_examined;
- if (docsExamined / executionStats.results_returned > 10) {
- return TOO_MANY_DOCS_SCANNED_WARNING;
- }
+ getWarning(warning) {
+ if (warning) {
+ return warning.split('\n').join('<br>');
Review comment:
This will print `<br>` instead of adding a line break. You can use this instead:
```
getWarning(warnings) {
if (warnings) {
return (
<span>
{warnings.split('\n').map(warnText => <>{warnText}<br/></>)}
</span>
);
}
}
```
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [couchdb-fauxton] willholley merged pull request #1245: Mango:
support multiple server-side warnings
Posted by GitBox <gi...@apache.org>.
willholley merged pull request #1245: Mango: support multiple server-side warnings
URL: https://github.com/apache/couchdb-fauxton/pull/1245
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services