Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rollbar/pyrollbar
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.16.3
Choose a base ref
...
head repository: rollbar/pyrollbar
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 1,962 additions and 1,141 deletions.
  1. +0 −17 .codeclimate.yml
  2. +91 −204 .github/workflows/ci.yml
  3. +1 −0 .gitignore
  4. +55 −0 CHANGELOG.md
  5. +52 −4 README.md
  6. +0 −31 UPGRADE_FROM_RATCHET.md
  7. +0 −19 default.nix
  8. +61 −0 pyproject.toml
  9. +131 −94 rollbar/__init__.py
  10. +24 −2 rollbar/contrib/django/middleware.py
  11. +45 −11 rollbar/contrib/fastapi/utils.py
  12. +1 −1 rollbar/contrib/pyramid/__init__.py
  13. +1 −2 rollbar/examples/flask/app.py
  14. +40 −95 rollbar/lib/__init__.py
  15. +10 −3 rollbar/lib/_async.py
  16. +38 −0 rollbar/lib/thread_pool.py
  17. +42 −0 rollbar/lib/transform.py
  18. +48 −68 rollbar/lib/transforms/__init__.py
  19. +77 −0 rollbar/lib/transforms/batched.py
  20. +9 −4 rollbar/lib/transforms/scrub.py
  21. +1 −0 rollbar/lib/transforms/scrub_redact.py
  22. +6 −4 rollbar/lib/transforms/scruburl.py
  23. +9 −23 rollbar/lib/transforms/serializable.py
  24. +133 −43 rollbar/lib/transforms/shortener.py
  25. +7 −5 rollbar/lib/transport.py
  26. +105 −76 rollbar/lib/traverse.py
  27. +55 −0 rollbar/lib/type_info.py
  28. +3 −1 rollbar/logger.py
  29. +5 −3 rollbar/test/__init__.py
  30. +2 −2 rollbar/test/asgi_tests/__init__.py
  31. +6 −0 rollbar/test/asgi_tests/test_integration.py
  32. +6 −9 rollbar/test/asgi_tests/test_middleware.py
  33. +2 −2 rollbar/test/asgi_tests/test_spec.py
  34. +2 −2 rollbar/test/async_tests/__init__.py
  35. +3 −6 rollbar/test/async_tests/test_async.py
  36. +2 −2 rollbar/test/fastapi_tests/__init__.py
  37. +7 −9 rollbar/test/fastapi_tests/test_logger.py
  38. +11 −12 rollbar/test/fastapi_tests/test_middleware.py
  39. +8 −11 rollbar/test/fastapi_tests/test_routing.py
  40. +51 −3 rollbar/test/fastapi_tests/test_utils.py
  41. +20 −4 rollbar/test/flask_tests/test_flask.py
  42. +2 −2 rollbar/test/starlette_tests/__init__.py
  43. +7 −9 rollbar/test/starlette_tests/test_logger.py
  44. +11 −12 rollbar/test/starlette_tests/test_middleware.py
  45. +5 −4 rollbar/test/starlette_tests/test_requests.py
  46. +59 −0 rollbar/test/test_batched_transform.py
  47. +69 −1 rollbar/test/test_lib.py
  48. +19 −22 rollbar/test/test_loghandler.py
  49. +1 −4 rollbar/test/test_pyramid.py
  50. +107 −52 rollbar/test/test_rollbar.py
  51. +13 −11 rollbar/test/test_scrub_redact_transform.py
  52. +15 −6 rollbar/test/test_scrub_transform.py
  53. +13 −15 rollbar/test/test_scruburl_transform.py
  54. +17 −25 rollbar/test/test_serializable_transform.py
  55. +221 −77 rollbar/test/test_shortener_transform.py
  56. +89 −0 rollbar/test/test_transform.py
  57. +128 −1 rollbar/test/test_traverse.py
  58. +3 −6 rollbar/test/twisted_tests/test_twisted.py
  59. +4 −0 rollbar/test/utils.py
  60. +0 −91 setup.py
  61. +0 −31 shell.nix
  62. +9 −0 tox.ini
17 changes: 0 additions & 17 deletions .codeclimate.yml

This file was deleted.

295 changes: 91 additions & 204 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -9,203 +9,112 @@ on:

jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8, 3.9, '3.10', 3.11, 3.12, 3.13]
framework:
- FLASK_VERSION=0.10.1 Werkzeug\>=0.7,\<1.0
- FLASK_VERSION=0.11.1 Werkzeug\>=0.7,\<1.0
- FLASK_VERSION=0.12.4 Werkzeug\>=0.7,\<1.0
- FLASK_VERSION=1.0.2
- TWISTED_VERSION=15.5.0 treq==15.1.0 zope.interface==4.1.3
- TWISTED_VERSION=16.1.0 treq==16.12.0 zope.interface==4.1.3
- TWISTED_VERSION=16.2.0 treq==16.12.0 zope.interface==4.1.3
- TWISTED_VERSION=16.3.0 treq==16.12.0 zope.interface==4.2.0
- TWISTED_VERSION=16.4.0 treq==16.12.0 zope.interface==4.5.0
- TWISTED_VERSION=16.5.0 treq==16.12.0 zope.interface==4.5.0
- TWISTED_VERSION=16.6.0 treq==16.12.0 zope.interface==4.5.0
- TWISTED_VERSION=17.1.0 treq==16.12.0 zope.interface==4.5.0
- DJANGO_VERSION=1.11.29
- DJANGO_VERSION=2.0.13
- DJANGO_VERSION=2.1.15
- DJANGO_VERSION=2.2.26
- DJANGO_VERSION=3.0.14
- DJANGO_VERSION=3.1.14
- DJANGO_VERSION=3.2.11
- DJANGO_VERSION=4.0.1
- PYRAMID_VERSION=1.9.2
- PYRAMID_VERSION=1.10.4
- STARLETTE_VERSION=0.12.12 httpx==0.18.1 python-multipart==0.0.5
- STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5
- STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5
- FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5
- FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5
- FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5
- NONE
- FLASK_VERSION=1.1.4
- FLASK_VERSION=2.3.3
- FLASK_VERSION=3.0.3
- DJANGO_VERSION=3.2.25
- DJANGO_VERSION=4.2.15
- DJANGO_VERSION=5.0.8
- TWISTED_VERSION=20.3.0
- TWISTED_VERSION=21.7.0
- TWISTED_VERSION=22.10.0
- PYRAMID_VERSION=1.10.8
- PYRAMID_VERSION=2.0.2
- STARLETTE_VERSION=0.30.0 httpx==0.24.1 python-multipart==0.0.9
- STARLETTE_VERSION=0.38.2 httpx==0.27.0 python-multipart==0.0.9
- FASTAPI_VERSION=0.101.1 httpx==0.24.1 python-multipart==0.0.9
- FASTAPI_VERSION=0.112.1 httpx==0.27.0 python-multipart==0.0.9
exclude:
- python-version: 2.7
framework: DJANGO_VERSION=2.0.13
- python-version: 2.7
framework: DJANGO_VERSION=2.1.15
- python-version: 2.7
framework: DJANGO_VERSION=2.2.26
- python-version: 2.7
framework: DJANGO_VERSION=3.0.14
- python-version: 2.7
framework: DJANGO_VERSION=3.1.14
- python-version: 2.7
framework: DJANGO_VERSION=3.2.11
- python-version: 2.7
framework: DJANGO_VERSION=4.0.1
- python-version: 3.4
framework: DJANGO_VERSION=2.1.15
- python-version: 3.4
framework: DJANGO_VERSION=2.2.26
- python-version: 3.4
framework: DJANGO_VERSION=3.0.14
- python-version: 3.4
framework: DJANGO_VERSION=3.1.14
- python-version: 3.4
framework: DJANGO_VERSION=3.2.11
- python-version: 3.4
framework: DJANGO_VERSION=4.0.1
- python-version: 3.5
framework: DJANGO_VERSION=3.0.14
- python-version: 3.5
framework: DJANGO_VERSION=3.1.14
- python-version: 3.5
framework: DJANGO_VERSION=3.2.11
- python-version: 3.5
framework: DJANGO_VERSION=4.0.1
- python-version: 3.6
framework: DJANGO_VERSION=4.0.1
- python-version: 3.7
framework: DJANGO_VERSION=4.0.1
- python-version: 3.8
framework: DJANGO_VERSION=1.11.29
- python-version: 3.8
framework: DJANGO_VERSION=2.0.13
- python-version: 3.8
framework: DJANGO_VERSION=2.1.15
# Test frameworks on the python versions they support, according to pypi registry
# Flask
- framework: FLASK_VERSION=2.3.3
python-version: 3.6
- framework: FLASK_VERSION=2.3.3
python-version: 3.7
- framework: FLASK_VERSION=3.0.3
python-version: 3.6
- framework: FLASK_VERSION=3.0.3
python-version: 3.7

