Skip to content
Snippets Groups Projects
Verified Commit b455f414 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Merge branch 'dev' into f-role

parents fb0794f8 ce3a6517
Branches f-role
No related tags found
No related merge requests found
Pipeline #30639 failed
Pipeline: caosdb-cppinttest

#30645

    Showing with 202 additions and 107 deletions
    ......@@ -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
    ......
    ......@@ -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}
    ......
    ......@@ -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
    ......
    ......@@ -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).
    ......@@ -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.
    ......@@ -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")
    ......
    ......@@ -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]
    ......
    ......@@ -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
    ```
    ......
    ......@@ -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.
    ......@@ -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 &;
    ......
    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
    ......@@ -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
    ......@@ -36,7 +36,6 @@
    #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+
    // IWYU pragma: no_include "net/proto2/public/repeated_field.h"
    ......
    /*
    * 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
    ......@@ -58,7 +58,6 @@
    #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
    ......
    /*
    * 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>
    ......
    ......@@ -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;
    ......
    /*
    * 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...
    ......
    /*
    * 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
    ......@@ -50,7 +50,6 @@
    #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...
    // IWYU pragma: no_include <bits/exception.h>
    ......
    /*
    * 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,7 +55,7 @@ TEST(test_transaction, create_transaction) {
    auto transaction = connection.CreateTransaction();
    ASSERT_EQ(StatusCode::GO_ON, transaction->RetrieveById("100"));
    EXPECT_THROW_MESSAGE(transaction->Execute(), ConnectionError,
    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");
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment