Copilot commented on code in PR #2315:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2315#discussion_r4709233316
##########
minifi_rust/minifi_native/src/api/processor_wrappers/flow_file_transform.rs:
##########
@@ -142,26 +142,24 @@ pub trait MutFlowFileTransform: ProcessorDefinition {
pub struct FlowFileTransformProcessorType {}
-fn handle_transform<PC, PS, L, F>(
- context: &mut PC,
- session: &mut PS,
+fn handle_transform<TC, L, F>(
+ context: &TC,
logger: &L,
error_relationship: &Relationship,
mut transform_fn: F,
) -> Result<OnTriggerResult, MinifiError>
where
- PC: ProcessContext,
- PS: ProcessSession<FlowFile = PC::FlowFile>,
+ TC: TriggerContext,
L: Logger,
F: for<'stream> FnMut(
- &ContextSessionFlowFileBundle<'_, PC, PS>,
+ &FlowFileContext<'_, TC>,
&'stream mut dyn InputStream,
) -> Result<TransformedFlowFile<'stream>, TransformError>,
{
- if let Some(mut flow_file) = session.get() {
- let simple_context = ContextSessionFlowFileBundle::new(context,
session, Some(&flow_file));
+ if let Some(mut flow_file) = context.get() {
+ let simple_context = FlowFileContext::new(context, Some(&flow_file));
Review Comment:
The migrated wrapper tests never read a property through this new flow-file
context. Moreover, `MockPropertyMap::get_property` ignores its flow-file
argument, so the mocks cannot detect accidentally using the flow-file-free
lookup. Please add a wrapper regression test with a trigger context that
returns different values for ordinary and flow-file property reads, and assert
that the transform receives the value for the consumed flow file.
##########
minifi_rust/minifi_native/src/mock/mock_trigger_context.rs:
##########
@@ -1,32 +1,87 @@
-// SPDX-License-Identifier: Apache-2.0
-// SPDX-FileCopyrightText: See the NOTICE file distributed with this work for
additional information regarding copyright ownership
-// SPDX-FileContributor: Licensed to the Apache Software Foundation (ASF)
under one or more contributor license agreements
-
-use crate::api::process_session::IoState;
-use crate::api::{InputStream, ProcessSession};
-use crate::{MinifiError, MockFlowFile};
+use super::mock_configuration::{MockControllerServices, MockPropertyMap,
find_controller_service};
Review Comment:
This rename removes the existing Apache/SPDX license and attribution header.
The other mock source files retain it, including
`minifi_rust/minifi_native/src/mock/mock_schedule_context.rs:1-3` and
`minifi_rust/minifi_native/src/mock/mock_configuration.rs:1-3`. Please restore
the original three-line header here as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]