Skip to content

Commit 15ee433

Browse files
kenneth-jiaalex-q-chen
authored andcommitted
Update CI and fix failures
1 parent a146d10 commit 15ee433

18 files changed

+59
-41
lines changed

.clang-tidy

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Checks: "*,\
44
-llvmlibc-restrict-system-libc-headers,\
55
-llvmlibc-callee-namespace,\
66
-llvmlibc-implementation-in-namespace,\
7+
-llvmlibc-inline-function-decl,\
78
-altera-*,\
89
-fuchsia-*,\
910
-google-readability-namespace-comments,\
@@ -14,6 +15,7 @@ Checks: "*,\
1415
-modernize-deprecated-headers,\
1516
-modernize-use-trailing-return-type,\
1617
-modernize-concat-nested-namespaces,\
18+
-modernize-type-traits,\
1719
-hicpp-special-member-functions,\
1820
-hicpp-vararg,\
1921
-hicpp-no-malloc,\
@@ -36,15 +38,20 @@ Checks: "*,\
3638
-cppcoreguidelines-pro-type-union-access,\
3739
-misc-non-private-member-variables-in-classes,\
3840
-misc-no-recursion,\
41+
-misc-include-cleaner,\
3942
-readability-magic-numbers,\
4043
-readability-implicit-bool-conversion,\
4144
-readability-braces-around-statements,\
4245
-readability-isolate-declaration,\
4346
-readability-identifier-length,\
4447
-readability-function-cognitive-complexity,\
48+
-readability-avoid-nested-conditional-operator,\
4549
-bugprone-unused-return-value,\
4650
-bugprone-easily-swappable-parameters,\
4751
-bugprone-exception-escape,\
52+
-bugprone-optional-value-conversion,\
4853
-cert-err58-cpp,\
54+
-performance-avoid-endl,\
55+
-performance-enum-size,\
4956
-clang-analyzer-optin.performance.Padding"
5057

.github/workflows/kafka_api_bazel_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
env:
1010
KAFKA_SRC_LINK: https://archive.apache.org/dist/kafka/3.3.1/kafka_2.13-3.3.1.tgz
1111
CPU_CORE_NUM: 2
12-
LIBRDKAFKA_TAG: v2.0.2
12+
LIBRDKAFKA_TAG: v2.4.0
1313

1414
jobs:
1515
kafka-api-bazel-build:

.github/workflows/kafka_api_ci_tests.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
env:
1010
KAFKA_SRC_LINK: https://archive.apache.org/dist/kafka/3.3.1/kafka_2.13-3.3.1.tgz
1111
CPU_CORE_NUM: 2
12-
LIBRDKAFKA_TAG: v2.0.2
12+
LIBRDKAFKA_TAG: v2.4.0
1313
BUILD_SUB_DIR: builds/sub-build
1414

1515
jobs:
@@ -49,48 +49,48 @@ jobs:
4949
test-labels: unit|integration
5050
enable-ut-stubs: true
5151

52-
- os: ubuntu-22.04
52+
- os: ubuntu-24.04
5353
build-cxx: g++
5454
build-type: Release
5555
test-labels: robustness
5656

57-
- os: ubuntu-22.04
57+
- os: ubuntu-24.04
5858
build-cxx: g++
5959
build-type: Release
6060
cxx-standard: 14
6161
test-labels: unit|integration
6262

63-
- os: ubuntu-22.04
63+
- os: ubuntu-24.04
6464
build-cxx: g++
6565
check-option: asan
6666
test-labels: unit|integration
6767

68-
- os: ubuntu-22.04
68+
- os: ubuntu-24.04
6969
build-cxx: g++
7070
check-option: tsan
7171
test-labels: unit|integration
7272

73-
- os: ubuntu-22.04
73+
- os: ubuntu-24.04
7474
build-cxx: g++
7575
check-option: ubsan
7676
test-labels: unit|integration
7777

78-
- os: ubuntu-22.04
78+
- os: ubuntu-24.04
7979
build-cxx: clang++
8080
test-labels: unit|integration
8181
generate-doc: true
8282
with-installation: true
8383

84-
- os: ubuntu-22.04
84+
- os: ubuntu-24.04
8585
build-cxx: clang++
8686
check-option: clang-tidy
8787
enable-ut-stubs: true
8888

89-
- os: ubuntu-20.04
89+
- os: ubuntu-22.04
9090
build-cxx: g++
9191
test-labels: unit|integration
9292

93-
- os: ubuntu-20.04
93+
- os: ubuntu-22.04
9494
build-cxx: clang++
9595
test-labels: robustness
9696

