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(linting): concurrent linting #6969

Merged
merged 14 commits into from
Aug 30, 2023

Conversation

evenstensberg
Copy link
Contributor

Closes #6968

Describe your changes:

Adds concurrent linting. Note that some commands have been switched.

  • npm run lint is now lint:src
  • npm run lint:fix is now lint:fix so that eslint doesnt run twice on concurrent command lint:*
  • npm run lint:all is now npm run lint so that the run -p doesnt run recursively on itself.

Nice to know

  1. Npm run all has better stdout with colors, which concurrently doesnt have
  2. Concurrently does have exclude pattern, but it isn't better DX (Developer Experience)

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?
  • Command line build passes?
  • Has this been smoke tested?
  • 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?
  • Has associated issue been labelled unverified? (only applicable if this PR closes the issue)
  • Has associated issue been labelled bug? (only applicable if this PR is for a bug fix)

@deploysentinel
Copy link

deploysentinel bot commented Aug 20, 2023

Current Playwright Test Results Summary

✅ 136 Passing - ⚠️ 2 Flaky

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

(Last updated on 08/30/2023 11:11:48pm UTC)

Run Details

Running Job e2e-stable on CircleCI

Commit: ceef077

Started: 08/30/2023 11:04:39pm UTC

⚠️ Flakes

📄   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
3.13% (2) 2 / 64 runs
failed over last 7 days
31.25% (20) 20 / 64 runs
flaked over last 7 days

📄   functional/plugins/notebook/restrictedNotebook.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Restricted Notebook with a page locked and with an embed @addinit Disallows embeds to be deleted if page locked @addinit
Retry 1Initial Attempt
0% (0) 0 / 60 runs
failed over last 7 days
46.67% (28) 28 / 60 runs
flaked over last 7 days

View Detailed Build Results


@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Merging #6969 (4d4718e) into master (b87459d) will increase coverage by 0.03%.
The diff coverage is n/a.

❗ Current head 4d4718e differs from pull request most recent head ceef077. Consider uploading reports for the commit ceef077 to get more accurate results

@@            Coverage Diff             @@
##           master    #6969      +/-   ##
==========================================
+ Coverage   48.23%   48.27%   +0.03%     
==========================================
  Files         643      643              
  Lines       25730    25721       -9     
  Branches     2512     2512              
