MINIFICPP-2850 Finalize stable API before 1.0#2205
Conversation
There was a problem hiding this comment.
Pull request overview
This PR finalizes the “stable” MiNiFi C/C++ extension API surface in preparation for a 1.0 release by renaming and normalizing exported C symbols/headers, updating the C++ extension framework wrappers, and migrating extensions/tests to the new API (including new metrics reporting and trigger-when-empty control paths).
Changes:
- Renamed/normalized the C API (header/DEF exports/symbol names) and updated consumers across the codebase.
- Replaced the previous “calculateMetrics” callback path with
minifi_process_context_report_metrics, and addedminifi_process_context_set_trigger_when_empty. - Updated extension loading/verification, documentation, and release packaging to use the new stable API artifacts.
Reviewed changes
Copilot reviewed 86 out of 86 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| minifi-api/minifi-c-api.def | Removed legacy Windows DEF export list (old symbol names). |
| minifi-api/minifi-api.def | Added new Windows DEF export list for the renamed stable API. |
| minifi-api/include/minifi-cpp/core/ProcessorApi.h | Added setTriggerWhenEmpty to the processor API interface. |
| minifi-api/include/minifi-cpp/core/ControllerServiceType.h | Removed minifiSystemControllerServiceType helper; tightened ctor explicitness. |
| minifi-api/include/minifi-c/minifi-c.h | Removed old C API header. |
| minifi-api/include/minifi-c/minifi-api.h | Added new stable C API header (snake_case structs/functions). |
| minifi-api/common/include/minifi-cpp/io/StreamCallback.h | Updated includes/types to the new C API names. |
| minifi-api/CMakeLists.txt | Updated Windows import-lib generation to use minifi-api.def. |
| libminifi/test/libtest/unit/ContentRepositoryDependentTests.h | Updated include to new stable C API header. |
| libminifi/test/integration/extension-verification-test/ExtensionVerificationTests.cpp | Updated extension init symbol names in tests. |
| libminifi/test/integration/extension-verification-test/CreateNotCalled.cpp | Updated test extension symbols/types to new API names. |
| libminifi/test/integration/extension-verification-test/CppApiExtension.cpp | Updated C++ extension init symbol/type usage. |
| libminifi/test/integration/extension-verification-test/CApiExtension.cpp | Updated C extension init symbol/type usage. |
| libminifi/src/utils/CProcessor.cpp | Switched custom metrics retrieval to use reported-metrics storage. |
| libminifi/src/minifi-api.cpp | Implemented renamed C API entry points; added context metric reporting and trigger-empty setter. |
| libminifi/src/core/state/nodes/AgentInformation.cpp | Updated include to new stable C API header. |
| libminifi/src/core/ProcessSession.cpp | Updated include to new stable C API header. |
| libminifi/src/core/Processor.cpp | Added forwarding Processor::setTriggerWhenEmpty. |
| libminifi/src/core/extension/Extension.cpp | Updated extension loader symbol names (minifi_init_*, minifi_api_version). |
| libminifi/src/core/extension/ApiVersion.cpp | Updated include to new stable C API header. |
| libminifi/include/utils/CProcessor.h | Updated callbacks/types to new C API; added internal trigger-when-empty/metrics wiring. |
| libminifi/include/utils/CControllerService.h | Updated callbacks/types to new C API. |
| libminifi/include/core/Processor.h | Added setTriggerWhenEmpty on Processor. |
| libminifi/include/core/extension/Extension.h | Updated includes to new stable C API header. |
| extensions/stable-api-testing/ZooProcessor.h | Updated return types to minifi_status. |
| extensions/stable-api-testing/ZooProcessor.cpp | Updated return types to minifi_status. |
| extensions/stable-api-testing/ExtensionInitializer.cpp | Updated exported symbols/types to new stable API names. |
| extensions/stable-api-testing/AnimalControllerServices.h | Updated return types to minifi_status. |
| extensions/stable-api-testing/AnimalControllerServices.cpp | Updated return types to minifi_status. |
| extensions/sftp/SFTPLoader.cpp | Updated C++ extension init symbol/type usage and includes ordering. |
| extensions/python/pythonloader/PyProcLoader.cpp | Updated init symbol and config access to new C API names. |
| extensions/python/pythonlibloader/PythonLibLoader.cpp | Updated init symbol and config access to new C API names; include ordering. |
| extensions/llamacpp/processors/RunLlamaCppInference.h | Updated stable API overrides; removed old metrics callback override. |
| extensions/llamacpp/processors/RunLlamaCppInference.cpp | Reports metrics via ProcessContext::reportMetrics() on trigger. |
| extensions/llamacpp/ExtensionInitializer.cpp | Updated exported symbols/types to new stable API names. |
| extensions/kafka/tests/PublishKafkaTests.cpp | Updated mock flow-file type name. |
| extensions/kafka/PublishKafka.h | Updated overrides to minifi_status. |
| extensions/kafka/PublishKafka.cpp | Updated overrides to minifi_status. |
| extensions/kafka/KafkaProcessorBase.h | Updated stable API include name. |
| extensions/kafka/ExtensionInitializer.cpp | Updated exported symbols/types to new stable API names. |
| extensions/kafka/ConsumeKafka.h | Updated overrides and helpers to minifi_status. |
| extensions/kafka/ConsumeKafka.cpp | Updated trigger-when-empty usage to new context API; status renames. |
| extensions/gcp/processors/PutGCSObject.h | Updated overrides to minifi_status. |
| extensions/gcp/processors/PutGCSObject.cpp | Updated status comparisons/types to minifi_status. |
| extensions/gcp/processors/ListGCSBucket.h | Updated overrides to minifi_status. |
| extensions/gcp/processors/ListGCSBucket.cpp | Updated status comparisons/types to minifi_status. |
| extensions/gcp/processors/GCSProcessor.h | Updated override to minifi_status. |
| extensions/gcp/processors/GCSProcessor.cpp | Updated override to minifi_status. |
| extensions/gcp/processors/FetchGCSObject.h | Updated overrides to minifi_status. |
| extensions/gcp/processors/FetchGCSObject.cpp | Updated overrides to minifi_status. |
| extensions/gcp/processors/DeleteGCSObject.h | Updated override to minifi_status. |
| extensions/gcp/processors/DeleteGCSObject.cpp | Updated override to minifi_status. |
| extensions/gcp/ExtensionInitializer.cpp | Updated exported symbols/types to new stable API names. |
| extensions/gcp/controllerservices/GCPCredentialsControllerService.h | Updated override to minifi_status. |
| extensions/gcp/controllerservices/GCPCredentialsControllerService.cpp | Updated override to minifi_status. |
| extensions/ExtensionInitializer.cpp | Updated C++ extension init symbol/type usage and includes ordering. |
| extensions/aws/AwsLoader.cpp | Updated init symbol/types to new stable API names; include ordering. |
| Extensions.md | Updated extension doc symbol names (still needs further alignment with renamed types/APIs). |
| extension-framework/include/utils/ExtensionInitUtils.h | Updated helper to use new stable C API types. |
| extension-framework/cpp-extension-lib/src/utils/minifi-c-utils.cpp | Updated status/validator types to new names. |
| extension-framework/cpp-extension-lib/src/core/ProcessSession.cpp | Updated C API calls/types to new names. |
| extension-framework/cpp-extension-lib/src/core/ProcessorImpl.cpp | Updated return types to minifi_status. |
| extension-framework/cpp-extension-lib/src/core/ProcessContext.cpp | Updated C API calls/types; added metrics reporting + trigger-when-empty setters. |
| extension-framework/cpp-extension-lib/src/core/logging/Logger.cpp | Updated C API calls/types; currently stubs level/max-size (needs fix). |
| extension-framework/cpp-extension-lib/src/core/ControllerServiceImpl.cpp | Updated return types to minifi_status. |
| extension-framework/cpp-extension-lib/src/core/ControllerServiceContext.cpp | Updated C API calls/types to new names. |
| extension-framework/cpp-extension-lib/mocklib/src/MockProcessSession.cpp | Updated mock flow-file type name. |
| extension-framework/cpp-extension-lib/mocklib/src/MockProcessContext.cpp | Updated controller-service type name; removed hasNonEmptyProperty mock. |
| extension-framework/cpp-extension-lib/mocklib/src/mock-minifi-c.cpp | Removed old mock C API implementation. |
| extension-framework/cpp-extension-lib/mocklib/src/mock-minifi-api.cpp | Added mock implementation for the new stable C API. |
| extension-framework/cpp-extension-lib/mocklib/include/MockProcessSession.h | Updated mock flow-file type name throughout. |
| extension-framework/cpp-extension-lib/mocklib/include/MockProcessContext.h | Added metrics/trigger-when-empty mock support; updated controller-service type. |
| extension-framework/cpp-extension-lib/libtest/CProcessorTestUtils.h | Updated class-definition types + controller-service bundle-name plumbing. |
| extension-framework/cpp-extension-lib/include/api/utils/minifi-c-utils.h | Updated string/status/validator/property-definition types; renamed type -> allowed_type. |
| extension-framework/cpp-extension-lib/include/api/core/Resource.h | Updated generated class definition structs/callbacks to new names; removed metrics callback path. |
| extension-framework/cpp-extension-lib/include/api/core/ProcessSession.h | Updated C API include/type usage. |
| extension-framework/cpp-extension-lib/include/api/core/ProcessorImpl.h | Updated return types; removed trigger-when-empty + metrics members from wrapper base. |
| extension-framework/cpp-extension-lib/include/api/core/ProcessContext.h | Updated controller-service type + added metrics/trigger-when-empty APIs. |
| extension-framework/cpp-extension-lib/include/api/core/logging/Logger.h | Updated logger handle type to new C API name. |
| extension-framework/cpp-extension-lib/include/api/core/FlowFile.h | Updated flow-file handle type to new C API name. |
| extension-framework/cpp-extension-lib/include/api/core/ControllerServiceImpl.h | Updated return types to minifi_status. |
| extension-framework/cpp-extension-lib/include/api/core/ControllerServiceContext.h | Updated controller-service context handle type to new C API name. |
| core-framework/include/core/ProcessorImpl.h | Marked setTriggerWhenEmpty override to satisfy new ProcessorApi. |
| .github/workflows/create-release-artifacts.yml | Updated SDK artifact paths to minifi-api.h / minifi-api.def. |
| .github/references/ubuntu_22_04_clang_arm_manifest.json | Manifest reference updates for controller-service provided API metadata. |
| .clang-format | Tightened formatting rules (short blocks/ifs/enums). |
Comments suppressed due to low confidence (2)
Extensions.md:83
- The
minifi_init_cpp_extensionexample still uses the old C API names (MinifiExtensionContext,MinifiConfigGet,MinifiStringView,MinifiExtensionDefinition). After the rename tominifi_*this snippet won't compile against the new headers.
extern "C" void minifi_init_cpp_extension(MinifiExtensionContext* extension_context) {
static PythonLibLoader python_lib_loader([&] (std::string_view key) -> std::optional<std::string> {
std::optional<std::string> result;
MinifiConfigGet(extension_context, minifi::utils::toStringView(key), [] (void* user_data, MinifiStringView value) {
*static_cast<std::optional<std::string>*>(user_data) = std::string{value.data, value.length};
libminifi/src/minifi-api.cpp:429
MinifiLoggerSetMaxLogSizeis still defined inside theextern "C"block, but it no longer appears inminifi-api.hor the Windows export list (minifi-api.def). Leaving this legacy, CamelCase symbol in the binary risks accidentally keeping/introducing ABI surface that the PR description says was removed; it should be deleted (or renamed+declared+exported if it is still intended to be supported).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| void CffiLogger::set_max_log_size(const int) { | ||
| throw std::runtime_error("Unimplemented C Api"); | ||
| } |
There was a problem hiding this comment.
i think we should throw maybe even abort because this shouldnt be called in theory
There was a problem hiding this comment.
Can we remove it from the interface altogether?
| [[nodiscard]] minifi::core::logging::LOG_LEVEL CffiLogger::level() const { | ||
| return toLogLevel(MinifiLoggerLevel(impl_)); | ||
| throw std::runtime_error("Unimplemented C API"); | ||
| } |
There was a problem hiding this comment.
i think we should throw maybe even abort because this shouldnt be called in theory
There is also a second commit which fixes a bug remove minifiSystemControllerServiceType
the resulting change can be seen in the .github/references/ubuntu_22_04_clang_arm_manifest.json
Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
In order to streamline the review of the contribution we ask you to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically main)?
Is your initial contribution a single, squashed commit?
For code changes:
For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.