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

Fix include query parameter #202

Merged
merged 8 commits into from Mar 3, 2020
Merged

Conversation

CasperWA
Copy link
Member

@CasperWA CasperWA commented Mar 2, 2020

Fixes #200

Currently, the fix is only a hack for keeping in line with the current idea of how the query URL string should work.
It should be properly fixed to reflect the final decision.

It also updates dependencies and removes the temporary direct dependency on idna, since the issue has been fixed in the newest release of requests.

@codecov
Copy link

codecov bot commented Mar 2, 2020

Codecov Report

Merging #202 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #202      +/-   ##
==========================================
+ Coverage   86.26%   86.29%   +0.03%     
==========================================
  Files          40       39       -1     
  Lines        1871     1846      -25     
==========================================
- Hits         1614     1593      -21     
+ Misses        257      253       -4
Flag Coverage Δ
#unittests 86.29% <100%> (+0.03%) ⬆️
Impacted Files Coverage Δ
optimade/server/routers/utils.py 95.77% <100%> (+0.02%) ⬆️
optimade/server/routers/links.py 90% <100%> (-0.48%) ⬇️
optimade/server/main.py 77.96% <100%> (-1.07%) ⬇️
optimade/server/routers/structures.py 100% <100%> (ø) ⬆️
optimade/server/routers/references.py 100% <100%> (ø) ⬆️
optimade/server/routers/info.py 96.15% <100%> (-0.15%) ⬇️
optimade/server/routers/landing.py 66.66% <100%> (ø) ⬆️
optimade/server/main_index.py 79.59% <100%> (-1.18%) ⬇️
optimade/server/exception_handlers.py 74.07% <100%> (-0.48%) ⬇️
optimade/server/routers/index_info.py 100% <100%> (ø) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 840d416...df95127. Read the comment docs.

@ml-evs
Copy link
Member

ml-evs commented Mar 3, 2020

Thanks for spotting that error @CasperWA, I think this is ready to merge now right?

@ml-evs ml-evs marked this pull request as ready for review March 3, 2020 16:16
@CasperWA CasperWA requested a review from ml-evs March 3, 2020 16:35
@CasperWA
Copy link
Member Author

CasperWA commented Mar 3, 2020

Thanks for spotting that error @CasperWA, I think this is ready to merge now right?

One final thing - should we set a minimum version for requests now that we are aware of the idna issue?
I.e. set requests~=2.23

Edit: Done.

Copy link
Member

@ml-evs ml-evs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our first net-negative PR perhaps? A sign of maturity! 👍

@ml-evs ml-evs merged commit ade8f64 into master Mar 3, 2020
@CasperWA CasperWA deleted the fix_200_updated_query_string_behaviour branch March 4, 2020 09:37
@CasperWA CasperWA mentioned this pull request Mar 5, 2020
CasperWA added a commit that referenced this pull request Mar 6, 2020
Up to v0.6.0.

**New features**:
- GitHub Action validator that runs `optimade_validator` for a locally running OPTiMaDe server (#191, @CasperWA, tested by @ml-evs)
- Support filter queries for `HAS ALL`, `HAS ANY` and `HAS ONLY` and value lists on MongoDB backends (#173, @ml-evs)
  Note: `OPERATOR` use in value lists are still _not_ supported.
- Debug mode. Start the server in debug mode to enable `debug` log-level in `uvicorn` and get a full Python traceback in the JSON response (#190, @CasperWA)
- Add testing of mandatory `filter` queries to `optimade_validator` (#205, @ml-evs)

**Updates**:
- Allow Cross-Origin requests from anywhere (`*`), i.e., enable CORS for both servers (#194, @CasperWA)
- Updates to models (correct misspelling, more transparent model class naming, streamline models with respect to python class inheritance, update field descriptions) (#195, @CasperWA)
- API change: Rename `optimade.models.toplevel.py` to `optimade.models.responses.py` (#195, @CasperWA)
- Update dependencies to newest versions (as of 02.03.2020) (#202, #196, @CasperWA)
- Move imports from `starlette` to `fastapi`, where possible (#202, @ml-evs)
- Remove custom middleware to redirect slashed URLs in favor of `starlette` implementation (#202, @ml-evs)
- CI tests are now performed with a real MongoDB in the backend. CI tests are also performed with a `mongomock` backend for the tests in `server/test_middleware.py`, `server/test_server_validation.py`, and `server/test_config.py` (#196, @ml-evs, additional testing by @CasperWA )
- Remove `/optimade` from base URLs. This was especially important for the OpenAPI schema (#201, #216, @CasperWA, @ml-evs)
- Check integrity of query part of the raw URL using a custom middleware (#209, @CasperWA)
- New `optimade/server/exceptions.py` to contain custom `HttpException`s, moved `BadRequest` here (#209, @CasperWA)
- Pattern and regex testing for `data.available_api_versions` parts in `/info` endpoint and fix tests for the same (#211, @CasperWA)
- Restructure import of test data for regular server (#212, @shyamd)

**Bug fixes**:
- New retrieval URL for Materials-Consortia's list of providers (#187, @CasperWA)
- Skip local `HAS ONLY` tests with a `mongomock` backend, since v3.19.0 does not support these (#206, @ml-evs)
- Resource ID's can now contain slashes (`/`) (#183, @ml-evs, @CasperWA)
- Remove _valid_ version part of base URL in `meta.query.representation` (#201, @CasperWA)
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.

Updates to FastAPI - general dependency updates - Updated query string behaviour
2 participants