==========================================
+ Hits        12412    12417       +5     
+ Misses      12840    12824      -16     
- Partials      478      480       +2     
Flag Coverage Δ *Carryforward flag
e2e-full 42.00% <ø> (+<0.01%) ⬆️ Carriedforward from 5d287d8
e2e-stable 57.14% <ø> (+0.13%) ⬆️
unit 38.68% <ø> (-0.03%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

see 10 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 b87459d...ceef077. Read the comment docs.

@ozyx ozyx added the source:community Community contribution or request label Aug 20, 2023
@unlikelyzero unlikelyzero added pr:e2e Automatically triggers e2e tests to run pr:platform Runs tests against all supported platforms pr:e2e:couchdb npm run test:e2e:couchdb labels Aug 22, 2023
@unlikelyzero unlikelyzero added this to the Target:3.1.0 milestone Aug 22, 2023
@unlikelyzero unlikelyzero self-requested a review August 22, 2023 16:13
Copy link
Collaborator

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

@evenstensberg this is great! Since we're overriding one of the protected terms 'lint', We will need to check github actions and circleci for cli flags

run-p lint:* --quiet

Fails. Will need to be npm run lint -- --quiet

@evenstensberg
Copy link
Contributor Author

I can make --quiet work on everything but the cspell linter.

Opened a issue here: streetsidesoftware/cspell#4742

For now customized the two scripts to run a ci version of the linting.

package.json Outdated
"lint:spelling": "cspell \"**/*.{js,md,vue}\" --show-context --gitignore",
"lint:fix": "eslint example src e2e --ext .js,.vue openmct.js --fix",
"lint": "run-p lint:*",
"ci": "run-p \"lint:src -- --quiet\" \"lint:spelling -- --fail-fast --no-progress\"",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sure the name is correct. Can change to ci:lint for instance @unlikelyzero

Copy link
Collaborator

Choose a reason for hiding this comment

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

this is getting pretty complex. The reason we added --quiet was so that the official github reporter output wouldn't explode on in-line output on PRs. Maybe that's no longer necessary.

Let's try:

  1. remove the --quiet flag with this the previous implementation on github workflows
  2. Update a linter with a true positive failure
  3. run pr:platform

and verify that PRs aren't poluted with 12 versions of the same failed linter rule inline on the code

@evenstensberg
Copy link
Contributor Author

@unlikelyzero without quiet flag. This is what we don't want, right?

Screenshot 2023-08-22 at 22 42 04

@evenstensberg
Copy link
Contributor Author

Could do this: eslint/eslint#13898 (comment)

@unlikelyzero
Copy link
Collaborator

@evenstensberg ok i found the original card: #4909.

Here's an example of what it looks like when the github in-line reporter goes nuts. The following example is the pr:e2e workflow https://github.com/nasa/openmct/pull/5012/files

Effectively we turned on quiet mode to prevent the github inline reporter from creating 10+ testfailures in the /pull/#/files view. instead of worrying about quiet output, maybe we can just figure out how to prevent the github annotation reporter from spamming the files view for failed linting steps.

@evenstensberg
Copy link
Contributor Author

@unlikelyzero I'll investigate if we can suppress through github workflow (probably due next week)

@evenstensberg
Copy link
Contributor Author

@unlikelyzero I've spoken with the maintainers of cspell and they are discussing adding quietas an alias for silent. This means that we can keep the -quietflag as you have previously

@evenstensberg
Copy link
Contributor Author

PR is merged (streetsidesoftware/cspell#4748) and new release on Monday 28th of August. Will update the dependency when new version is rolled out.

@evenstensberg
Copy link
Contributor Author

evenstensberg commented Aug 28, 2023

@unlikelyzero It seems like passing a boolean to the --quiet flag doesnt get recognized, nor is passing quiet as a param in the cli. so we'll need to add another script to run in CI.

Is that ok? The PR is ready to be reviewed.

@unlikelyzero
Copy link
Collaborator

@evenstensberg I am on PTO today. Can you see if it's possible to silence GitHub annotation reporter for the results and we can remove the quiet flags altogether?

@evenstensberg
Copy link
Contributor Author

@unlikelyzero For reference, I managed to make it work. The script lint looks a bit hacky, but it allows to optionally pass a flag/option to each of the scripts and in this case --quiet.

Enjoy your day, and lmk if you need something 👍🏾

package.json Outdated
"lint:spelling": "cspell \"**/*.{js,md,vue}\" --show-context --gitignore",
"lint:fix": "eslint example src e2e --ext .js,.vue openmct.js --fix",
"lint": "run-p \"lint:* -- {1}\" --",
"fix:lint": "eslint example src e2e --ext .js,.vue openmct.js --fix",
Copy link
Collaborator

Choose a reason for hiding this comment

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

@evenstensberg after some internal discussion, we think fix:lint should be reverted to lint:fix

We will then need to explicitly list the scripts in lint as

"lint":"run-p lint:js lint:vue lint:spelling"

Lastly, it appears that npm-run-all is no longer maintained and we will want to switch to npm-run-all2

package.json Outdated Show resolved Hide resolved
Copy link
Collaborator

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

We completed the final review. A few changes, but otherwise this is great and opens the door for more linting options

@evenstensberg
Copy link
Contributor Author

@unlikelyzero review change done. Personally I think that the runp lint:* looks cleaner

@evenstensberg
Copy link
Contributor Author

@unlikelyzero also sent a mail to arc-dl. Would be nice if you had a look and replied.

@ozyx
Copy link
Contributor

ozyx commented Aug 30, 2023

@unlikelyzero also sent a mail to arc-dl. Would be nice if you had a look and replied.

Hi @evenstensberg ,

We've received your message and will be responding today, please stand by. Appreciate your patience!

package.json Outdated
@@ -54,6 +54,7 @@
"moment": "2.29.4",
"moment-duration-format": "2.3.2",
"moment-timezone": "0.5.41",
"npm-run-all2": "^6.0.6",
Copy link
Collaborator

Choose a reason for hiding this comment

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

pin this to latest

Copy link
Collaborator

@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! Just one change (pin npm-run-all2 to the latest) and then we merge this in

@unlikelyzero unlikelyzero enabled auto-merge (squash) August 30, 2023 23:02
@unlikelyzero unlikelyzero added pr:e2e:couchdb npm run test:e2e:couchdb and removed pr:e2e Automatically triggers e2e tests to run pr:platform Runs tests against all supported platforms pr:e2e:couchdb npm run test:e2e:couchdb labels Aug 30, 2023
@unlikelyzero unlikelyzero merged commit e09a7ae into nasa:master Aug 30, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:e2e:couchdb npm run test:e2e:couchdb source:community Community contribution or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Linting] Implement lint-all
3 participants