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

Add 3rd Party broker endpoint #5081

Merged
merged 4 commits into from
Feb 7, 2025

Conversation

hardillb
Copy link
Contributor

@hardillb hardillb commented Feb 6, 2025

Description

  • GET /api/v1/teams/:teamId/brokers/:brokerId

returns a broker object (with no credentials) and a extra status field that shows if the client is connected to the broker

This is to be used to add a status pill to 3rd party brokers

Also fix the schema for the broker apis and fixes the db.views.BrokerCredentials functons

Related Issue(s)

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

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

GET /api/v1/teams/:teamId/brokers/:brokerId

returns a broker object (with no credentials) and a exrtra status field
that shows if the client is connected to the broker

Also fix the schema for the broker apis and fixes the
db.views.BrokerCredentials functons
@hardillb hardillb requested a review from knolleary February 6, 2025 13:07
@hardillb hardillb self-assigned this Feb 6, 2025
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 60.86957% with 9 lines in your changes missing coverage. Please review.

Project coverage is 78.36%. Comparing base (bafc741) to head (a215e0f).
Report is 15 commits behind head on mqtt-topic-schema-storge.

Files with missing lines Patch % Lines
forge/ee/routes/teamBroker/3rdPartyBroker.js 10.00% 9 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           mqtt-topic-schema-storge    #5081      +/-   ##
============================================================
- Coverage                     78.49%   78.36%   -0.13%     
============================================================
  Files                           337      337              
  Lines                         15772    15829      +57     
  Branches                       3634     3654      +20     
============================================================
+ Hits                          12380    12405      +25     
- Misses                         3392     3424      +32     
Flag Coverage Δ
backend 78.36% <60.86%> (-0.13%) ⬇️

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.

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.

Fixing up linting

forge/ee/routes/teamBroker/3rdPartyBroker.js Outdated Show resolved Hide resolved
forge/ee/routes/teamBroker/3rdPartyBroker.js Outdated Show resolved Hide resolved
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.

Approved pending changes:

  • Fixed up an erorr message typo.
  • Renamed 3rdPartyBroker to MQTTBroker in the schema as it feels cleaner.

forge/ee/routes/teamBroker/3rdPartyBroker.js Outdated Show resolved Hide resolved
forge/ee/routes/teamBroker/3rdPartyBroker.js Outdated Show resolved Hide resolved
forge/ee/routes/teamBroker/3rdPartyBroker.js Outdated Show resolved Hide resolved
forge/ee/routes/teamBroker/3rdPartyBroker.js Outdated Show resolved Hide resolved
forge/ee/routes/teamBroker/3rdPartyBroker.js Outdated Show resolved Hide resolved
forge/ee/routes/teamBroker/3rdPartyBroker.js Outdated Show resolved Hide resolved
forge/ee/routes/teamBroker/3rdPartyBroker.js Outdated Show resolved Hide resolved
forge/ee/routes/teamBroker/3rdPartyBroker.js Outdated Show resolved Hide resolved
forge/db/views/BrokerCredentials.js Outdated Show resolved Hide resolved
@hardillb
Copy link
Contributor Author

hardillb commented Feb 7, 2025

Test failure is in device groups so merging anyway.

Can review tests in lower branch before merging to main

@hardillb hardillb merged commit 00be7f6 into mqtt-topic-schema-storge Feb 7, 2025
18 of 20 checks passed
@hardillb hardillb deleted the fix-db-views-add-status branch February 7, 2025 11:10
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