fecgov / fec-eregs

The Federal Election Commission's web-based application that makes regulations easier to find, read and understand.
https://www.fec.gov/regulations/
Other
33 stars 13 forks source link

792/784-upgrade django and gitpython #796

Closed cnlucas closed 1 year ago

cnlucas commented 1 year ago

Summary (required)

This ticket upgrades django and gitpython to remove the vulnerabilities in requirements.txt and requirements-parsing.txt

Required reviewers

1-2 devs

Impacted areas of the application

General components of the application that this PR will affect:

Related PRs

Related PRs against other branches: https://github.com/fecgov/regulations-core/pull/14 https://github.com/fecgov/regulations-parser/pull/16 https://github.com/fecgov/regulations-site/pull/13

How to test

  1. Checkout this branch

Terminal One:

  1. pyenv virtualenv (your virtual environment)

  2. Update requirements.txt file with: regparser -e git+https://github.com/fecgov/regulations-parser@upgrade-django-3.2.21#egg=regparser regsite -e git+https://github.com/fecgov/regulations-site@upgrade-django-gitpython#egg=regulations regcore -e git+https://github.com/fecgov/regulations-core@upgrade-django-3.2.21#egg=regcore

  3. pip install -r requirements.txt

  4. snyk test --file=requirements.txt --package-manager=pip

  5. rm -rf node_modules

  6. nvm install 18.17.1

  7. npm i

  8. npm run build

  9. dropdb eregs_local

  10. createdb eregs_local

  11. python manage.py migrate

  12. python manage.py compile_frontend

  13. python manage.py runserver (leave running)

Terminal Two:

  1. pyenv virtualenv (your virtual environment)

  2. Update requirements-parsing.txt file with: regparser -e git+https://github.com/fecgov/regulations-parser@upgrade-django-3.2.21#egg=regparser regsite -e git+https://github.com/fecgov/regulations-site@upgrade-django-gitpython#egg=regulations regcore -e git+https://github.com/fecgov/regulations-core@upgrade-django-3.2.21#egg=regcore

  3. pip install -r requirements-parsing.txt

  4. snyk test --file=requirements-parsing.txt --package-manager=pip

  5. python load_regs/load_fec_regs.py local

  6. Go to http://127.0.0.1:8000/ to view 45 regulations

For more detailed instructions follow the wiki on how to setup/parse regulations on local environment