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

Upgrading jsonschema to 4.18+ to resolve security issues with older dependencies breaks starfish #2020

Open
shachafl opened this issue Sep 15, 2024 · 3 comments
Labels
bug An issue with an existing feature dependencies Pull requests that update a dependency file

Comments

@shachafl
Copy link
Collaborator

Description

To resolve a few security issues with older dependencies, I wish to upgrade jsonschema to 4.18+, but this breaks starfish and throws errors in testing as RefResolver was deprecated (https://python-jsonschema.readthedocs.io/en/latest/referencing/).

Steps/Code to Reproduce

git clone https://github.com/spacetx/starfish.git
cd starfish/
python -m venv .venv3.9
source .venv3.9/bin/activate
make install-dev
pip install -U jsonschema
make fast-test

Expected Results

Something like:
======== 370 passed, 3 skipped, 120 warnings in 42.88s ==================

Actual Results

================= short test summary info =======================
FAILED starfish/core/config/test/test_config.py::test_cache_merfish[enabled-expected0-config0] - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/config/test/test_config.py::test_cache_merfish[disabled-expected1-config1] - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/config/test/test_config.py::test_cache_merfish[limited-expected2-config2] - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_codebook.py::test_codebook_validate - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_experiment.py::test_fov - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_experiment.py::test_nuclei_must_be_present - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_fuzz.py::test_fuzz_experiment - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_field_of_view.py::test_dartfish_example_field_of_view - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_experiment.py::test_version_must_be_semantic - Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
FAILED starfish/core/spacetx_format/test_field_of_view.py::test_too_large - Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
FAILED starfish/core/spacetx_format/test_field_of_view.py::test_dartfish_nuclei_example_field_of_view - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_fov_manifest.py::test_fov_manifest - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_field_of_view.py::test_channel_must_be_present - Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
FAILED starfish/core/spacetx_format/test_experiment.py::test_dartfish_example_experiment - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_fuzz.py::test_fuzz_codebook - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_field_of_view.py::test_round_must_be_present - Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
FAILED starfish/core/spacetx_format/test_experiment.py::test_no_manifest_example_experiment - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_field_of_view.py::test_field_of_view - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_codebook.py::test_codebook - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_codebook.py::test_diagonal_codebook - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_codebook.py::test_diagonal_codebook_full_values - jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '.../starfish/starfish/spacetx...
FAILED starfish/core/spacetx_format/test_codebook.py::test_codebook_missing_channel_raises_validation_error - Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
======= 22 failed, 348 passed, 3 skipped, 136 warnings in 41.19s ==============

Versions

Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Python 3.9.18 (main, May 17 2024, 10:28:50)
[GCC 11.4.0]

@shachafl shachafl added the bug An issue with an existing feature label Sep 15, 2024
@shachafl
Copy link
Collaborator Author

@joshmoore can you please assist with this issue?

@joshmoore
Copy link
Member

Do you have a commit where you have tried using a Registry rather than the RefResolver?

@shachafl
Copy link
Collaborator Author

No. I had difficulties solving the previous bug with jsonschema and
was hoping someone more knowledgeable would carry the baton for this one.

@shachafl shachafl added the dependencies Pull requests that update a dependency file label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue with an existing feature dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

2 participants