newrelic / newrelic-python-agent

New Relic Python Agent
https://docs.newrelic.com/docs/agents/python-agent
Apache License 2.0
176 stars 99 forks source link

Fix Environment Scraping Logic #1172

Closed TimPansino closed 3 months ago

TimPansino commented 3 months ago

Overview

  File "/__w/newrelic-python-agent/newrelic-python-agent/.tox/python-agent_unittests-py27-with_extensions/lib/python2.7/site-packages/newrelic/core/environment.py", line 246, in environment_settings
    if version or nr_hook:
UnboundLocalError: local variable 'version' referenced before assignment
github-actions[bot] commented 3 months ago

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Elapsed time
❌ PYTHON bandit 1 1 5.05s
✅ PYTHON black 1 0 0 0.77s
✅ PYTHON flake8 1 0 0.47s
✅ PYTHON isort 1 0 0 0.2s
✅ PYTHON pylint 1 0 3.2s

See detailed report in MegaLinter reports _Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff_

_MegaLinter is graciously provided by OX Security_

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 81.66%. Comparing base (541d126) to head (861f91c).

Files Patch % Lines
newrelic/core/environment.py 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1172 +/- ## ========================================== + Coverage 81.60% 81.66% +0.05% ========================================== Files 195 195 Lines 21667 21668 +1 Branches 3781 3781 ========================================== + Hits 17682 17695 +13 + Misses 2890 2877 -13 - Partials 1095 1096 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.