Codemods and Other Upgrade Automation
Much of the work of major software upgrades can now be automated via “codemods” - software that modifies other software’s source code (source code modification). Here is a collection of such codemods that either have saved us time in previous upgrades or seem likely to do so in future ones. For more context on many of these, see https://2021.djangocon.us/talks/herding-ponies-coordinating-and-django/ .
Applying Codemods Across Multiple Repositories
Continuous Integration
https://github.com/edx/repo-tools/tree/master/edx_repo_tools/codemods/django3 - Examples for auto-updating GitHub Actions workflows, tox.ini, and .travis.yml
Django
https://github.com/edx/repo-tools/tree/master/edx_repo_tools/codemods
New options may appear in Django Packages : Auto-Upgrade
Python
Codemod Frameworks - Python
https://engineering.fb.com/2023/08/07/developer-tools/fixit-2-linter-meta/ (built on LibCST)
GitHub - facebookincubator/Bowler: Safe code refactoring for modern Python. - deprecated/inactive
GitHub - google/pasta: Library to refactor python code through AST manipulation. - inactive
GitHub - PyCQA/redbaron: Bottom-up approach to refactoring in python - inactive
Deprecation Warnings Classification - Python
https://github.com/edx/edx-platform/blob/master/openedx/core/process_warnings.py
GitHub - openedx/pytest-warnings-report: Create an aggregate report of the warnings seen during test runs. (incomplete refactoring of the edx-platform code above to make it usable in other repos)