Skip to content

Commit

Permalink
Merge from main, fix merge conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr Ivanov <[email protected]>
  • Loading branch information
alexander-e1off committed Oct 14, 2024
2 parents 88cd3df + c6c332e commit f853ebf
Show file tree
Hide file tree
Showing 130 changed files with 6,796 additions and 5,358 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ext/check_pr_title.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright 2024 Bloomberg Finance L.P.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Script for checking PR title.
The script expects PR_TITLE environment variable to be set as an input parameter.
Usage:
export PR_TITLE="<...>"
python3 check_pr_title.py
"""
import os


def check_pr_title():
title = os.environ.get("PR_TITLE")
if title is None or len(title) == 0:
raise RuntimeError(
"This script expects a non-empty environment variable PR_TITLE set"
)
title = title.lower()
valid_prefixes = [
"fix",
"feat",
"perf",
"ci",
"build",
"revert",
"ut",
"it",
"doc",
"refactor",
"misc",
"test",
]
if not any(title.startswith(prefix.lower()) for prefix in valid_prefixes):
raise RuntimeError(
'PR title "{}" doesn\'t start with a valid prefix, allowed prefixes: {}'.format(
title, " ".join(valid_prefixes)
)
)


if __name__ == "__main__":
check_pr_title()
25 changes: 25 additions & 0 deletions .github/workflows/pr-title-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PR title check

on:
pull_request:
types:
- "opened"
- "reopened"
- "synchronize"
- "labeled"
- "unlabeled"
- "edited"

jobs:
pr_title_check:
runs-on: ubuntu-latest
name: PR Title Check
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: pr title check
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
python3 ${{ github.workspace }}/.github/workflows/ext/check_pr_title.py
10 changes: 0 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,6 @@ else()
endif()
endif()

# TBD: TEMPORARY >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
if (NOT installBMQ)
# Enable MSG GroupId public APIs ONLY if not doing a DPKG build (i.e., a
# release) of libbmq; until the feature is fully implemented.
add_definitions("-DBMQ_ENABLE_MSG_GROUPID")
else()
message(STATUS "Message GroupId APIs *NOT* exposed!")
endif()
# TBD: TEMPORARY <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

# -----------------------------------------------------------------------------
# PROJECTS
# -----------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,8 @@ INPUT_FILE_ENCODING =
FILE_PATTERNS = *.c \
*.cpp \
*.h \
*.md
*.md \
*.dox

# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
@dir bmqa

@brief The `BMQA` (BlazingMQ API) package provides applications a public API

The `bmqa` package provides the public API of the BlazingMQ SDK for
applications to use.
*/
11 changes: 4 additions & 7 deletions src/groups/bmq/bmqa/bmqa_closequeuestatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,15 @@ namespace bmqa {
class CloseQueueStatus {
private:
// DATA

/// QueueId associated with the open queue operation
QueueId d_queueId;
// queueId associated with the open
// queue operation

/// Result code of the operation (success, failure)
bmqt::CloseQueueResult::Enum d_result;
// Result code of the operation
// (success, failure)

/// Optional string with a human readable description of the error, if any
bsl::string d_errorDescription;
// Optional string with a human
// readable description of the error,
// if any

public:
// TRAITS
Expand Down
11 changes: 4 additions & 7 deletions src/groups/bmq/bmqa/bmqa_configurequeuestatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,15 @@ namespace bmqa {
class ConfigureQueueStatus {
private:
// DATA

/// QueueId associated with the open queue operation
QueueId d_queueId;
// queueId associated with the open
// queue operation

/// Status code of the operation (success, failure)
bmqt::ConfigureQueueResult::Enum d_result;
// Status code of the operation
// (success, failure)

/// Optional string with a human readable description of the error, if any
bsl::string d_errorDescription;
// Optional string with a human
// readable description of the error,
// if any

public:
// TRAITS
Expand Down
24 changes: 10 additions & 14 deletions src/groups/bmq/bmqa/bmqa_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,30 +101,25 @@ class MessageProperties;
/// `bmqa::MessageIterator.nextMessage()`.
struct MessageImpl {
// PUBLIC DATA

/// Pointer to the Event this message is associated with
bmqimp::Event* d_event_p;
// Pointer to the Event this message is
// associated with

/// May point to a bmqimp::Event (in case this Message is a clone)
bsl::shared_ptr<bmqimp::Event> d_clonedEvent_sp;
// May point to a bmqimp::Event (in case
// this Message is a clone)

/// QueueId this message is associated with
bmqa::QueueId d_queueId;
// QueueId this message is associated
// with

/// CorrelationId this message is associated with
bmqt::CorrelationId d_correlationId;
// CorrelationId this message is
// associated with

/// SubscriptionHandle this message is associated with
bmqt::SubscriptionHandle d_subscriptionHandle;
// SubscriptionHandle this message is
// associated with

#ifdef BMQ_ENABLE_MSG_GROUPID
/// Optional GroupId this message is associated with
bsl::string d_groupId;
// Optional Group Id this message is
// associated with
#endif
};

Expand All @@ -136,11 +131,12 @@ struct MessageImpl {
class MessageConfirmationCookie {
private:
// DATA

/// QueueID associated to this cookie
bmqa::QueueId d_queueId;
// QueueID associated to this cookie

/// GUID associated to this cookie
bmqt::MessageGUID d_guid;
// GUID associated to this cookie

public:
// CREATORS
Expand Down
15 changes: 8 additions & 7 deletions src/groups/bmq/bmqa/bmqa_messageeventbuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,30 +284,31 @@ namespace bmqa {
/// to expose them publicly).
struct MessageEventBuilderImpl {
// PUBLIC DATA
MessageEvent d_msgEvent; // This is needed so that 'getMessageEvent()' can
// return a const ref.

Message d_msg; // This is needed so that 'startMessage()' can
// return a ref.
/// This is needed so that `getMessageEvent()` can return a const ref.
MessageEvent d_msgEvent;

/// This is needed so that `startMessage()` can return a ref.
Message d_msg;

bsl::shared_ptr<bmqp::MessageGUIDGenerator> d_guidGenerator_sp;
// GUID generator object.
bsl::shared_ptr<bmqp::MessageGUIDGenerator> d_guidGenerator_sp;

int d_messageCountFinal;
// The final number of messages in the current 'd_msgEvent' cached on
// switching this MessageEvent from WRITE to READ mode.
// This cached value exists because we are not able to access the
// underlying PutEventBuilder once downgraded to READ.
// CONTRACT: the stored value is correct every moment when in READ mode,
// and the value is not guaranteed to be correct when in WRITE mode.
int d_messageCountFinal;

int d_messageEventSizeFinal;
// The final message event size of the current 'd_msgEvent' cached on
// switching this MessageEvent from WRITE to READ mode.
// This cached value exists because we are not able to access the
// underlying PutEventBuilder once downgraded to READ.
// CONTRACT: the stored value is correct every moment when in READ mode,
// and the value is not guaranteed to be correct when in WRITE mode.
int d_messageEventSizeFinal;
};

// =========================
Expand Down
18 changes: 9 additions & 9 deletions src/groups/bmq/bmqa/bmqa_messageiterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ namespace bmqa {
/// without publicly exposing private members.
struct MessageIteratorImpl {
// PUBLIC DATA
bmqimp::Event* d_event_p; // Raw pointer to the event

bmqa::Message d_message; // A 'Message', representing a view to the
// current message pointing at by this iterator.
// This is so that 'message' can return a 'const
// Message&' to clearly indicate the lifetime of
// the Message, and so that we only create one
// such object per MessageIterator.
/// Raw pointer to the event
bmqimp::Event* d_event_p;

/// A `Message`, representing a view to the current message pointing at by
/// this iterator. This is so that `message` can return a 'const Message&'
/// to clearly indicate the lifetime of the Message, and so that we only
/// create one such object per MessageIterator.
bmqa::Message d_message;

/// Position of `d_message` in the underlying message event.
int d_messageIndex;
// Position of 'd_message' in the underlying
// message event.
};

// =====================
Expand Down
40 changes: 18 additions & 22 deletions src/groups/bmq/bmqa/bmqa_messageproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ class MessageProperties {
private:
// PRIVATE CONSTANTS

// Constant representing the maximum size of a
// `bmqp::MessageProperties` object, so that the below AlignedBuffer
// is big enough.
/// Constant representing the maximum size of a
/// `bmqp::MessageProperties` object, so that the below AlignedBuffer
/// is big enough.
static const int k_MAX_SIZEOF_BMQP_MESSAGEPROPERTIES = 184;

// PRIVATE TYPES
Expand All @@ -107,18 +107,15 @@ class MessageProperties {

private:
// DATA

/// Pointer to the implementation object in `d_buffer`, providing a
/// shortcut type safe cast to that object. This variable *must* *be* the
/// first member of this class, as other components in bmqa package may
/// reinterpret_cast to that variable.
mutable bmqp::MessageProperties* d_impl_p;
// Pointer to the implementation object
// in 'd_buffer', providing a shortcut
// type safe cast to that object. This
// variable *must* *be* the first
// member of this class, as other
// components in bmqa package may
// reinterpret_cast to that variable.

/// Buffer containing the implementation object, maximally aligned.
ImplBuffer d_buffer;
// Buffer containing the implementation
// object, maximally aligned.

bslma::Allocator* d_allocator_p;

Expand All @@ -128,21 +125,20 @@ class MessageProperties {
/// Maximum number of properties that can appear in a `bmqa::Message`.
static const int k_MAX_NUM_PROPERTIES = 255;

/// Maximum length of all the properties (including their names, values
/// and the wire protocol overhead). Note that this value is just under
/// 64 MB.
static const int k_MAX_PROPERTIES_AREA_LENGTH = (64 * 1024 * 1024) - 8;
// Maximum length of all the properties (including their names, values
// and the wire protocol overhead). Note that this value is just under
// 64 MB.

/// Maximum length of a property name.
static const int k_MAX_PROPERTY_NAME_LENGTH = 4095;

static const int k_MAX_PROPERTY_VALUE_LENGTH =
67104745; // ~64 MB
// Maximum length of a property value. Note that this value
// is just under 64 MB. Also note that this value is
// calculated assuming that there is only one property and
// property's name has maximum allowable length, and also
// takes into consideration the protocol overhead.
/// ~64 MB
/// Maximum length of a property value. Note that this value is just under
/// 64 MB. Also note that this value is calculated assuming that there is
/// only one property and property's name has maximum allowable length, and
/// also takes into consideration the protocol overhead.
static const int k_MAX_PROPERTY_VALUE_LENGTH = 67104745;

public:
// TRAITS
Expand Down
Loading

0 comments on commit f853ebf

Please sign in to comment.