Skip to content

MINIFICPP-2840 - Refactor provenance part 1 - #2195

Open
adamdebreceni wants to merge 6 commits into
apache:mainfrom
adamdebreceni:MINIFICPP-2840
Open

MINIFICPP-2840 - Refactor provenance part 1#2195
adamdebreceni wants to merge 6 commits into
apache:mainfrom
adamdebreceni:MINIFICPP-2840

Conversation

@adamdebreceni

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR is the first part of a provenance refactor, focusing on modernizing the provenance/flowfile APIs (naming and types) and simplifying repository record retrieval to return a vector of deserialized components.

Changes:

  • Renames getlineageStartDate() to getLineageStartDate() across FlowFile/Provenance APIs and call sites.
  • Refactors core::Repository::getElements from an out-parameter/bool API to std::vector<...> getElements(size_t max_size).
  • Updates provenance event/reporting plumbing (component id now uses processor UUID; JSON report builder returns a std::string).

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
minifi-api/include/minifi-cpp/provenance/Provenance.h API rename for lineage start date; removes parent/child “remove” APIs.
minifi-api/include/minifi-cpp/core/Repository.h Changes getElements API to return a vector.
minifi-api/include/minifi-cpp/core/FlowFile.h Renames getlineageStartDate to getLineageStartDate in the API.
libminifi/test/libtest/unit/ProvenanceTestHelper.h Updates test repository to new getElements signature and provenance record creation.
libminifi/src/provenance/Provenance.cpp Refactors ProvenanceEventRecordImpl fields/ctor usage; updates serialization/deserialization and reporter commit loop.
libminifi/src/core/reporting/SiteToSiteProvenanceReportingTask.cpp Refactors JSON report generator to return string; adapts to new getElements API.
libminifi/src/core/ProcessSession.cpp Passes processor UUID as provenance component id; updates lineage start date call.
libminifi/src/core/FlowFile.cpp Renames FlowFileImpl method to getLineageStartDate.
libminifi/src/core/flow/FlowSchema.cpp Adds NiFi flow JSON keys for provenance reporting section/fields.
libminifi/include/provenance/Provenance.h Refactors provenance impl types/ctors and member naming; removes default ctor.
libminifi/include/core/reporting/SiteToSiteProvenanceReportingTask.h Updates getJsonReport signature (returns string); removes onSchedule override declaration.
libminifi/include/core/FlowFile.h Renames FlowFileImpl virtual override to getLineageStartDate.
extensions/standard-processors/tests/unit/ProcessorTests.cpp Updates tests for provenance record creation and new reporting task API.
extensions/standard-processors/processors/LogAttribute.cpp Updates lineage start date getter name.
extensions/rocksdb-repos/tests/ProvenanceTests.cpp Updates record loading creation to use ProvenanceEventRecord::create(); removes child UUID removal assertions.
extensions/rocksdb-repos/ProvenanceRepository.h Updates provenance repository interface to new getElements signature.
extensions/rocksdb-repos/ProvenanceRepository.cpp Implements new getElements signature returning a vector.
extensions/grafana-loki/PushGrafanaLokiREST.cpp Updates lineage start date getter name.
extensions/grafana-loki/PushGrafanaLokiGrpc.cpp Updates lineage start date getter name.
core-framework/include/core/Repository.h Updates default repository implementation to new getElements signature.

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

Comment thread extensions/rocksdb-repos/tests/ProvenanceTests.cpp
Comment thread libminifi/src/core/reporting/SiteToSiteProvenanceReportingTask.cpp
Comment thread extensions/rocksdb-repos/ProvenanceRepository.cpp
Comment thread libminifi/src/provenance/Provenance.cpp
Comment thread libminifi/src/provenance/Provenance.cpp
@adamdebreceni
adamdebreceni marked this pull request as ready for review August 3, 2026 10:47

@fgerlits fgerlits left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM; added some nitpicks

static const char *ProvenanceAppStr;

static void getJsonReport(core::ProcessContext& context, core::ProcessSession& session, std::vector<std::shared_ptr<core::SerializableComponent>> &records, std::string &report); // NOLINT
static std::string getJsonReport(core::ProcessContext& context, core::ProcessSession& session, const std::vector<std::shared_ptr<core::SerializableComponent>> &records); // NOLINT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can this // NOLINT be removed? I guess it used to complain about the non-const records argument

Comment on lines +234 to +237
std::string content_full_path;
std::map<std::string, std::string> attributes_;
// UUID string for all parents
std::vector<utils::Identifier> _lineageIdentifiers;
std::string _transitUri;
std::string _sourceSystemFlowFileIdentifier;
std::vector<utils::Identifier> _parentUuids;
std::vector<utils::Identifier> _childrenUuids;
std::string _details;
std::string _sourceQueueIdentifier;
std::string _relationship;
std::string _alternateIdentifierUri;
std::vector<utils::Identifier> lineage_identifiers;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

content_full_path and lineage_identifiers are missing a trailing _

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants