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

Fetch code from files before changing the file path #246

Merged
merged 4 commits into from
Dec 3, 2020

Conversation

imjoehaines
Copy link
Contributor

Goal

Currently we trim the project root from file names before fetching the code for the file. This breaks if the file we want is in the project root, but not in the PWD (see #245)

To fix this, we will now fetch the code using the absolute path of the file

Changeset

  • .github/workflows/python-package.yml
    disable fail-fast as it can hide failures (e.g. if Python 3.5 fails, 3.6 will be cancelled and so you can't tell if it passes)
  • bugsnag/event.py
    Fetch the code before (potentially) removing the project root from the file path
  • tox.ini
    Install compatible version of pytest-django on Django < 2.2 (see v4.0.0 changelog). I'm not sure why this now requires six to be installed explicitly when it didn't before though :/

Testing

One of the existing tests actually covered this case, it just didn't assert on the code

I also manually tested this before & after with the repro case in #245:

Before After
image image

Previously we made file paths that matched the project root relative,
which then could only be resolved from the PWD

Now we fetch the code before trimming the project root, so that we
are using the absolute path to the file and can find things that
are outside of the PWD
@imjoehaines imjoehaines merged commit 80cfe0c into next Dec 3, 2020
@imjoehaines imjoehaines deleted the fetch-code-before-trimming-path branch December 3, 2020 11:03
@kattrali kattrali mentioned this pull request Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants