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

Use audit events to improve management of node module list #2011

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

knolleary
Copy link
Member

@knolleary knolleary commented Apr 17, 2023

Fixes #2005

Description

The existing code to keep the platform's record of modules installed in an instance relied on the event triggered when Node-RED saves its node list.

That event isn't triggered when a module is upgraded - meaning the platform's record gets out of date.

The fix is to use the nodes.install audit event which does get triggered for the upgrade path.

I've also added support for the nodes.remove audit event to trigger removing modules from the list.

Whilst there, I've modified the test suite to only run setup once, rather than before each test. This only required updating the names of the projects the individual tests were creating to ensure uniqueness.

When running the tests locally, this reduced the runtime for the _spec file from 7s to 2s - a good step in the right direction for #2004

Related Issue(s)

Acceptance Criteria

On staging:

  • Update an out-of-date module on Node-RED Palette manager
  • Check that the list of installed modules on the instance settings in FF has updated.

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on flowforge/helm to update ConfigMap Template
    • Issue/PR raised on flowforge/CloudProject to update values for Staging/Production

Labels

  • Backport needed? -> add the backport label
  • Includes a DB migration? -> add the area:migration label

Copy link
Contributor

@Steve-Mcl Steve-Mcl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane.
Will check/update acceptance criteria to ensure specific manual operations are performed to test this on staging.

@Steve-Mcl Steve-Mcl merged commit 2bea344 into main Apr 17, 2023
@Steve-Mcl Steve-Mcl deleted the 2005-fix-module-upgrade branch April 17, 2023 10:09
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.

Cannot upgrade modules from inside Manage Palette
2 participants