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

Ensure a request for telemetry happens in Condition Sets #7592

Conversation

scottbell
Copy link
Contributor

@scottbell scottbell commented Mar 15, 2024

Closes #7484

Describe your changes:

When subscribing to telemetry in a Condition Set, we need to ensure we request telemetry in addition to a simple subscribe. This is because on telemetry like operator status, the Telemetry API may already have a subscription (due to the poll widget), and thus not create a new subscription, and thus not immediately fire a callback.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

@scottbell scottbell requested a review from ozyx March 15, 2024 11:07
@scottbell scottbell linked an issue Mar 15, 2024 that may be closed by this pull request
7 tasks
@scottbell scottbell added this to the Target:4.0.0 milestone Mar 15, 2024
@scottbell
Copy link
Contributor Author

The PR in action:

navigation.mov

Note we don't have a great way of writing e2e tests for this right now as our YAMCS setup doesn't have:

  1. Users
  2. Operator Status Telemetry

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 36.36364% with 21 lines in your changes are missing coverage. Please review.

Project coverage is 56.15%. Comparing base (fb396ac) to head (ab25b0d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7592      +/-   ##
==========================================
+ Coverage   56.13%   56.15%   +0.02%     
==========================================
  Files         672      672              
  Lines       27116    27122       +6     
  Branches     2635     2635              
==========================================
+ Hits        15222    15231       +9     
+ Misses      11567    11564       -3     
  Partials      327      327              
Flag Coverage Δ
e2e-full 23.58% <0.00%> (-0.02%) ⬇️
e2e-stable 59.93% <33.33%> (+0.02%) ⬆️
unit 49.11% <36.36%> (+0.03%) ⬆️
Files Coverage Δ
...plugins/condition/ConditionSetTelemetryProvider.js 20.00% <0.00%> (ø)
src/plugins/condition/ConditionManager.js 66.17% <38.70%> (+0.51%) ⬆️

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

@scottbell scottbell marked this pull request as ready for review March 15, 2024 11:59
@scottbell scottbell added the pr:e2e:couchdb npm run test:e2e:couchdb label Mar 15, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Mar 15, 2024
Copy link
Member

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

Just a question

Comment on lines +105 to 108
const latestTimestamp = getLatestTimestamp(
{},
{},
this.timeSystems,
Copy link
Member

Choose a reason for hiding this comment

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

this function call looks insane lol

this.subscriptions[id] = this.openmct.telemetry.subscribe(

// get latest telemetry value (in case subscription is cached and no new data is coming in)
this.requestLatestValue(endpoint);
Copy link
Member

Choose a reason for hiding this comment

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

that'll fix it i reckon. nice

src/plugins/condition/ConditionManager.js Show resolved Hide resolved
@scottbell scottbell requested a review from ozyx March 18, 2024 20:42
@scottbell scottbell added pr:e2e:couchdb npm run test:e2e:couchdb and removed pr:e2e:couchdb npm run test:e2e:couchdb labels Mar 18, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Mar 18, 2024
@scottbell scottbell added the pr:e2e:couchdb npm run test:e2e:couchdb label Mar 19, 2024
@scottbell scottbell requested a review from akhenry March 19, 2024 11:43
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Mar 19, 2024
Copy link
Contributor

@akhenry akhenry 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. Will file a followup to refactor Condition Sets to use TelemetryCollections which will remove a lot of boilerplate here.

Edit: Filed #7620

@scottbell
Copy link
Contributor Author

Looks good. Will file a followup to refactor Condition Sets to use TelemetryCollections which will remove a lot of boilerplate here.

Edit: Filed #7620

Wonderful! This was my thought too, but seemed ambitious for a bugfix.

Copy link
Member

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

LGTM

@ozyx ozyx added the pr:e2e:couchdb npm run test:e2e:couchdb label Mar 19, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Mar 19, 2024
@ozyx ozyx merged commit e305b46 into master Mar 19, 2024
21 checks passed
@ozyx ozyx deleted the 7484-condition-sets-dont-show-most-recent-status-for-operatormission-status-on-nav branch March 19, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Condition sets don't show most recent status for Operator/Mission Status on nav
3 participants