1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into engine-api

This commit is contained in:
jsteemann 2017-03-01 14:32:55 +01:00
commit 63f696a032
17 changed files with 73 additions and 44 deletions

View File

@ -1,6 +1,13 @@
devel
-----
* always validate incoming JSON HTTP requests for duplicate attribute names
Incoming JSON data with duplicate attribute names will now be rejected as
invalid. Previous versions of ArangoDB only validated the uniqueness of
attribute names inside incoming JSON for some API endpoints, but not
consistently for all APIs.
* don't let read-only transactions block the WAL collector
* allow passing own `graphql-sync` module instance to Foxx GraphQL router
@ -71,6 +78,8 @@ v3.2.alpha1 (2017-02-05)
* more detailed stacktraces in Foxx apps
* generated Foxx services now use swagger tags
v3.1.12 (XXXX-XX-XX)
--------------------
@ -231,6 +240,8 @@ shards.
* process.stdout.isTTY now returns `true` in arangosh and when running arangod with the `--console` flag
* add support for Swagger tags in Foxx
v3.1.9 (XXXX-XX-XX)
-------------------

View File

@ -427,8 +427,15 @@ build-dist-books:
DISPL="$${DISPLAY}"; \
fi; \
make build-books DISPLAY="$${DISP}"; \
mkdir -p ${OUTPUT_DIR}; \
( cd books; tar -czf ${OUTPUT_DIR}/ArangoDB-${newVersionNumber}.tar.gz ${ALLBOOKS} index.html; ); \
mkdir -p ${OUTPUT_DIR} ; \
( \
mv books ArangoDB-${newVersionNumber} ; \
if test -n "${COOKBOOK_DIR}" ; then \
cp -a ${COOKBOOK_DIR} ArangoDB-${newVersionNumber}/cookbook ; \
fi ; \
tar -czf ${OUTPUT_DIR}/ArangoDB-${newVersionNumber}.tar.gz ArangoDB-${newVersionNumber} ; \
mv ArangoDB-${newVersionNumber} books ; \
) ; \
for book in $(ALLBOOKS); do \
make build-book-dist NAME=$${book} DISPLAY="$${DISP}" ; \
done; \

View File