@@ -155,8 +155,7 @@ jobs:
155155
156156
# 6. Install tools to generate document
157157
if [ ${GENERATE_DOC} ]; then
158-
sudo apt install -y python3-pip
159-
sudo pip3 install markdown
158+
sudo apt install -y python3-markdown
160159
sudo apt install -y doxygen
161160
fi
162161
@@ -300,15 +299,17 @@ jobs:
300299
301300
# Install googletest
302301
vcpkg install gtest
303-
cp -v "C:\VCPKG\INSTALLED\x86-windows\lib\manual-link\gtest_main*" "C:\VCPKG\INSTALLED\x86-windows\lib\"
304-
cp -v "C:\VCPKG\INSTALLED\x86-windows\lib\manual-link\gtest_main*" "C:\VCPKG\INSTALLED\x86-windows\lib\"
302+
303+
cp -v "C:\VCPKG\INSTALLED\x64-windows\lib\manual-link\gtest_main*" "C:\VCPKG\INSTALLED\x64-windows\lib\"
304+
cp -v "C:\VCPKG\INSTALLED\x64-windows\lib\manual-link\gtest_main*" "C:\VCPKG\INSTALLED\x64-windows\lib\"
305305
306306
# Install boost headers/libraries
307307
vcpkg install boost-optional
308308
vcpkg install boost-algorithm
309309
vcpkg install boost-program-options
310310
311-
cp -v "C:\VCPKG\INSTALLED\x86-windows\lib\boost_program_options-vc140-mt.lib" "C:\VCPKG\INSTALLED\x86-windows\lib\boost_program_options.lib"
311+
ls "C:\VCPKG\INSTALLED\x64-windows\lib"
312+
cp -v "C:\VCPKG\INSTALLED\x64-windows\lib\boost_program_options-vc144-mt-x64-1_85.lib" "C:\VCPKG\INSTALLED\x64-windows\lib\boost_program_options.lib"
312313
313314
# Install rapidjson
314315
vcpkg install rapidjson
@@ -319,13 +320,13 @@ jobs:
319320
run: |
320321
cd $Env:BUILD_SUB_DIR
321322
322-
$Env:GTEST_ROOT='C:\VCPKG\INSTALLED\x86-windows\'
323-
$Env:BOOST_ROOT='C:\VCPKG\INSTALLED\x86-windows\'
324-
$Env:LIBRDKAFKA_INCLUDE_DIR='C:\VCPKG\INSTALLED\x86-windows\include\'
325-
$Env:LIBRDKAFKA_LIBRARY_DIR='C:\VCPKG\INSTALLED\x86-windows\lib\'
326-
$Env:RAPIDJSON_INCLUDE_DIRS='C:\VCPKG\INSTALLED\x86-windows\include\'
323+
$Env:GTEST_ROOT='C:\VCPKG\INSTALLED\x64-windows\'
324+
$Env:BOOST_ROOT='C:\VCPKG\INSTALLED\x64-windows\'
325+
$Env:LIBRDKAFKA_INCLUDE_DIR='C:\VCPKG\INSTALLED\x64-windows\include\'
326+
$Env:LIBRDKAFKA_LIBRARY_DIR='C:\VCPKG\INSTALLED\x64-windows\lib\'
327+
$Env:RAPIDJSON_INCLUDE_DIRS='C:\VCPKG\INSTALLED\x64-windows\include\'
327328
328-
cmake -B ./ -A Win32 -S ../.. "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
329+
cmake -B ./ -A x64 -S ../.. "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
329330
330331
- name: Build
331332
run: |

.github/workflows/kafka_api_demo_conan_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
- name: Prepare
3030
run: |
31-
pip3 install conan==1.59.0
31+
pip3 install conan==1.64.1
3232
3333
- name: Build (non-windows)
3434
if: ${{!contains(matrix.os, 'windows')}}

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if (NOT parent_directory)
77
set(cppkafka_master_project ON)
88
# Use Strict Options
99
if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
10-
add_compile_options("-Wall" "-Werror" "-Wextra" "-Wshadow" "-Wno-unused-result")
10+
add_compile_options("-Wall" "-Werror" "-Wextra" "-Wshadow" "-Wno-unused-result" "-Wno-array-bounds")
1111
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
1212
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
1313
endif ()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ About the *Modern C++ Kafka API*
66

77
The [modern-cpp-kafka API](http://opensource.morganstanley.com/modern-cpp-kafka/doxygen/annotated.html) is a layer of ***C++*** wrapper based on [librdkafka](https://github.com/confluentinc/librdkafka) (the ***C*** part only), with high quality, but more friendly to users.
88

9-
- By now, [modern-cpp-kafka](https://github.com/morganstanley/modern-cpp-kafka) is compatible with [librdkafka v2.0.2](https://github.com/confluentinc/librdkafka/releases/tag/v2.0.2).
9+
- By now, [modern-cpp-kafka](https://github.com/morganstanley/modern-cpp-kafka) is compatible with [librdkafka v2.4.0](https://github.com/confluentinc/librdkafka/releases/tag/v2.4.0).
1010

1111

1212
```

examples/example_ProducerRecordHeaders.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
#include <kafka/KafkaProducer.h>
1+
#include <kafka/ProducerRecord.h>
2+
#include <kafka/Types.h>
23

4+
#include <cstddef>
35
#include <iostream>
46
#include <string>
57

examples/kafka_auto_commit_consumer.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "kafka/KafkaConsumer.h"
22

3+
#include <chrono>
34
#include <iostream>
45
#include <string>
56

include/kafka/Log.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ template <std::size_t MAX_CAPACITY>
4343
class LogBuffer
4444
{
4545
public:
46-
LogBuffer():_wptr(_buf.data()) { _buf[0] = 0; } // NOLINT
46+
LogBuffer() { clear(); }
4747

4848
LogBuffer& clear()
4949
{
50-
_wptr = _buf.data();
5150
_buf[0] = 0;
51+
_wptr = _buf.data();
5252
return *this;
5353
}
5454

@@ -72,7 +72,7 @@ class LogBuffer
7272

7373
private:
7474
std::array<char, MAX_CAPACITY> _buf;
75-
char* _wptr;
75+
char* _wptr = nullptr;
7676
};
7777

7878

include/kafka/addons/KafkaMetrics.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <rapidjson/writer.h>
99

1010
#include <algorithm>
11+
#include <cstdint>
1112
#include <iostream>
1213
#include <sstream>
1314
#include <stdexcept>

0 commit comments

Comments
 (0)