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

Implement health check interval user setting #3716

Merged
merged 26 commits into from
May 8, 2024

Conversation

Steve-Mcl
Copy link
Contributor

@Steve-Mcl Steve-Mcl commented Apr 15, 2024

Description

  • Adds new key to instance settings KEY_HEALTH_CHECK_INTERVAL
  • Updates API to permit launcherSettings to be passed in/out
  • Adds new page instance/<instance-id>/settings/launcher

NOTES:

Screenshots

Settings:

image

In actions:

image

Audit log entry:

image

TODO

  • tests

Related Issue(s)

#3715

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 FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/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

codecov bot commented Apr 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.16%. Comparing base (1aa0b27) to head (629776b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3716      +/-   ##
==========================================
+ Coverage   79.13%   79.16%   +0.02%     
==========================================
  Files         279      279              
  Lines       12550    12567      +17     
  Branches     2787     2792       +5     
==========================================
+ Hits         9932     9949      +17     
  Misses       2618     2618              
Flag Coverage Δ
backend 79.16% <100.00%> (+0.02%) ⬆️

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.

@Steve-Mcl Steve-Mcl linked an issue Apr 15, 2024 that may be closed by this pull request
Copy link
Member

@knolleary knolleary left a comment

Choose a reason for hiding this comment

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

A couple suggested changes.

I'm iffy on the idea of adding a Launcher section to Instance settings as it becomes another concept for a user to have to understand the meaning of. That said, I don't think we have quite a suitable existing location for such a setting. So won't block for that - but the other bits I would like looked at.

frontend/src/pages/instance/Settings/LauncherSettings.vue Outdated Show resolved Hide resolved
forge/routes/api/project.js Show resolved Hide resolved
@Steve-Mcl
Copy link
Contributor Author

@knolleary, hold fire on review/merge please. Not able to navigate to new tab in pre-staging env tests.

@Steve-Mcl
Copy link
Contributor Author

Added healthCheckInterval to settings in the /settings api endpoint in the forge app https://github.com/FlowFuse/flowfuse/blob/main/forge/routes/api/project.js#L798 as suggested in the linked comment.


NOTE:

The PG test fail is unrelated and was raised as a chore - found when implementing SQL Server as backend DB. It has finally bitten!

Test fail:

 1) Device API
       Device Checkin
         device checks in with a valid snapshot and settingsHash:

      AssertionError: expected 409 to be 200
      + expected - actual

      -409
      +200
      
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at Context.<anonymous> (test/unit/forge/routes/api/device_spec.js:1738:40)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

failing due to missing await on dbDevice.updateSettings({ settings: { env: [{ name: 'FOO', value: 'BAR' }] } }) here:

dbDevice.updateSettings({ settings: { env: [{ name: 'FOO', value: 'BAR' }] } })

I will raise a PR and once merged, re-run tests.

@Steve-Mcl
Copy link
Contributor Author

Rerun tests once Fix async and transactional issues in code base #3812 is merged

@knolleary
Copy link
Member

My only pause on merging this right now is that it depends on the updated nr-launcher to pass through the setting; which requires updated stack builds. We don't have the CI/CD process for that cracked yet. That said, we're doing the release tomorrow which will update the stacks. I think it is low risk to merge this now, but hold off highlighting it until the release is done tomorrow and the stacks available.

@knolleary knolleary merged commit fe2e18f into main May 8, 2024
13 checks passed
@knolleary knolleary deleted the 3715-health-check-interval branch May 8, 2024 09:39
@knolleary knolleary linked an issue Jun 6, 2024 that may be closed by this pull request
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement health check timeout via UI Allow Instance Health Check interval to be configured
4 participants