Skip to content

Commit

Permalink
enh(#323): Enforce collection registration format
Browse files Browse the repository at this point in the history
- Better than collectors silently not being registered even when enabled...
  • Loading branch information
jharwell committed Apr 26, 2023
1 parent 2c83e44 commit 6cf0414
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 192 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,16 @@ jobs:
if [ "${{ github.ref }}" = "refs/heads/devel" ]; then
TAG_VERSION=${PACKAGE_VERSION}.beta
TAG_MESSAGE="Development release ${TAG_VERSION}"
git tag ${TAG_VERSION} -m "${TAG_MESSAGE}" -f
git push -o ci.skip origin ${TAG_VERSION} -f
else
TAG_VERSION=${PACKAGE_VERSION}
TAG_MESSAGE="Release ${TAG_VERSION}"
git tag ${TAG_VERSION} -m "${TAG_MESSAGE}"
git push -o ci.skip origin ${TAG_VERSION}
fi
git tag ${TAG_VERSION} -m "${TAG_MESSAGE}"
git push -o ci.skip origin ${TAG_VERSION}
deploy-release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -162,6 +166,11 @@ jobs:
- name: Deploy to PPA
shell: bash
run: |
VERSION_MAJOR=$(sed -nE 's/.*PROJECT_VERSION_MAJOR ([0-9]+).*/\1/p' cmake/project-local.cmake)
VERSION_MINOR=$(sed -nE 's/.*PROJECT_VERSION_MINOR ([0-9]+).*/\1/p' cmake/project-local.cmake)
VERSION_PATCH=$(sed -nE 's/.*PROJECT_VERSION_PATCH ([0-9]+).*/\1/p' cmake/project-local.cmake)
PACKAGE_VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH
cd ppa
cp ../build/*.deb .
ls -al ..
Expand Down
171 changes: 0 additions & 171 deletions .gitlab-ci.yml

This file was deleted.

16 changes: 8 additions & 8 deletions cmake/project-local.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set(rcppsw_CHECK_LANGUAGE "CXX")
# Each conference tag=minor increment. Each minor feature added=patch increment.
set(PROJECT_VERSION_MAJOR 1)
set(PROJECT_VERSION_MINOR 4)
set(PROJECT_VERSION_PATCH 1)
set(PROJECT_VERSION_PATCH 2)
set(rcppsw_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")

if (NOT DEFINED RCPPSW_AL_MT_SAFE_TYPES)
Expand Down Expand Up @@ -147,7 +147,7 @@ ExternalProject_Add(ticpp
SOURCE_DIR ${CMAKE_BINARY_DIR}/ticpp-src
BINARY_DIR ${CMAKE_BINARY_DIR}/ticpp-build
)
add_library(ticpp_ticpp::ticpp_ticpp STATIC IMPORTED GLOBAL)
add_library(ticpp_ticpp::ticpp_ticpp SHARED IMPORTED GLOBAL)
set_target_properties(ticpp_ticpp::ticpp_ticpp PROPERTIES
IMPORTED_LOCATION ${LIBRA_DEPS_PREFIX}/lib/libticpp.a
)
Expand All @@ -163,7 +163,7 @@ if (NOT ${LIBRA_RTD_BUILD})
# set(Boost_USE_MULTITHREADED OFF)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.71.0
COMPONENTS
COMPONENTS
system
thread
graph
Expand All @@ -189,7 +189,7 @@ endforeach()
set(rcppsw_LIBRARY rcppsw)
add_library(
${rcppsw_LIBRARY}
STATIC
SHARED
${rcppsw_components_SRC}
)

Expand All @@ -205,8 +205,8 @@ set_target_properties(${rcppsw_LIBRARY}
# built as a shared library).
set_target_properties(${rcppsw_LIBRARY}
PROPERTIES
VERSION ${RCPPSW_VERSION}
SOVERSION ${RCPPSW_VERSION}
VERSION ${rcppsw_VERSION}
SOVERSION ${rcppsw_VERSION}
)

########################################
Expand Down Expand Up @@ -270,9 +270,9 @@ target_compile_definitions(${rcppsw_LIBRARY}
libra_configure_exports_as(${rcppsw_LIBRARY} ${CMAKE_INSTALL_PREFIX})
libra_register_target_for_install(${rcppsw_LIBRARY} ${CMAKE_INSTALL_PREFIX})
libra_register_headers_for_install(include/${rcppsw_LIBRARY} ${CMAKE_INSTALL_PREFIX})
libra_register_copyright_for_install(${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
libra_register_copyright_for_install(${rcppsw_LIBRARY} ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/changelog)
libra_register_changelog_for_install(${CMAKE_CURRENT_SOURCE_DIR}/changelog)
libra_register_changelog_for_install(${rcppsw_LIBRARY} ${CMAKE_CURRENT_SOURCE_DIR}/changelog)
endif()

libra_configure_cpack(
Expand Down
5 changes: 2 additions & 3 deletions include/rcppsw/metrics/config/xml/base_sink_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ class base_sink_parser : public rer::client<base_sink_parser>,
*/
bool is_collector_name(const ticpp::Attribute& attr) const RCPPSW_COLD;

void output_mode_parse(const ticpp::Element& element,
void output_mode_parse(const ticpp::Element& element,
rmetrics::config::output_mode_config* config);
};

} /* namespace rcppsw::metrics::xml, config */

} /* namespace rcppsw::metrics::xml::config */
7 changes: 3 additions & 4 deletions include/rcppsw/metrics/creatable_collector_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,15 @@ struct collector_registration_spec {
*
* - The set of output modes that are valid for the collector.
*
* - Which sink the collector is associated with (only necessary if the same
* collector will be used with multiple sinks). If omitted for a single
* collector which has multiple sinks, the behavior is undefined.
* - Which sink the collector is associated with. Only necessary if the same
* collector will be used with multiple sinks, but enforced for consistency.
*/
struct creatable_collector_spec {
creatable_collector_spec(const std::type_index& collector_id_in,
const std::string& input_name_in,
const std::string& scoped_name_in,
const rmetrics::output_mode& valid_modes_in,
std::type_index sink_id_in = std::type_index(typeid(nullptr)))
const std::type_index& sink_id_in)
: collector_id(collector_id_in),
input_name(input_name_in),
scoped_name(scoped_name_in),
Expand Down
1 change: 1 addition & 0 deletions include/rcppsw/metrics/register_with_sink.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class register_with_sink : public rer::client<
if (it->sink_id != sink_id) {
continue;
}

auto spec = this->template calc_registration_spec<TSinkType>(
m_manager,
config,
Expand Down
3 changes: 2 additions & 1 deletion include/rcppsw/patterns/visitor/polymorphic_visitable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
/*******************************************************************************
* Namespaces/Decls
******************************************************************************/
namespace rcppsw::patterns::visitor::detail {
namespace rcppsw::patterns::visitor {
namespace detail {

/*******************************************************************************
* Class Definitions
Expand Down
2 changes: 1 addition & 1 deletion libra
2 changes: 1 addition & 1 deletion src/metrics/config/xml/base_sink_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ bool base_sink_parser::is_collector_name(const ticpp::Attribute& attr) const {
return non_names.end() == std::find(non_names.begin(), non_names.end(), name);
} /* is_collector_name() */

} /* namespace rcppsw::metrics::xml, config */
} /* namespace rcppsw::metrics::xml::config */
2 changes: 1 addition & 1 deletion src/metrics/config/xml/metrics_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ void metrics_parser::parse(const ticpp::Element& node) {
}
} /* parse() */

} /* namespace rcppsw::metrics::xml, config */
} /* namespace rcppsw::metrics::xml::config */

0 comments on commit 6cf0414

Please sign in to comment.