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

feat(redirection): adds mqtt start and stop events for redirection #573

Merged
merged 3 commits into from
Mar 22, 2022

Conversation

matt-primrose
Copy link
Member

PR Checklist

  • Unit Tests have been added for new changes
  • API tests have been updated if applicable
  • All commented code has been removed
  • If you've added a dependency, you've ensured license is compatible with Apache 2.0 and clearly outlined the added dependency.

What are you changing?

Adds MQTT start and stop events for redirection sessions

Anything the reviewer should know when reviewing this PR?

Hold until after 2.2 release

If the there are associated PRs in other repositories, please link them here (i.e. open-amt-cloud-toolkit/repo#365 )

@matt-primrose matt-primrose force-pushed the US4233-AddRedirectionMQTTEvents branch from f718119 to 4a98f40 Compare March 18, 2022 17:06
@codecov
Copy link

codecov bot commented Mar 18, 2022

Codecov Report

Merging #573 (21f34c2) into main (759acd0) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #573      +/-   ##
==========================================
+ Coverage   91.23%   91.24%   +0.01%     
==========================================
  Files          68       68              
  Lines        3000     3005       +5     
  Branches      463      463              
==========================================
+ Hits         2737     2742       +5     
  Misses        263      263              
Impacted Files Coverage Δ
src/logging/messages.ts 100.00% <100.00%> (ø)
src/utils/wsRedirect.ts 80.70% <100.00%> (+1.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 759acd0...21f34c2. Read the comment docs.

@matt-primrose matt-primrose changed the title feat(redirection): adds mqtt start and stop events for redirection feat(redirection)- adds mqtt start and stop events for redirection Mar 18, 2022
@matt-primrose matt-primrose marked this pull request as ready for review March 18, 2022 19:10
@matt-primrose matt-primrose changed the title feat(redirection)- adds mqtt start and stop events for redirection feat(redirection): adds mqtt start and stop events for redirection Mar 21, 2022
Copy link
Contributor

@Walt-Intel Walt-Intel left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@@ -46,6 +47,7 @@ export class WsRedirect {

// We got a new web socket connection, initiate a TCP connection to the target Intel AMT host/port.
logger.debug(`${messages.REDIRECT_OPENING_WEB_SOCKET} to ${params.host}: ${params.port}.`)
MqttProvider.publishEvent('success', ['handleConnection'], messages.REDIRECTION_SESSION_STARTED)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this call fail? Is any error handling needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

If a MQTT broker is not configured/missing, the call will silently fail without impacting the rest of the code

@@ -76,6 +78,7 @@ export class WsRedirect {
logger.debug(`${messages.REDIRECT_CLOSING_WEB_SOCKET} to ${params.host}: ${params.port}.`)
if (this.websocketFromDevice) {
this.websocketFromDevice.CloseChannel()
MqttProvider.publishEvent('success', ['handleClose'], messages.REDIRECTION_SESSION_ENDED)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this call fail? Is any error handling needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

If a MQTT broker is not configured/missing, the call will silently fail without impacting the rest of the code

@matt-primrose matt-primrose merged commit e51906e into main Mar 22, 2022
@matt-primrose matt-primrose deleted the US4233-AddRedirectionMQTTEvents branch March 22, 2022 18:51
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