Closed Steve-Mcl closed 9 months ago
@Steve-Mcl I'm not clear why some of the functionality in this PR is required. We already have the ability to use the project nodes in an instance-assigned device. What is different about an app-assigned device that requires all of these changes?
Likewise, we haven't needed nearly as much dev-env specific logic previously - what changed?
Hi @knolleary
We already have the ability to use the project nodes in an instance-assigned device. What is different about an app-assigned device that requires all of these changes?
Ben and I had a chat about the best way to handle this. Since we do not yet have the ability to add packages (app device has no settings), we needed a way to get the project-nodes loaded.
The dev-env logic checks to see if there is a packages/nr-project-nodes
or the NODE_ENV is development & instructs the agent to use the src instead.
Likewise, we haven't needed nearly as much dev-env specific logic previously - what changed?
There is another place in the code base where the same* dev-env logic is included. The logic in here is pretty much doing the exact same thing (adding to nodes dir) (albeit the code here looks like it is "more" as it was factored out to make it easy to unit test).
I am not at my computer ATM but I think the same* dev-env logic is in the regular launcher?
*same: I additionally test that NODE_ENV is "development"
Thanks for reply @Steve-Mcl
Since we do not yet have the ability to add packages (app device has no settings), we needed a way to get the project-nodes loaded.
An alternative approach would have been to list them in the default snapshot we provide a device an app-mode.
I do want to make sure we don't have a problem with this PR merged but none of the others merged yet? It will be important these nodes don't get enabled when running against an older FF platform version because those platforms won't have the ACL support needed.
An alternative approach would have been to list them in the default snapshot we provide a device an app-mode.
Ah, right, so the device agent would only de instructed to install project nodes when the user has updated the core (and the platform is licenced too) 🤔
Very good point. Pretty sure we can also evaluate the device agent version too to ensure it is compatible before including the package.
I will do some manual testing and determine if we revert this PR before we ship a device agent update.
Thanks.
Description
This pull request adds project nodes for app assigned devices. The
@flowfuse/nr-project-nodes
package has been added to thepackage.json
file, and theLauncher
class has been updated to include the path to project nodes. NOTE, thesettings.nodesDir
(used to provide access to the project nodes for Node-RED) is conditionally added based on the env being EE and will include a different path to the@flowfuse/nr-project-nodes
package in the dev-env when detected.This pull request addresses the following commits:
Related Issue(s)
https://github.com/FlowFuse/flowfuse/issues/3018
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
backport
labelarea:migration
label