# Django
- framework: DJANGO_VERSION=3.2.25
python-version: 3.11
- framework: DJANGO_VERSION=3.2.25
python-version: 3.12
- framework: DJANGO_VERSION=4.2.15
python-version: 3.6
- framework: DJANGO_VERSION=4.2.15
python-version: 3.7
- framework: DJANGO_VERSION=5.0.8
python-version: 3.6
- framework: DJANGO_VERSION=5.0.8
python-version: 3.7
- framework: DJANGO_VERSION=5.0.8
python-version: 3.8
- framework: DJANGO_VERSION=5.0.8
python-version: 3.9

# Twisted
- framework: TWISTED_VERSION=20.3.0
python-version: 3.11
- framework: TWISTED_VERSION=20.3.0
python-version: 3.12
- framework: TWISTED_VERSION=20.3.0
python-version: 3.13
- framework: TWISTED_VERSION=22.10.0
python-version: 3.6

# Starlette
- framework: STARLETTE_VERSION=0.30.0 httpx==0.24.1 python-multipart==0.0.9
python-version: 3.6
- framework: STARLETTE_VERSION=0.30.0 httpx==0.24.1 python-multipart==0.0.9
python-version: 3.7
- framework: STARLETTE_VERSION=0.38.2 httpx==0.27.0 python-multipart==0.0.9
python-version: 3.6
- framework: STARLETTE_VERSION=0.38.2 httpx==0.27.0 python-multipart==0.0.9
python-version: 3.7

# FastAPI
- framework: FASTAPI_VERSION=0.101.1 httpx==0.24.1 python-multipart==0.0.9
python-version: 3.6
- framework: FASTAPI_VERSION=0.101.1 httpx==0.24.1 python-multipart==0.0.9
python-version: 3.7
- framework: FASTAPI_VERSION=0.112.1 httpx==0.27.0 python-multipart==0.0.9
python-version: 3.6
- framework: FASTAPI_VERSION=0.112.1 httpx==0.27.0 python-multipart==0.0.9
python-version: 3.7

# twisted/treq setup.py allows:
# Twisted < 18.7.0 on python < 3.7
# Twisted >= 18.7.0 on python >= 3.7
# So we put twisted < 18.x in the matrix
# and disallow python 3.7 and 3.8 here.
- python-version: 3.7
framework: TWISTED_VERSION=15.5.0 treq==15.1.0 zope.interface==4.1.3
- python-version: 3.7
framework: TWISTED_VERSION=16.1.0 treq==16.12.0 zope.interface==4.1.3
- python-version: 3.7
framework: TWISTED_VERSION=16.2.0 treq==16.12.0 zope.interface==4.1.3
- python-version: 3.7
framework: TWISTED_VERSION=16.3.0 treq==16.12.0 zope.interface==4.2.0
- python-version: 3.7
framework: TWISTED_VERSION=16.4.0 treq==17.8.0 zope.interface==4.2.0
- python-version: 3.7
framework: TWISTED_VERSION=16.5.0 treq==17.8.0 zope.interface==4.2.0
- python-version: 3.7
framework: TWISTED_VERSION=16.6.0 treq==17.8.0 zope.interface==4.3.0
- python-version: 3.7
framework: TWISTED_VERSION=17.1.0 treq==20.4.1 zope.interface==4.3.0
- python-version: 3.8
framework: TWISTED_VERSION=15.5.0 treq==15.1.0 zope.interface==4.1.3
- python-version: 3.8
framework: TWISTED_VERSION=16.1.0 treq==16.12.0 zope.interface==4.1.3
- python-version: 3.8
framework: TWISTED_VERSION=16.2.0 treq==16.12.0 zope.interface==4.1.3
- python-version: 3.8
framework: TWISTED_VERSION=16.3.0 treq==16.12.0 zope.interface==4.2.0
- python-version: 3.8
framework: TWISTED_VERSION=16.4.0 treq==17.8.0 zope.interface==4.2.0
- python-version: 3.8
framework: TWISTED_VERSION=16.5.0 treq==17.8.0 zope.interface==4.3.0
- python-version: 3.8
framework: TWISTED_VERSION=16.6.0 treq==17.8.0 zope.interface==4.3.0
- python-version: 3.8
framework: TWISTED_VERSION=17.1.0 treq==20.4.1 zope.interface==4.3.0

- python-version: 2.7
framework: STARLETTE_VERSION=0.12.12 httpx==0.18.1 python-multipart==0.0.5
- python-version: 2.7
framework: STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5
- python-version: 2.7
framework: STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5
- python-version: 3.4
framework: STARLETTE_VERSION=0.12.12 httpx==0.18.1 python-multipart==0.0.5
- python-version: 3.4
framework: STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5
- python-version: 3.4
framework: STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5
- python-version: 3.5
framework: STARLETTE_VERSION=0.12.12 httpx==0.18.1 python-multipart==0.0.5
- python-version: 3.5
framework: STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5
- python-version: 3.5
framework: STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5

- python-version: 2.7
framework: FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5
- python-version: 2.7
framework: FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5
- python-version: 2.7
framework: FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5
- python-version: 3.4
framework: FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5
- python-version: 3.4
framework: FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5
- python-version: 3.4
framework: FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5
- python-version: 3.5
framework: FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5
- python-version: 3.5
framework: FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5
- python-version: 3.5
framework: FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5
include:
- python-version: 2.7
framework: FLASK_VERSION=0.9
- python-version: 3.4
framework: DJANGO_VERSION=1.7.11
- python-version: 3.4
framework: DJANGO_VERSION=1.8.19
- python-version: 3.4
framework: DJANGO_VERSION=1.9.13
- python-version: 3.4
framework: DJANGO_VERSION=1.10.8
- python-version: 3.5
framework: DJANGO_VERSION=1.8.19
- python-version: 3.5
framework: DJANGO_VERSION=1.9.13
- python-version: 3.5
framework: DJANGO_VERSION=1.10.8
- python-version: 3.7
framework: TWISTED_VERSION=18.9.0 treq==20.4.1 zope.interface==4.5.0
- python-version: 3.7
framework: TWISTED_VERSION=19.10.0 treq==20.4.1 zope.interface==4.6.0
- python-version: 3.7
framework: TWISTED_VERSION=20.3.0 treq==20.4.1 zope.interface==4.7.0
- python-version: 3.8
framework: TWISTED_VERSION=18.9.0 treq==20.4.1 zope.interface==4.5.0
- python-version: 3.8
framework: TWISTED_VERSION=19.10.0 treq==20.4.1 zope.interface==4.6.0
- python-version: 3.8
framework: TWISTED_VERSION=20.3.0 treq==20.4.1 zope.interface==4.7.0
steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: pip install setuptools==39.2.0 --force-reinstall
- name: Install Python Test dependencies
run: pip install requests webob blinker httpx

- name: Install Python 3.6 dependencies
if: ${{ contains(matrix.python-version, '3.6') }}
# typing-extensions dropped support for Python 3.6 in version 4.2
run: pip install "typing-extensions<4.2" requests==2.27.0 blinker==1.5 immutables==0.19 webob blinker httpx aiocontextvars

- name: Install Python 3.7 dependencies
if: ${{ contains(matrix.python-version, '3.7') }}
# immutables dropped support for Python<3.8 in version 0.20
run: pip install immutables==0.19

- name: Set the framework
if: ${{ matrix.framework != 'NONE' }}
run: echo ${{ matrix.framework }} >> $GITHUB_ENV

- name: Install Flask
@@ -232,27 +141,5 @@ jobs:
if: ${{ contains(matrix.framework, 'FASTAPI_VERSION') }}
run: pip install fastapi==$FASTAPI_VERSION

- name: Install Python 2 dependencies
if: ${{ contains(matrix.python-version, '2.7') }}
# certifi dropped support for Python 2 in 2020.4.5.2 but only started
# using Python 3 syntax in 2022.5.18. 2021.10.8 is the last release with
# Python 2 support.
run: pip install certifi==2021.10.8

- name: Install Python 3.4 dependencies
if: ${{ contains(matrix.python-version, '3.4') }}
# certifi uses the 'typing' from Python 3.5 module starting in 2022.5.18
run: pip install certifi==2021.10.8 "typing-extensions<4"

- name: Install Python 3.5 dependencies
if: ${{ contains(matrix.python-version, '3.5') }}
# typing-extensions dropped support for Python 3.5 in version 4
run: pip install "typing-extensions<4"

- name: Install Python 3.6 dependencies
if: ${{ contains(matrix.python-version, '3.6') }}
# typing-extensions dropped support for Python 3.6 in version 4.2
run: pip install "typing-extensions<4.2"

- name: Run tests
run: python setup.py test
run: python -m unittest rollbar.test.discover
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -11,3 +11,4 @@ Pipfile
Pipfile.lock
.pytest_cache/
.python-version
.tox/
Loading