@ -372,3 +372,30 @@ Returns the endpoint.
router.get(/* ... */)
.deprecated();
```
tag
---
`endpoint.tag(...tags): this`
Marks the endpoint with the given tags that will be used to group related routes in the generated API documentation.
If the endpoint is a child router, all routes of that router will also be marked with the tags. If the endpoint is a middleware, this method has no effect.
This method only affects the generated API documentation and has not other effect within the service itself.
**Arguments**
* **tags**: `string`
One or more strings that will be used to group the endpoint's routes.
Returns the endpoint.
**Examples**
```js
router.get(/* ... */)
.tag('auth', 'restricted');
```

View File

@ -59,4 +59,6 @@ Foxx
The [cookie session transport](../Foxx/Sessions/Transports/Cookie.md) now supports all options supported by the [cookie method of the response object](../Foxx/Router/Response.md#cookie).
It's now possible to provide your own version of the `graphql-sync` module when using the [GraphQL extensions for Foxx](../Foxx/GraphQL.md) by passing a copy of the module using the new _graphql_ option.
It's now possible to provide your own version of the `graphql-sync` module when using the [GraphQL extensions for Foxx](../Foxx/GraphQL.md) by passing a copy of the module using the new _graphql_ option.
Endpoints can now be tagged using the [tag method](../Foxx/Router/Endpoints.md#tag) to generate a cleaner Swagger documentation.

View File

@ -146,7 +146,7 @@ static int runServer(int argc, char** argv) {
server.addFeature(new FoxxQueuesFeature(&server));
server.addFeature(new FrontendFeature(&server));
server.addFeature(new GeneralServerFeature(&server));
server.addFeature(new GreetingsFeature(&server, "arangod"));
server.addFeature(new GreetingsFeature(&server));
server.addFeature(new InitDatabaseFeature(&server, nonServerFeatures));
server.addFeature(new LanguageFeature(&server));
server.addFeature(new LockfileFeature(&server));

View File

@ -25,7 +25,6 @@
#include "Basics/directories.h"
#include "ApplicationFeatures/ConfigFeature.h"
#include "ApplicationFeatures/GreetingsFeature.h"
#include "ApplicationFeatures/ShutdownFeature.h"
#include "ApplicationFeatures/TempFeature.h"
#include "ApplicationFeatures/VersionFeature.h"
@ -57,7 +56,6 @@ int main(int argc, char* argv[]) {
server.addFeature(new BenchFeature(&server, &ret));
server.addFeature(new ClientFeature(&server));
server.addFeature(new ConfigFeature(&server, "arangobench"));
server.addFeature(new GreetingsFeature(&server, "arangobench"));
server.addFeature(new LoggerFeature(&server, false));
server.addFeature(new RandomFeature(&server));
server.addFeature(new ShutdownFeature(&server, {"Bench"}));

View File

@ -25,7 +25,6 @@
#include "Basics/directories.h"
#include "ApplicationFeatures/ConfigFeature.h"
#include "ApplicationFeatures/GreetingsFeature.h"
#include "ApplicationFeatures/ShutdownFeature.h"
#include "ApplicationFeatures/VersionFeature.h"
#include "Basics/ArangoGlobalContext.h"
@ -54,7 +53,6 @@ int main(int argc, char* argv[]) {
server.addFeature(new ClientFeature(&server));
server.addFeature(new ConfigFeature(&server, "arangodump"));
server.addFeature(new DumpFeature(&server, &ret));
server.addFeature(new GreetingsFeature(&server, "arangodump"));
server.addFeature(new LoggerFeature(&server, false));
server.addFeature(new RandomFeature(&server));
server.addFeature(new ShutdownFeature(&server, {"Dump"}));

View File

@ -25,7 +25,6 @@
#include "Basics/directories.h"
#include "ApplicationFeatures/ConfigFeature.h"
#include "ApplicationFeatures/GreetingsFeature.h"
#include "ApplicationFeatures/ShutdownFeature.h"
#include "ApplicationFeatures/TempFeature.h"
#include "ApplicationFeatures/VersionFeature.h"
@ -54,7 +53,6 @@ int main(int argc, char* argv[]) {
server.addFeature(new ClientFeature(&server));
server.addFeature(new ConfigFeature(&server, "arangoexport"));
server.addFeature(new GreetingsFeature(&server, "arangoexport"));
server.addFeature(new ExportFeature(&server, &ret));
server.addFeature(new LoggerFeature(&server, false));
server.addFeature(new RandomFeature(&server));

View File

@ -25,7 +25,6 @@
#include "Basics/directories.h"
#include "ApplicationFeatures/ConfigFeature.h"
#include "ApplicationFeatures/GreetingsFeature.h"
#include "ApplicationFeatures/ShutdownFeature.h"
#include "ApplicationFeatures/TempFeature.h"
#include "ApplicationFeatures/VersionFeature.h"
@ -54,7 +53,6 @@ int main(int argc, char* argv[]) {
server.addFeature(new ClientFeature(&server));
server.addFeature(new ConfigFeature(&server, "arangoimp"));
server.addFeature(new GreetingsFeature(&server, "arangoimp"));
server.addFeature(new ImportFeature(&server, &ret));
server.addFeature(new LoggerFeature(&server, false));
server.addFeature(new RandomFeature(&server));

View File

@ -25,7 +25,6 @@
#include "Basics/directories.h"
#include "ApplicationFeatures/ConfigFeature.h"
#include "ApplicationFeatures/GreetingsFeature.h"
#include "ApplicationFeatures/ShutdownFeature.h"
#include "ApplicationFeatures/TempFeature.h"
#include "ApplicationFeatures/VersionFeature.h"
@ -53,7 +52,6 @@ int main(int argc, char* argv[]) {
server.addFeature(new ClientFeature(&server));
server.addFeature(new ConfigFeature(&server, "arangorestore"));
server.addFeature(new GreetingsFeature(&server, "arangorestore"));
server.addFeature(new LoggerFeature(&server, false));
server.addFeature(new RandomFeature(&server));
server.addFeature(new RestoreFeature(&server, &ret));

View File

@ -25,7 +25,6 @@
#include "Basics/directories.h"
#include "ApplicationFeatures/ConfigFeature.h"
#include "ApplicationFeatures/GreetingsFeature.h"
#include "ApplicationFeatures/LanguageFeature.h"
#include "ApplicationFeatures/ShutdownFeature.h"
#include "ApplicationFeatures/TempFeature.h"
@ -63,7 +62,6 @@ int main(int argc, char* argv[]) {
server.addFeature(new ClientFeature(&server));
server.addFeature(new ConfigFeature(&server, name));
server.addFeature(new ConsoleFeature(&server));
server.addFeature(new GreetingsFeature(&server, "arangosh"));
server.addFeature(new LanguageFeature(&server));
server.addFeature(new LoggerFeature(&server, false));
server.addFeature(new RandomFeature(&server));

View File

@ -25,7 +25,6 @@
#include "Basics/directories.h"
#include "ApplicationFeatures/ConfigFeature.h"
#include "ApplicationFeatures/GreetingsFeature.h"
#include "ApplicationFeatures/ShutdownFeature.h"
#include "ApplicationFeatures/VersionFeature.h"
#include "Basics/ArangoGlobalContext.h"
@ -49,7 +48,6 @@ int main(int argc, char* argv[]) {
int ret;
server.addFeature(new ConfigFeature(&server, "arangovpack"));
server.addFeature(new GreetingsFeature(&server, "arangovpack"));
server.addFeature(new LoggerFeature(&server, false));
server.addFeature(new RandomFeature(&server));
server.addFeature(new ShutdownFeature(&server, {"VPack"}));

View File

@ -112,21 +112,24 @@ void ApplicationFeature::determineAncestors() {
std::vector<std::string> path;
std::function<void(std::string const&)> build = [this, &build, &path](std::string const& name) {
path.emplace_back(name);
// lookup the feature first. it may not exist
ApplicationFeature* other = this->server()->lookupFeature(name);
for (auto& ancestor : this->server()->feature(name)->startsAfter()) {
if (_ancestors.emplace(ancestor).second) {
if (ancestor == _name) {
path.emplace_back(ancestor);
THROW_ARANGO_EXCEPTION_MESSAGE(
TRI_ERROR_INTERNAL,
"dependencies for feature '" + _name + "' are cyclic: " + arangodb::basics::StringUtils::join(path, " <= "));
if (other != nullptr) {
path.emplace_back(name);
for (auto& ancestor : other->startsAfter()) {
if (_ancestors.emplace(ancestor).second) {
if (ancestor == _name) {
path.emplace_back(ancestor);
THROW_ARANGO_EXCEPTION_MESSAGE(
TRI_ERROR_INTERNAL,
"dependencies for feature '" + _name + "' are cyclic: " + arangodb::basics::StringUtils::join(path, " <= "));
}
build(ancestor);
}
build(ancestor);
}
path.pop_back();
}
path.pop_back();
};
build(_name);

View File

@ -216,11 +216,12 @@ class ApplicationServer {
_progressReports.emplace_back(reporter);
}
char const* getBinaryPath() { return _binaryPath;}
private:
// look up a feature and return a pointer to it. may be nullptr
static ApplicationFeature* lookupFeature(std::string const&);
char const* getBinaryPath() { return _binaryPath;}
private:
// throws an exception that a requested feature was not found
static void throwFeatureNotFoundException(std::string const& name);

View File

@ -27,21 +27,17 @@
using namespace arangodb;
GreetingsFeature::GreetingsFeature(
application_features::ApplicationServer* server, char const* progname)
: ApplicationFeature(server, "Greetings"), _progname(progname) {
application_features::ApplicationServer* server)
: ApplicationFeature(server, "Greetings") {
setOptional(false);
requiresElevatedPrivileges(false);
startsAfter("Logger");
}
void GreetingsFeature::prepare() {
if (strcmp(_progname, "arangod") == 0) {
LOG_TOPIC(INFO, arangodb::Logger::FIXME) << "" << rest::Version::getVerboseVersionString();
}
LOG_TOPIC(INFO, arangodb::Logger::FIXME) << "" << rest::Version::getVerboseVersionString();
}
void GreetingsFeature::unprepare() {
if (strcmp(_progname, "arangod") == 0) {
LOG_TOPIC(INFO, arangodb::Logger::FIXME) << "ArangoDB has been shut down";
}
LOG_TOPIC(INFO, arangodb::Logger::FIXME) << "ArangoDB has been shut down";
}

View File

@ -28,14 +28,11 @@
namespace arangodb {
class GreetingsFeature final : public application_features::ApplicationFeature {
public:
GreetingsFeature(application_features::ApplicationServer* server, char const* progname);
explicit GreetingsFeature(application_features::ApplicationServer* server);
public:
void prepare() override final;
void unprepare() override final;
private:
char const* _progname;
};
}

View File

@ -237,7 +237,6 @@ typedef long suseconds_t;
TRI_LogBacktrace(); \
arangodb::Logger::flush(); \
arangodb::Logger::shutdown(); \
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr); \
std::abort(); \
} while (0)