Skip to content

MINIFICPP-2765 Move GCP Extension to stable C API#2153

Open
martinzink wants to merge 4 commits intocontroller_cpp_apifrom
gcp_to_c_api
Open

MINIFICPP-2765 Move GCP Extension to stable C API#2153
martinzink wants to merge 4 commits intocontroller_cpp_apifrom
gcp_to_c_api

Conversation

@martinzink
Copy link
Copy Markdown
Member

@martinzink martinzink commented Apr 1, 2026

Depends on but can be independenly reviewed because that PR is implementation detail for the GCP refactor


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:

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file?
  • If applicable, have you updated the NOTICE file?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the GCP extension from the legacy MiNiFi C++ extension model to the stable C API extension model, updating processors, controller services, and tests accordingly.

Changes:

  • Ported GCP processors and the credentials controller service to the stable C API (api::core::*) lifecycle (onScheduleImpl / onTriggerImpl / enableImpl).
  • Replaced REGISTER_RESOURCE registration with a new ExtensionInitializer.cpp using MinifiInitExtension registration calls.
  • Updated GCP extension unit tests to use C API test utilities and adjusted test linking.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
extensions/gcp/tests/PutGCSObjectTests.cpp Updates processor tests to use C API processor/controller-service wrappers and shared mock client injection.
extensions/gcp/tests/ListGCSBucketTests.cpp Updates list-bucket tests to C API controller service creation and processor property setting.
extensions/gcp/tests/GCPCredentialsControllerServiceTests.cpp Adjusts controller service tests for C API controller service wrapper access and property setting.
extensions/gcp/tests/FetchGCSObjectTests.cpp Refactors fetch tests to C API processor creation and property accessors.
extensions/gcp/tests/DeleteGCSObjectTests.cpp Refactors delete tests to C API processor creation and property accessors.
extensions/gcp/tests/CMakeLists.txt Switches test linking to libminifi-c-unittest for the C API test harness.
extensions/gcp/processors/PutGCSObject.h Moves processor to C API lifecycle overrides and updates includes/annotations.
extensions/gcp/processors/PutGCSObject.cpp Implements onScheduleImpl / onTriggerImpl and uses API property parsing and session attribute APIs.
extensions/gcp/processors/ListGCSBucket.h Moves processor to C API lifecycle overrides and updates includes/annotations.
extensions/gcp/processors/ListGCSBucket.cpp Implements onScheduleImpl / onTriggerImpl and uses API property parsing and session attribute APIs.
extensions/gcp/processors/GCSProcessor.h Migrates base processor to api::core::ProcessorImpl and updates scheduling/credentials retrieval APIs.
extensions/gcp/processors/GCSProcessor.cpp Implements onScheduleImpl and updates controller service parsing to API utilities.
extensions/gcp/processors/FetchGCSObject.h Moves processor to C API lifecycle overrides and updates includes/annotations.
extensions/gcp/processors/FetchGCSObject.cpp Implements onScheduleImpl / onTriggerImpl and uses API property parsing and session attribute APIs.
extensions/gcp/processors/DeleteGCSObject.h Moves processor to C API lifecycle overrides and updates includes/annotations.
extensions/gcp/processors/DeleteGCSObject.cpp Implements onTriggerImpl and uses API property parsing and session attribute APIs.
extensions/gcp/controllerservices/GCPCredentialsControllerService.h Migrates controller service to api::core::ControllerServiceImpl and introduces enableImpl.
extensions/gcp/controllerservices/GCPCredentialsControllerService.cpp Implements credentials loading via controller service context and adds file-content helper.
extensions/gcp/GCPAttributes.h Switches metadata attribute setting to use api::core::ProcessSession::setAttribute.
extensions/gcp/ExtensionInitializer.cpp Adds stable C API extension entry point and registers processors/controller service.
extensions/gcp/CMakeLists.txt Registers the extension via register_c_api_extension and links extension lib accordingly.
Comments suppressed due to low confidence (1)

extensions/gcp/controllerservices/GCPCredentialsControllerService.cpp:1

  • enableImpl() always returns MINIFI_STATUS_SUCCESS, even when the credentials location is invalid or credential creation fails (credentials_ stays null). This can leave the controller service enabled in a broken state and shifts the failure downstream. Return a non-success status (and ideally stop enabling) when credentials_location is missing/invalid or when credentials_ could not be created.
/**

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@martinzink martinzink marked this pull request as ready for review April 2, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants