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

refactor: migrate to ESM #7331

Merged
merged 19 commits into from
Jan 2, 2024
Merged

refactor: migrate to ESM #7331

merged 19 commits into from
Jan 2, 2024

Conversation

LeoDog896
Copy link
Contributor

@LeoDog896 LeoDog896 commented Dec 29, 2023

Closes

Describe your changes:

Fixes #7330 (and continues the spirit of https://github.com/nasa/openmct/tree/esm), to hopefully unblock a few pending issues. I'm opening this now to test its effects on CI as I work on this. Import transformations were done via codemods 👍

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 change backwards compatible? For example, developers won't need to change how they are calling the API or how they've extended core plugins such as Tables or Plots.

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.
  • Is this a breaking change to be called out in the release notes?
  • 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?

Copy link

codecov bot commented Dec 30, 2023

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (68e60e3) 55.74% compared to head (d8a91e9) 55.65%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7331      +/-   ##
==========================================
- Coverage   55.74%   55.65%   -0.10%     
==========================================
  Files         656      656              
  Lines       26194    26192       -2     
  Branches     2546     2546              
==========================================
- Hits        14602    14576      -26     
- Misses      10890    10918      +28     
+ Partials      702      698       -4     
Flag Coverage Δ
e2e-full 41.04% <ø> (-0.08%) ⬇️
e2e-stable 58.09% <ø> (-0.03%) ⬇️
unit 48.75% <52.38%> (-0.09%) ⬇️
Files Coverage Δ
example/dataVisualization/plugin.js 100.00% <ø> (ø)
example/eventGenerator/plugin.js 100.00% <ø> (ø)
example/exampleUser/ExampleUserProvider.js 88.46% <ø> (ø)
example/exampleUser/plugin.js 100.00% <ø> (ø)
example/faultManagement/exampleFaultSource.js 30.76% <ø> (ø)
example/generator/GeneratorProvider.js 93.10% <ø> (ø)
example/generator/plugin.js 90.00% <ø> (ø)
openmct.js 100.00% <ø> (ø)
src/MCT.js 96.96% <ø> (ø)
src/api/actions/ActionsAPI.js 96.15% <ø> (ø)
... and 135 more

... and 6 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 68e60e3...d8a91e9. Read the comment docs.

this was manual. I'm committing this because I'm about to try the `cjstoesm` tool
@@ -3,7 +3,7 @@
// @ts-check

// eslint-disable-next-line no-unused-vars
const { devices } = require('@playwright/test');
import { devices } from '@playwright/test';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import devices.
@@ -3,7 +3,7 @@
// @ts-check

// eslint-disable-next-line no-unused-vars
const { devices } = require('@playwright/test');
import { devices } from '@playwright/test';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import devices.
@@ -22,7 +22,7 @@

// FIXME: Remove this eslint exception once tests are implemented
// eslint-disable-next-line no-unused-vars
const { test, expect } = require('../../../../baseFixtures');
import { expect, test } from '../../../../baseFixtures.js';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note test

Unused import expect.
@@ -26,7 +26,7 @@

// FIXME: Remove this eslint exception once tests are implemented
// eslint-disable-next-line no-unused-vars
const { test, expect } = require('../../../../baseFixtures');
import { expect, test } from '../../../../baseFixtures.js';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note test

Unused import expect.
@@ -26,7 +26,7 @@

// FIXME: Remove this eslint exception once tests are implemented
// eslint-disable-next-line no-unused-vars
const { test, expect } = require('../../../../baseFixtures');
import { expect, test } from '../../../../baseFixtures.js';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note test

Unused import expect.
Copy link

deploysentinel bot commented Dec 30, 2023

Current Playwright Test Results Summary

✅ 166 Passing - ⚠️ 5 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 12/31/2023 04:23:35am UTC)

Run Details

Running Job e2e-stable on CircleCI

Commit: d8a91e9

Started: 12/31/2023 04:18:51am UTC

⚠️ Flakes

📄   functional/plugins/telemetryTable/telemetryTable.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Telemetry Table unpauses and filters data when paused by button and user changes bounds
Retry 1Initial Attempt
5.71% (2) 2 / 35 runs
failed over last 7 days
14.29% (5) 5 / 35 runs
flaked over last 7 days

📄   functional/plugins/plot/logPlot.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Log plot tests Log Plot ticks are functionally correct in regular and log mode and after refresh
Retry 1Initial Attempt
0% (0) 0 / 44 runs
failed over last 7 days
25% (11) 11 / 44 runs
flaked over last 7 days

📄   functional/plugins/notebook/restrictedNotebook.e2e.spec.js • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Restricted Notebook with a page locked and with an embed @addinit Allows embeds to be deleted if page unlocked @addinit
Retry 1Initial Attempt
0% (0) 0 / 36 runs
failed over last 7 days
50% (18) 18 / 36 runs
flaked over last 7 days
Restricted Notebook with a page locked and with an embed @addinit Disallows embeds to be deleted if page locked @addinit
Retry 1Initial Attempt
2.78% (1) 1 / 36 run
failed over last 7 days
66.67% (24) 24 / 36 runs
flaked over last 7 days

📄   functional/planning/timelist.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Time List Create a Time List, add a single Plan to it and verify all the activities are displayed with no milliseconds
Retry 1Initial Attempt
5.56% (2) 2 / 36 runs
failed over last 7 days
55.56% (20) 20 / 36 runs
flaked over last 7 days

View Detailed Build Results


@LeoDog896
Copy link
Contributor Author

LeoDog896 commented Dec 30, 2023

I have no clue why that test is failing - and it's definitely not flaky, I can reproduce the same behavior locally. I probably made a mistake when converting. I'll look through this

@LeoDog896 LeoDog896 marked this pull request as ready for review December 31, 2023 04:28
@unlikelyzero unlikelyzero added the type:maintenance tests, chores, or project maintenance label Dec 31, 2023
@unlikelyzero unlikelyzero added the notable_change A change which should be noted in the changelog label Dec 31, 2023
@unlikelyzero unlikelyzero added this to the Target:3.3.0 milestone Dec 31, 2023
Copy link
Contributor

@unlikelyzero unlikelyzero left a comment

Choose a reason for hiding this comment

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

This looks great. This is amazing work. In terms of review, everything looks correct.

We will need to review the impact this will have to projects which treat open mct as a npm dependency and also build it from source (like akhenry/openmct-yamcs)

@LeoDog896
Copy link
Contributor Author

LeoDog896 commented Dec 31, 2023

We will need the impact this will have to projects which treat open mct as a npm dependency and also build it from source (like akhenry/openmct-yamcs)

I didn't quite think of that - it does modify the openmct.js entry file, so this is technically a breaking change if they use that file.

EDIT: However, if they use dist, there isn't any impact.

@ozyx
Copy link
Contributor

ozyx commented Dec 31, 2023

I'll go ahead and do some cursory testing against some of the consuming projects.

@ozyx ozyx added the source:community Community contribution or request label Jan 1, 2024
Copy link
Contributor

@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.

Everything looks great! Tested this against some projects that use Open MCT as a dependency and everything just works. Thank you so much for taking this on! 🚀🚀🚀

@ozyx ozyx added pr:e2e:couchdb npm run test:e2e:couchdb and removed notable_change A change which should be noted in the changelog labels Jan 2, 2024
@unlikelyzero unlikelyzero added the notable_change A change which should be noted in the changelog label Jan 2, 2024
@ozyx ozyx merged commit fce98a1 into nasa:master Jan 2, 2024
42 of 59 checks passed
@unlikelyzero unlikelyzero modified the milestones: Target:3.3.0, Target:4.0.0 Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notable_change A change which should be noted in the changelog pr:e2e:couchdb npm run test:e2e:couchdb source:community Community contribution or request type:maintenance tests, chores, or project maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Architecture] Switch package.json to module
3 participants