lordgamez commented on code in PR #2186:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2186#discussion_r3614286348
##########
minifi_rust/generate_docs/generate_docs.dockerfile:
##########
Review Comment:
I would call this Dockerfile.generate_docs
##########
minifi_rust/minifi_native/src/api/processor_wrappers/utils/context_session_flowfile_bundle.rs:
##########
@@ -0,0 +1,85 @@
+use crate::api::attribute::GetAttribute;
+use crate::api::flow_file::GetId;
+use crate::api::property::{GetControllerService, GetProperty};
+use crate::{
+ ComponentIdentifier, EnableControllerService, MinifiError, ProcessContext,
ProcessSession,
+ Property,
+};
+
+pub struct ContextSessionFlowFileBundle<'a, PC, PS>
+where
+ PC: ProcessContext,
+ PS: ProcessSession<FlowFile = PC::FlowFile>,
+{
+ context: &'a PC,
+ session: &'a PS,
+ flow_file: Option<&'a PC::FlowFile>,
+}
+
+impl<'a, PC, PS> ContextSessionFlowFileBundle<'a, PC, PS>
+where
+ PC: ProcessContext,
+ PS: ProcessSession<FlowFile = PC::FlowFile>,
+{
+ pub(crate) fn new(
+ context: &'a PC,
+ session: &'a PS,
+ flow_file: Option<&'a PC::FlowFile>,
+ ) -> Self {
+ Self {
+ context,
+ session,
+ flow_file,
+ }
+ }
+}
+impl<'a, PC, PS> GetProperty for ContextSessionFlowFileBundle<'a, PC, PS>
+where
+ PC: ProcessContext,
+ PS: ProcessSession<FlowFile = PC::FlowFile>,
+{
+ fn get_property(&self, property: &Property) -> Result<Option<String>,
MinifiError> {
+ self.context.get_property(property, self.flow_file)
+ }
+}
+
+impl<'a, PC, PS> GetControllerService for ContextSessionFlowFileBundle<'a, PC,
PS>
+where
+ PC: ProcessContext,
+ PS: ProcessSession<FlowFile = PC::FlowFile>,
+{
+ fn get_controller_service<Cs>(&self, property: &Property) ->
Result<Option<&Cs>, MinifiError>
+ where
+ Cs: EnableControllerService + ComponentIdentifier + 'static,
+ {
+ self.context.get_controller_service(property)
+ }
+}
+
+impl<'a, PC, PS> GetAttribute for ContextSessionFlowFileBundle<'a, PC, PS>
+where
+ PC: ProcessContext,
+ PS: ProcessSession<FlowFile = PC::FlowFile>,
+{
+ fn get_attribute(&self, name: &str) -> Result<Option<String>, MinifiError>
{
+ if let Some(ff) = &self.flow_file {
Review Comment:
& seems to be unneeded
##########
minifi_rust/minifi_rs_behave/debian.dockerfile:
##########
Review Comment:
This could also be Dockerfile.debian
##########
minifi_rust/minifi_rs_behave/debian.dockerfile:
##########
@@ -0,0 +1,26 @@
+FROM rust:slim-bullseye AS chef
+RUN apt-get update && apt-get install -y clang lld pkg-config curl tar
+RUN cargo install cargo-chef
Review Comment:
These 2 could be merged too
```suggestion
RUN apt-get update && apt-get install -y clang lld pkg-config curl tar && \
cargo install cargo-che
```
##########
minifi_rust/minifi_rs_behave/alpine.dockerfile:
##########
@@ -0,0 +1,27 @@
+FROM rust:alpine3.22 AS chef
+# Install build dependencies required for compiling C code & extensions on
Alpine
+RUN apk add --no-cache musl-dev gcc g++ clang-dev lld pkgconfig curl tar
+RUN cargo install cargo-chef
Review Comment:
I think it's better to merge these two lines
```suggestion
RUN apk add --no-cache musl-dev gcc g++ clang-dev lld pkgconfig curl tar && \
cargo install cargo-chef
```
##########
minifi_rust/minifi_rs_behave/alpine.dockerfile:
##########
Review Comment:
I would also rename this to Dockerfile.alpine
--
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]