Projects - diff - is there a way to limit to filter to only what changed?

Hi ,

I started using the Projects feature of NR recently. And i am amazed at it.
Thank You for this splendid feature.
In past i had asked for versioning and diff to be added to v3 - but now i can see Projects already covers it.

Some queries :-

  1. Is it possible to filter above data to show only what changed. I have close to 50-60 flows. So , it would useful to see only what changed. Alternatively maybe sort the data to show only flows + subflows which changed - show them on the top.

  2. Is there any connection between an uncommited change and deploy? My understanding is none. Even if the change is not commited - runtime will pick the latest changes, right ?

  3. When we export such a flow file and move it to a new environment - if that environment is also having projects enabled- what would a good approach to track if all changes have come in and no local changes done on that env have been overwritten. Basically ensuring master remains correct. One option i can think is connecting to common git - but this may not be always possible. Any suggestions ? I am aware this may not be completely in the realm of core NR product - but any ideas welcome.

Any response ?

If you are asking whether that is possible today, then as I'm sure you can see, no it isn't. But it would be useful enhancement to the view to be able to do so.

The runtime runs what is deployed - it doesn't care if that has been committed or not. Committing your changes is a separate task that is up to you to do.

If you move the flow file to a new environment, then you have everything that is in the flow file (and don't forget the credentials file). That assumes you are moving the actual files. If you are exporting JSON from the editor and reimporting it via the editor, you are merging it with whatever is already there - which could lead to unexpected results if you're importing over the top of an existing set of flows.

Having a shared git repository is always going to be the cleanest way for this to work - so the remote instances just have to git clone to get the latest set of committed changes.

If you can't have a shared repo, then you're back to manually copying files around - either individually, or as the entire repo.

If you enable flowFilePretty in settings.js then it can make it easier to see what is has changed.

Also if you run this shell script from the folder where your flows file is, before committing

#!/usr/bin/env sh

# generates formatted versions of node red flow files matching flow*.json
# in files flow*.json.formatted

# NOTE must have flowFilePretty: true in settings.js

for f in flow*.json; do
  echo $f
  sed -r 's/\\n/\n/g' "$f" > "$f.formatted"
done
# remove any cred files converted
rm *_cred.json.formatted

and also commit the .formatted flows file that it produces, then a diff on that will show you changes you made within function nodes, in addition to flow changes.

Thank You @Colin . This works for identifying what all was changed. I will check how my team can use this for automating.

Thank You @knolleary for the feedback.

  1. Can you please add the #1 (filtering) to the FR ?
  2. Noted. So runtime and commit have no correlation. This doesn't break anything for me. I just wanted to know this aspect. Thanks.
  3. Let me explore both what both You and @Colin suggested on git clone + formatterd. Maybe use both in combination. Will check.

And if may - being greedy now - can we also a FR - which allows filtering out the "cosmetic" differences. Example when a node is moved. User can filter them out of diff and focus only on the real functional differences.

Thank You once again.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.