diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 04e832402292530aae089e76a52bb83d87392591..739f99446c9a3169349c8bc17a614135f788a793 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,6 +24,8 @@ variables: CPPLIB_REGISTRY_IMAGE: $CI_REGISTRY/caosdb/src/caosdb-cpplib/testenv:$CI_COMMIT_REF_NAME CPPINTTEST_BRANCHES: https://gitlab.indiscale.com/api/v4/projects/111/repository/branches + OCTAVELIB_BRANCHES: https://gitlab.indiscale.com/api/v4/projects/117/repository/branches + JULIALIB_BRANCHES: https://gitlab.indiscale.com/api/v4/projects/116/repository/branches GIT_SUBMODULE_STRATEGY: normal ## FOR DEBUGGING @@ -87,7 +89,7 @@ test: - mkdir build - cd build - VERSION="$(conan inspect --raw version ..)" - - conan install -s "compiler.libcxx=libstdc++11" -o build_acm=True .. "caosdb/$VERSION@_/_" + - conan install -s "compiler.libcxx=libstdc++11" --build=missing -o build_acm=True .. "caosdb/$VERSION@_/_" - cmake -DCMAKE_BUILD_TYPE=Debug .. - cmake --build . -j - cmake --build . -j --target unit_test_coverage @@ -103,28 +105,45 @@ trigger_prepare: # ... use an f-branch if posible... - F_BRANCH=dev - if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then + F_BRANCH=$CI_COMMIT_REF_NAME ; if curl -o /dev/null -s -w "%{http_code}" $CPPINTTEST_BRANCHES/$CI_COMMIT_REF_NAME | grep "404"; then CPPINT_REF=dev ; - F_BRANCH=dev ; else CPPINT_REF=$CI_COMMIT_REF_NAME ; - F_BRANCH=$CI_COMMIT_REF_NAME ; - fi + fi; + if curl -o /dev/null -s -w "%{http_code}" $OCTAVELIB_BRANCHES/$CI_COMMIT_REF_NAME | grep "404"; then + OCTAVELIB_REF=dev ; + else + OCTAVELIB_REF=$CI_COMMIT_REF_NAME ; + fi; + if curl -o /dev/null -s -w "%{http_code}" $JULIALIB_BRANCHES/$CI_COMMIT_REF_NAME | grep "404"; then + JULIALIB_REF=dev ; + else + JULIALIB_REF=$CI_COMMIT_REF_NAME ; + fi; fi; # ... or use main if possible... - if [[ "$CI_COMMIT_REF_NAME" == "main" ]] ; then CPPINT_REF=main ; + OCTAVELIB_REF=main ; + JULIALIB_REF=main F_BRANCH=main ; fi - if echo "$CI_COMMIT_REF_NAME" | grep -c "^v" ; then CPPINT_REF=main ; + OCTAVELIB_REF=main ; + JULIALIB_REF=main ; F_BRANCH=main ; fi # ... and fall-back to dev - CPPINT_REF=${CPPINT_REF:-dev} + - OCTAVELIB_REF=${OCTAVELIB_REF:-dev} + - JULIALIB_REF=${JULIALIB_REF:-dev} # Write to dotenv - echo "CPPINT_REF=${CPPINT_REF}" >> "$DOTENV" + - echo "OCTAVELIB_REF=${OCTAVELIB_REF}" >> "$DOTENV" + - echo "JULIALIB_REF=${JULIALIB_REF}" >> "$DOTENV" - echo "F_BRANCH=${F_BRANCH}" >> "$DOTENV" - cat "$DOTENV" artifacts: @@ -154,6 +173,44 @@ trigger_inttest: branch: $CPPINT_REF strategy: depend +# After the cppinttest have been successful, also start tests for Octave... +trigger_octavelib: + stage: deploy + needs: [ trigger_inttest ] + inherit: + variables: + # List the variables that shall be inherited, which also means they will override any equally + # named varibles in child pipelines. + - TRIGGERED_BY_REPO + - TRIGGERED_BY_REF + - TRIGGERED_BY_HASH + - CPPLIB_REGISTRY_IMAGE + variables: + # dotenv variables must be set again here. + F_BRANCH: $F_BRANCH + trigger: + project: caosdb/src/caosdb-octavelib + branch: $OCTAVELIB_REF + +# ... and for Julia. +trigger_julialib: + stage: deploy + needs: [ trigger_inttest ] + inherit: + variables: + # List the variables that shall be inherited, which also means they will override any equally + # named varibles in child pipelines. + - TRIGGERED_BY_REPO + - TRIGGERED_BY_REF + - TRIGGERED_BY_HASH + - CPPLIB_REGISTRY_IMAGE + variables: + # dotenv variables must be set again here. + F_BRANCH: $F_BRANCH + trigger: + project: caosdb/src/caosdb-julialib + branch: $JULIALIB_REF + # Build the sphinx documentation and make it ready for deployment by Gitlab Pages # Special job for serving a static website. See https://docs.gitlab.com/ee/ci/yaml/README.html#pages .pages_prepare: &pages_prepare diff --git a/CMakeLists.txt b/CMakeLists.txt index 70cae6f2b55e414a4dc0ae867d715a4eaef740fc..5fe2e13d3d24eadf7cd5506965e82ddffda00670 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,11 +20,11 @@ cmake_minimum_required(VERSION 3.13) -set(libcaosdb_VERSION 0.1.3) +set(libcaosdb_VERSION 0.3.0) set(libcaosdb_COMPATIBLE_SERVER_VERSION_MAJOR 0) -set(libcaosdb_COMPATIBLE_SERVER_VERSION_MINOR 7) -set(libcaosdb_COMPATIBLE_SERVER_VERSION_PATCH 3) -set(libcaosdb_COMPATIBLE_SERVER_VERSION_PRE_RELEASE "") +set(libcaosdb_COMPATIBLE_SERVER_VERSION_MINOR 9) +set(libcaosdb_COMPATIBLE_SERVER_VERSION_PATCH 0) +set(libcaosdb_COMPATIBLE_SERVER_VERSION_PRE_RELEASE "SNAPSHOT") project(libcaosdb VERSION ${libcaosdb_VERSION} diff --git a/Makefile b/Makefile index 21cd43348cb545bfbf0acd8985dd0e3a459ca8f1..4be361a56cb09fa5359d5ef03ccff3064b2e4e3d 100644 --- a/Makefile +++ b/Makefile @@ -79,7 +79,7 @@ conan: conan-install conan-create .PHONY: conan doc: - mkdir -p build && cd build && conan install .. -s $(CONAN_SETTINGS) \ + mkdir -p build && cd build && conan install .. --build=missing -s $(CONAN_SETTINGS) \ && cmake .. && cmake --build . --target doc-sphinx \ && echo "The documentation starts at build/doc/sphinx_out/index.html ." .PHONY: doc diff --git a/README.md b/README.md index 7a8326a9059e11e1c3eb99729123634a3a3758ed..43d775c8382f690ac1100285332f6e20a6d32eaf 100644 --- a/README.md +++ b/README.md @@ -23,4 +23,4 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md). * Copyright (C) 2022 Indiscale GmbH <info@indiscale.com> All files in this repository are licensed under a [GNU Affero General Public -License](LICENCE.md) (version 3 or later). +License](LICENSE.md) (version 3 or later). diff --git a/RELEASE_GUIDELINES.md b/RELEASE_GUIDELINES.md index c725ec86fd0fb5f8019da955bbe5999ff47afe25..faa7d4399c10ea4e0b45c48943d122ac15fbef5b 100644 --- a/RELEASE_GUIDELINES.md +++ b/RELEASE_GUIDELINES.md @@ -41,4 +41,8 @@ guidelines of the CaosDB Project 9. Release cppinttests with updated cpplib version 10. Merge `main` back into `dev` and increase patch version by one to begin next - release cycle. Do the same in cppintest. + release cycle. + * update `conanfile.py` + * update `CMakeLists.txt` + * update `CHANGELOG.md` with empty `[Unreleased]` sections. + * Don't forget to update cppintest. diff --git a/conanfile.py b/conanfile.py index cda65824eb827c331d33ae1e57e8430b6ff972ee..906ba04e9b3920f3d5d13d6bc568b0dd7c67696b 100644 --- a/conanfile.py +++ b/conanfile.py @@ -3,7 +3,7 @@ from conans import ConanFile, CMake, tools class CaosdbConan(ConanFile): name = "caosdb" - version = "0.2.0-dev" + version = "0.3.0-dev" license = "AGPL-3.0-or-later" author = "Timm C. Fitschen <t.fitschen@indiscale.com>" url = "https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib.git" @@ -22,10 +22,10 @@ class CaosdbConan(ConanFile): } generators = "cmake" requires = [ - ("grpc/1.45.2"), + ("grpc/1.48.0"), ] build_requires = [ - ("boost/1.77.0"), + ("boost/1.78.0"), ("gtest/1.11.0"), ] exports = ("*.cmake", "*CMakeLists.txt", "*.in", @@ -38,6 +38,7 @@ class CaosdbConan(ConanFile): if self.settings.os == "Windows": del self.options.fPIC self.options["boost"].without_python = True + self.options["boost"].filesystem_version = "3" # def source(self): # self.run("git clone https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib.git") diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index be4e73f31904decf166a523c229b58a0ca47af10..7c73e5991c9369cca78349fa0d8d243971c75497 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -5,42 +5,62 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [Unreleased] - YYYY-MM-DD ## +(*Maintainer*) ### Added -* Simple `User` class and methods for user creation/retrieval/deletion. - ### Changed -* Transaction::ExecuteAsynchronously is actually asynchronous now. -* Removed boost from the headers. Boost is only a build dependency from now on. - ### Deprecated ### Removed ### Fixed -* Calling "GetFileDescriptor().wrapped->path()" after retrieval leads to SegFault. -- #41 Updated Conan version in CI pipeline. - ### Security ### Documentation +## [0.2.1] - 2022-09-22 ## +(Daniel Hornung) + +### Changed ### + +* Updated dependencies +* Simplified implementation code a bit + +## [0.2.0] - 2022-07-13 +(Timm Fitschen) + +### Added + +* Simple `User` class and methods for user creation/retrieval/deletion. +* Added more variants for the `operator<<` of `LoggerOutputStream` (for `bool` + and `std::endl`). + +### Changed + +* Transaction::ExecuteAsynchronously is actually asynchronous now. +* Removed boost from the headers. Boost is only a build dependency from now on. + +### Fixed + +* Calling "GetFileDescriptor().wrapped->path()" after retrieval leads to SegFault. +* #41 Updated Conan version in CI pipeline. + ## [0.1.2] - 2022-05-31 (Florian Spreckelsen) ### Fixed -- #41 Updated Conan version in CI pipeline. +* #41 Updated Conan version in CI pipeline. ## [0.1.1 - 2022-04-12] ### Security -- Bumped zlib dependency to 1.2.12. +* Bumped zlib dependency to 1.2.12. ## [0.1.0 - 2021-12-11] diff --git a/doc/DEPENDENCIES.md b/doc/DEPENDENCIES.md index 690c7305d587bd2ef7a9219b0aa307bcb15c1ce3..81123757ea1e8660d90d4ac2b7456577be763d29 100644 --- a/doc/DEPENDENCIES.md +++ b/doc/DEPENDENCIES.md @@ -3,7 +3,7 @@ ## General ## ``` ->=conan-1.43 (e.g. with `pip install conan`) +>=conan-1.50.0 (e.g. with `pip install conan`) >=cmake-3.13 >=gcc-10.2.0 | >=clang-11 ``` @@ -16,7 +16,7 @@ ``` doxygen ->=python-3.7 +>=python-3.8 >=pip-21.0.1 python packages from the `doc/requirements.txt` file ``` diff --git a/doc/FEATURES.md b/doc/FEATURES.md index 8ca4a13956a6ae5ea25a91c21253c4b68cc7b481..d90a58144c1fd9275f75767319a143a5478b34e3 100644 --- a/doc/FEATURES.md +++ b/doc/FEATURES.md @@ -22,18 +22,28 @@ serve as just that -- minimal testing. ## CaosDB Entitiy API -This library implements a subset of the CaosDB Entitiy API (caosdb.entity.v1) as a client. +This library implements a subset of the CaosDB Entitiy API (caosdb.entity.v1) +as a client. -Current limitations: The implementation does not support mixing retrievals with write-transactions. +Current limitations: The implementation does not support mixing retrievals with +write-transactions. ## CaosDB Info API -This library implements the CaosDB Info API (caosdb.info.v1) as a client without limitations. +This library implements the CaosDB Info API (caosdb.info.v1) as a client +without limitations. + +## CaosDB ACM (Access Control Management) API + +This library implements small parts of the experimental ACM API +(caosdb.acm.v1alpha1) as a client. ## Thread-safety and Concurrency Currently, the library should not be considered thread-safe. The `caosdb::transaction::Transaction` class is designed with an with an -interface ready for concurrent and asyncronous transactions. However, the -functions are actually implemented in a blocking, synchronous way. +interface ready for concurrent and asyncronous transactions. While it is +possible to execute transactions in non-blocking mode and call `GetStatus` +concurrently, it is not possible to use any of the non-const methods of the +`Transaction` class in a thread-safe way. diff --git a/include/caosdb/logging.h b/include/caosdb/logging.h index e50c70f69bc0ed45e8f6a60f78cd11e4142b0568..3fda8e83ac5c164728b2cd156292d22952b70130 100644 --- a/include/caosdb/logging.h +++ b/include/caosdb/logging.h @@ -2,8 +2,8 @@ /* * This file is a part of the CaosDB Project. * - * Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com> - * Copyright (C) 2021 IndiScale GmbH <info@indiscale.com> + * Copyright (C) 2021-2022 Timm Fitschen <t.fitschen@indiscale.com> + * Copyright (C) 2021-2022 IndiScale GmbH <info@indiscale.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -37,6 +37,8 @@ const std::string logger_name = "caosdb::logging"; class LoggerOutputStream { public: LoggerOutputStream(std::string channel, int level); + auto operator<<(std::ostream &(*f)(std::ostream &)) -> LoggerOutputStream &; + auto operator<<(bool msg) -> LoggerOutputStream &; auto operator<<(int msg) -> LoggerOutputStream &; auto operator<<(uint64_t msg) -> LoggerOutputStream &; auto operator<<(int64_t msg) -> LoggerOutputStream &; diff --git a/requirements.txt b/requirements.txt index 171a4c323631116bbd3cfc3019035d77cc1cad6e..f7bf0dbe928a9ca0d29702e7fc2b0895caf77616 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,29 +1,22 @@ -attrs==21.2.0 -bottle==0.12.19 -certifi==2021.10.8 -chardet==4.0.0 -charset-normalizer==2.0.7 -colorama==0.4.4 -conan==1.48.0 -deprecation==2.1.0 -distro==1.6.0 -fasteners==0.16.3 +bottle==0.12.23 +certifi==2022.9.24 +charset-normalizer==2.1.1 +colorama==0.4.6 +conan==1.54.0 +distro==1.7.0 +fasteners==0.18 future==0.18.2 -idna==3.2 -Jinja2==3.1.1 -jsonschema==4.1.0 -MarkupSafe==2.0.1 +idna==3.4 +Jinja2==3.1.2 +MarkupSafe==2.1.1 node-semver==0.6.1 -packaging==21.0 patch-ng==1.17.4 pluginbase==1.0.1 -Pygments==2.10.0 -PyJWT==1.7.1 -pyparsing==2.4.7 -pyrsistent==0.18.0 +Pygments==2.13.0 +PyJWT==2.6.0 python-dateutil==2.8.2 -PyYAML==5.4.1 -requests==2.26.0 +PyYAML==6.0 +requests==2.28.1 six==1.16.0 -tqdm==4.62.3 -urllib3==1.26.7 +tqdm==4.64.1 +urllib3==1.26.12 diff --git a/src/caosdb/connection.cpp b/src/caosdb/connection.cpp index 130370b35daa19f43078d3ff6585b82b4b620162..bab58165b7be0e7580a41adcf5bcb5dbf797ab87 100644 --- a/src/caosdb/connection.cpp +++ b/src/caosdb/connection.cpp @@ -2,8 +2,8 @@ * * This file is a part of the CaosDB Project. * - * Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com> - * Copyright (C) 2021 IndiScale GmbH <info@indiscale.com> + * Copyright (C) 2021-2022 Timm Fitschen <t.fitschen@indiscale.com> + * Copyright (C) 2021-2022 IndiScale GmbH <info@indiscale.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -26,18 +26,17 @@ #include "caosdb/acm/v1alpha1/main.grpc.pb.h" // for AccessControlMan... #include "caosdb/acm/v1alpha1/main.pb.h" // for ListRolesRequest #endif -#include "caosdb/configuration.h" // for ConnectionConfigur... -#include "caosdb/exceptions.h" // for ConfigurationError -#include "caosdb/info.h" // for VersionInfo -#include "caosdb/info/v1/main.grpc.pb.h" // for GeneralInfoService -#include "caosdb/info/v1/main.pb.h" // for GetVersionInfoRequest -#include "caosdb/transaction.h" // for Transaction -#include "caosdb/transaction_status.h" // for TransactionStatus -#include <grpcpp/client_context.h> // for ClientContext -#include <grpcpp/create_channel.h> // for CreateChannel -#include <grpcpp/support/status.h> // for Status -#include <grpcpp/support/status_code_enum.h> // for StatusCode, UNAUTHENTIC... -#include <string> // for string, operator+ +#include "caosdb/configuration.h" // for ConnectionConfigur... +#include "caosdb/exceptions.h" // for ConfigurationError +#include "caosdb/info.h" // for VersionInfo +#include "caosdb/info/v1/main.grpc.pb.h" // for GeneralInfoService +#include "caosdb/info/v1/main.pb.h" // for GetVersionInfoRequest +#include "caosdb/transaction.h" // for Transaction +#include "caosdb/transaction_status.h" // for TransactionStatus +#include <grpcpp/client_context.h> // for ClientContext +#include <grpcpp/create_channel.h> // for CreateChannel +#include <grpcpp/support/status.h> // for Status +#include <string> // for string, operator+ // IWYU pragma: no_include "net/proto2/public/repeated_field.h" namespace caosdb::connection { diff --git a/src/caosdb/file_transmission/download_request_handler.cpp b/src/caosdb/file_transmission/download_request_handler.cpp index 821ed79477045f4e3bf49c061cfac622b814700d..1b0764fa2039b7d4c37ba09fdc03cedf4959736a 100644 --- a/src/caosdb/file_transmission/download_request_handler.cpp +++ b/src/caosdb/file_transmission/download_request_handler.cpp @@ -1,7 +1,7 @@ /* * This file is a part of the CaosDB Project. - * Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com> - * Copyright (C) 2021 IndiScale GmbH <info@indiscale.com> + * Copyright (C) 2021-2022 Timm Fitschen <t.fitschen@indiscale.com> + * Copyright (C) 2021-2022 IndiScale GmbH <info@indiscale.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -47,21 +47,20 @@ * > DEALINGS IN THE SOFTWARE. */ #include "caosdb/file_transmission/download_request_handler.h" -#include "caosdb/logging.h" // for CAOSDB_LOG_TRACE -#include "caosdb/protobuf_helper.h" // for get_arena -#include "caosdb/status_code.h" // for GENERIC_RPC_E... -#include "caosdb/transaction_status.h" // for TransactionStatus -#include <exception> // IWYU pragma: keep -#include <filesystem> // for operator<<, path -#include <google/protobuf/arena.h> // for Arena -#include <grpcpp/client_context.h> // for ClientContext -#include <grpcpp/completion_queue.h> // for CompletionQueue -#include <grpcpp/support/async_stream.h> // for ClientAsyncReader -#include <grpcpp/support/status.h> // for Status -#include <grpcpp/support/status_code_enum.h> // for OK -#include <stdexcept> // for runtime_error -#include <string> // for string, opera... -#include <utility> // for move +#include "caosdb/logging.h" // for CAOSDB_LOG_TRACE +#include "caosdb/protobuf_helper.h" // for get_arena +#include "caosdb/status_code.h" // for GENERIC_RPC_E... +#include "caosdb/transaction_status.h" // for TransactionStatus +#include <exception> // IWYU pragma: keep +#include <filesystem> // for operator<<, path +#include <google/protobuf/arena.h> // for Arena +#include <grpcpp/client_context.h> // for ClientContext +#include <grpcpp/completion_queue.h> // for CompletionQueue +#include <grpcpp/support/async_stream.h> // for ClientAsyncReader +#include <grpcpp/support/status.h> // for Status +#include <stdexcept> // for runtime_error +#include <string> // for string, opera... +#include <utility> // for move // IWYU pragma: no_include <bits/exception.h> // namespace caosdb::transaction { diff --git a/src/caosdb/file_transmission/upload_request_handler.cpp b/src/caosdb/file_transmission/upload_request_handler.cpp index 32bb8132e0b4a966774c5f8111800151895b6ced..57bd224dfe53a57ecb706d74dc1438e143dac641 100644 --- a/src/caosdb/file_transmission/upload_request_handler.cpp +++ b/src/caosdb/file_transmission/upload_request_handler.cpp @@ -1,7 +1,7 @@ /* * This file is a part of the CaosDB Project. - * Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com> - * Copyright (C) 2021 IndiScale GmbH <info@indiscale.com> + * Copyright (C) 2021-2022 Timm Fitschen <t.fitschen@indiscale.com> + * Copyright (C) 2021-2022 IndiScale GmbH <info@indiscale.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -57,7 +57,6 @@ #include <filesystem> // for operator<<, path #include <google/protobuf/arena.h> // for Arena #include <grpcpp/impl/codegen/call_op_set.h> // for WriteOptions -#include <grpcpp/support/status_code_enum.h> // for OK #include <string> // for basic_string #include <utility> // for move // IWYU pragma: no_include <bits/exception.h> diff --git a/src/caosdb/logging.cpp b/src/caosdb/logging.cpp index 7aaedee77696ada264418c104b6c8c28c4bb7b24..ecc34d668971eaa22cd7ff727d8f54c84c2f3bdc 100644 --- a/src/caosdb/logging.cpp +++ b/src/caosdb/logging.cpp @@ -63,6 +63,18 @@ private: LoggerOutputStream::LoggerOutputStream(std::string channel, int level) : channel(std::move(channel)), level(level) {} +auto LoggerOutputStream::operator<<(std::ostream &(*f)(std::ostream &)) -> LoggerOutputStream & { + BOOST_LOG_CHANNEL_SEV(caosdb::logging::logger::get(), this->channel, this->level) << f; + + return *this; +} + +auto LoggerOutputStream::operator<<(bool msg) -> LoggerOutputStream & { + BOOST_LOG_CHANNEL_SEV(caosdb::logging::logger::get(), this->channel, this->level) << msg; + + return *this; +} + auto LoggerOutputStream::operator<<(std::streambuf *msg) -> LoggerOutputStream & { BOOST_LOG_CHANNEL_SEV(caosdb::logging::logger::get(), channel, this->level) << msg; diff --git a/src/caosdb/transaction.cpp b/src/caosdb/transaction.cpp index c75fdeb7fcf5b1a5854464dcabf76c11bb5a4262..ca8338dce4e4b721202e72c3fdecf58339746ee0 100644 --- a/src/caosdb/transaction.cpp +++ b/src/caosdb/transaction.cpp @@ -1,7 +1,7 @@ /* * This file is a part of the CaosDB Project. - * Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com> - * Copyright (C) 2021 IndiScale GmbH <info@indiscale.com> + * Copyright (C) 2021-2022 Timm Fitschen <t.fitschen@indiscale.com> + * Copyright (C) 2021-2022 IndiScale GmbH <info@indiscale.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -32,7 +32,7 @@ #include <filesystem> // for operator<<, path #include <future> // for async, future #include <google/protobuf/arena.h> // for Arena -#include <grpc/impl/codegen/gpr_types.h> // for gpr_timespec +#include <grpc/grpc.h> // for gpr_timespec #include <map> // for map, operator!= #include <memory> // for unique_ptr #include <random> // for mt19937, rand... diff --git a/src/caosdb/unary_rpc_handler.cpp b/src/caosdb/unary_rpc_handler.cpp index 06afc127cecea22b1b805d20a68eab177841e981..6d116eafae7203498ebf431a09d85c184b619191 100644 --- a/src/caosdb/unary_rpc_handler.cpp +++ b/src/caosdb/unary_rpc_handler.cpp @@ -1,7 +1,7 @@ /* * This file is a part of the CaosDB Project. - * Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com> - * Copyright (C) 2021 IndiScale GmbH <info@indiscale.com> + * Copyright (C) 2021-2022 Timm Fitschen <t.fitschen@indiscale.com> + * Copyright (C) 2021-2022 IndiScale GmbH <info@indiscale.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -47,11 +47,10 @@ * > DEALINGS IN THE SOFTWARE. */ #include "caosdb/unary_rpc_handler.h" -#include "caosdb/logging.h" // for CAOSDB_LOG_TRACE -#include "caosdb/status_code.h" // for GENERIC_RPC_E... -#include <exception> // IWYU pragma: keep -#include <grpcpp/support/status_code_enum.h> // for OK -#include <string> // for string, opera... +#include "caosdb/logging.h" // for CAOSDB_LOG_TRACE +#include "caosdb/status_code.h" // for GENERIC_RPC_E... +#include <exception> // IWYU pragma: keep +#include <string> // for string, opera... // IWYU pragma: no_include <bits/exception.h> namespace caosdb::transaction { diff --git a/test/test_transaction.cpp b/test/test_transaction.cpp index e710b6c775615968b567b6efa64ba76e56717c69..77d457c6eee2c5e9d95c53c95c1b2f0a713dcff4 100644 --- a/test/test_transaction.cpp +++ b/test/test_transaction.cpp @@ -1,8 +1,8 @@ /* * This file is a part of the CaosDB Project. * - * Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com> - * Copyright (C) 2021 IndiScale GmbH <info@indiscale.com> + * Copyright (C) 2021-2022 Timm Fitschen <t.fitschen@indiscale.com> + * Copyright (C) 2021-2022 IndiScale GmbH <info@indiscale.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -55,10 +55,10 @@ TEST(test_transaction, create_transaction) { auto transaction = connection.CreateTransaction(); ASSERT_EQ(StatusCode::GO_ON, transaction->RetrieveById("100")); - EXPECT_THROW_MESSAGE(transaction->Execute(), ConnectionError, - "The attempt to execute this transaction was not successful because the " - "connection to the server could not be established. " - "Original message: failed to connect to all addresses"); + EXPECT_THROW_STARTS_WITH(transaction->Execute(), ConnectionError, + "The attempt to execute this transaction was not successful because the " + "connection to the server could not be established. " + "Original message: failed to connect to all addresses"); } TEST(test_transaction, test_multi_result_set) {