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

ci: refactor lint CI task and fix lint issues #2004

Merged
merged 32 commits into from
Mar 23, 2022

Conversation

RaschidJFR
Copy link
Contributor

New Pull Request Checklist

Issue Description

Currently, the commands npm test and npm run lint are failing: some files are not following style rules and there are some outdated test cases.

Approach

  • Lint-fix all files
  • Update outdated test cases to pass
  • Add unit testing to CI workflow

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)
  • A changelog entry is created automatically using the pull request title (do not manually add a changelog entry)

@parse-github-assistant
Copy link

parse-github-assistant bot commented Jan 18, 2022

Thanks for opening this pull request!

  • ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as Related issue: #123 in the PR description, so I can recognize it.

@RaschidJFR RaschidJFR changed the title chore: lint files and update test cases ci: lint files and update test cases Jan 18, 2022
.github/workflows/ci.yml Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@RaschidJFR
Copy link
Contributor Author

I need a hand here with the CI step Lint (I should rename it in case it stays). It is failing to import .css files. I believe it may be something related to babel. I'm not too familiar, so I'd appreciate pointing me in the right direction. Meanwhile, I'll start googling around.

mtrezza and others added 17 commits February 8, 2022 01:03
# [4.0.0-alpha.16](parse-community/parse-dashboard@4.0.0-alpha.15...4.0.0-alpha.16) (2022-02-10)

### Bug Fixes

* adding internal class (e.g. `_User`) fails due to prefixed underscore ([parse-community#2036](parse-community#2036)) ([f80bd07](parse-community@f80bd07))
@RaschidJFR
Copy link
Contributor Author

RaschidJFR commented Mar 11, 2022

@mtrezza It looks like the parse SDK cannot be loaded by Jest in Node v16, causing several tests to fail. However, this doesn't seem related to the SDK package itself (all tests passing OK in v16)

So far, the only workaround I found is to use the flag --unhandled-rejections in package.json (see https://developer.ibm.com/blogs/nodejs-15-release-blog/).

Let me know your thoughts. If you find it ok, we're ready to merge.

@mtrezza
Copy link
Member

mtrezza commented Mar 12, 2022

It's likely that we have some unhandled rejections, I remember we have (had?) this issue in Parse Server as well.

@RaschidJFR RaschidJFR changed the title ci: lint files and update test cases ci: re-enable unit tests Mar 12, 2022
@mtrezza
Copy link
Member

mtrezza commented Mar 14, 2022

The only issue I see with adding the flag is that it may obscure issues with unhandled rejections. Especially since we are running tests, I am not sure whether it makes sense to run them in a non-representative environment. We may see tests pass, but dashboard won't actually run in certain Node environments.

How about the Parse JS SDK, in which Node versions do its CI tests run?

@RaschidJFR
Copy link
Contributor Author

I think you’re right. The SDK CI is running on v14. Should we drop support for v16 until the SDK officially supports it?

@mtrezza
Copy link
Member

mtrezza commented Mar 14, 2022

I think that would be the process. Do you want to open a PR in the JS SDK and add Node 16 to the CI? Once it runs on Node 16, we could continue here without any errors hopefully.

@RaschidJFR
Copy link
Contributor Author

Finally fixed. No need to modify the SDK repo. It was enough to mock the module idb-keyval from the SDK.

@mtrezza
Copy link
Member

mtrezza commented Mar 23, 2022

I hope I resolved the conflicts correctly in package-lock. Let's see whether it passes.

@mtrezza
Copy link
Member

mtrezza commented Mar 23, 2022

@RaschidJFR Could you take a last look before merge, since this has been stale for some days.

Note to myself:

  • add Lint CI job as required after merging

@mtrezza mtrezza changed the title ci: re-enable unit tests ci: add lint Mar 23, 2022
@mtrezza mtrezza changed the title ci: add lint ci: refactor lint task and fix lint issues Mar 23, 2022
@mtrezza mtrezza changed the title ci: refactor lint task and fix lint issues ci: refactor lint CI task and fix lint issues Mar 23, 2022
@RaschidJFR
Copy link
Contributor Author

LGTM. Thanks @mtrezza

@mtrezza mtrezza merged commit fd50c08 into parse-community:alpha Mar 23, 2022
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 4.1.0-alpha.2

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Mar 24, 2022
@RaschidJFR RaschidJFR deleted the bugfix/fix_lint_and_tests branch March 25, 2022 17:08
mtrezza pushed a commit to mtrezza/parse-dashboard that referenced this pull request Apr 3, 2022
dblythy pushed a commit to dblythy/parse-dashboard that referenced this pull request Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released-alpha Released as alpha version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants