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

Replace Paver quality and js_test commands #35159

Open
wants to merge 75 commits into
base: master
Choose a base branch
from

Conversation

salman2013
Copy link
Contributor

@salman2013 salman2013 commented Jul 23, 2024

Paver is deprecated, and we aim to fully remove it soon. You can find more details here:

Paver deprecation issue
Paver removal PR

A few Paver commands remain in the edx-platform, and to proceed with its removal, we've replaced the following Paver commands with equivalent Make commands:

  1. Replaced paver run_pep8 with pycodestyle
  2. Replaced paver run_eslint
  3. Replaced paver run_stylelint
  4. Replaced paver run_xsslint
  5. Replaced paver run_pii_check
  6. Replaced paver check_keywords
  7. Replaced paver test_js* and paver diff_coverage

How to Test This PR:

In the edx-platform directory, you can use the following terminal commands to check for linting issues in Python and JavaScript files. Make sure your virtual environment is activated before running these commands.

make pycodestyle
make eslint
make stylelint
make xsslint
make pi_check
make check_keyword
make test-js
make test-coverage
make quality-test

For more details, please refer to the ticket: Replace paver quality and js_test commands

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 23, 2024
@openedx-webhooks

This comment was marked as outdated.

@salman2013 salman2013 marked this pull request as ready for review July 23, 2024 11:21
@salman2013
Copy link
Contributor Author

salman2013 commented Jul 23, 2024

@feanil @kdmccormick
Should we remove the paver tests as well like https://github.com/openedx/edx-platform/tree/master/pavelib/paver_tests?

@salman2013 salman2013 requested a review from feanil July 23, 2024 11:31
@kdmccormick
Copy link
Member

@salman2013 as you remove Paver commands, please remove the tests that correspond to those commands.

@kdmccormick
Copy link
Member

Thanks for the PR @salman2013, but this only goes part of the way. The goal of #35159 is not only to get rid of the paver ... commands. The goal is get rid of all the Python code that runs our quality checks. In the end, we should be able to delete the whole pavelib directory.

Keep in mind that there are several things that pavelib code did that are now completely unnecessary, for example:

  • junit.xml -- I don't know if we need to write this file any more. If nothing is obviously using it, it can be deleted.
  • violation counts -- There was a time when all checks had "violation limits", so we would need to keep track of the violation count, and then fail only if the count exceeded the limit. For many checks, the violation limit is now zero. If the violation limit for a check is zero, then that check can be simplified, since any violation is enough to fail it.

I recommend starting with one simple check, such as pycodestyle, and see if you can get that running without any Python scripts involved.

@salman2013 salman2013 closed this Jul 31, 2024
@salman2013 salman2013 reopened this Jul 31, 2024
@salman2013 salman2013 closed this Aug 15, 2024
@salman2013 salman2013 reopened this Aug 15, 2024
@kdmccormick kdmccormick marked this pull request as draft August 20, 2024 18:57
@salman2013 salman2013 marked this pull request as ready for review August 21, 2024 05:50
@salman2013
Copy link
Contributor Author

@kdmccormick This PR is ready for another pass. Please take a look thanks.

Copy link
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

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

Fantastic work so far. Really happy to see these running without Paver.

scripts/generic-ci-tests.sh Outdated Show resolved Hide resolved
pavelib/prereqs.py Outdated Show resolved Hide resolved
pavelib/utils/envs.py Outdated Show resolved Hide resolved
pavelib/paver_tests/test_assets.py Outdated Show resolved Hide resolved
scripts/quality_test/js_test.py Outdated Show resolved Hide resolved
scripts/quality_test/suites/suite.py Outdated Show resolved Hide resolved
scripts/quality_test/utils/envs.py Outdated Show resolved Hide resolved
stylelint.config.js Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@salman2013 salman2013 changed the title Replace paver quality commands Replace Paver quality and js_test commands Aug 27, 2024
@salman2013
Copy link
Contributor Author

@kdmccormick I believe this PR is ready for another pass. Please take a look thanks.

Copy link
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

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

Most of this feedback is straightforward, except the very last item regarding subprocess.run. I'm happy to go over that in our sync tomorrow morning if my comment isn't clear.

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
pavelib/utils/envs.py Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
scripts/quality_test/quality_test.py Outdated Show resolved Hide resolved
scripts/quality_test/quality_test.py Outdated Show resolved Hide resolved
scripts/quality_test/quality_test.py Outdated Show resolved Hide resolved
@salman2013
Copy link
Contributor Author

@kdmccormick Thanks for reviewing the PR, I have fixed all your comments, and the PR is ready for another pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Status: In Eng Review
Development

Successfully merging this pull request may close these issues.

3 participants