Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use node-red audit events to update local package list #3189

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

knolleary
Copy link
Member

This fixes how we track what additional modules have been installed in Node-RED.

When this was originally added, it was done in response to Node-RED writing its settings to the database - which includes a list of modules it has loaded.

We then added the ability to do this by listening to the audit events that get sent (nodes.install for eg).

We have found a flaw in the logic of the first approach when a module is removed. There is a sequence where Node-RED rewrites its settings before it discovers the removed module is gone - causing the module to get added back to the package list.

On review, I've determined we don't need to rely on this mechanism - we can base it entirely on the audit events. So this PR removes this first mechanism.

Whilst there, I've also added support for the modules.install event that was added in Node-RED 3.1.1 - this is triggered when the Function node installs a module. This allows us to add those modules to the package list so they get reinstalled as part of the initial dependency install and not rely on Node-RED dynamically reinstalling them.

Copy link

codecov bot commented Dec 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a9b1fee) 40.20% compared to head (14feece) 40.19%.
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3189      +/-   ##
==========================================
- Coverage   40.20%   40.19%   -0.02%     
==========================================
  Files         582      582              
  Lines       21352    21368      +16     
  Branches     5137     5141       +4     
==========================================
+ Hits         8584     8588       +4     
- Misses      12768    12780      +12     
Flag Coverage Δ
backend 76.17% <100.00%> (-0.05%) ⬇️
frontend 1.97% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hardillb hardillb merged commit 8b21f64 into main Dec 8, 2023
6 of 7 checks passed
@hardillb hardillb deleted the fix-node-install-tracking branch December 8, 2023 16:18
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.

2 participants