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

feat: add cache store parameter on route level basis #3869

Conversation

dylandoamaral
Copy link

@dylandoamaral dylandoamaral commented Nov 21, 2024

Description

Allow the user to define on a route level basis what would be the used namespace by overriding the default one. It allows, as an example, to delete some routes easily solely based on the namespace.

This is my first commit in this repository, I don't know if I did it right. Sorry for the inconvenience ! By the way, after reading the documentation for contributing, I don't know when and if I have to run the all-contributors myself.

I will also have to update the documentation, but first I prefer someone to tell me if this feature should be merged or ignored :).

Closes

Closes #3854

eliasfandi and others added 30 commits September 30, 2024 08:32
…ect plugin being added in tutorial (litestar-org#3768)

Update line emphasis sqlalchemy "Using the init plugin" tutorial
…star-org#3802)

* docs: change the `ExperimentalFeatures.DTO_CODEGEN` description

* docs: change the `ExperimentalFeatures.DTO_CODEGEN` description
* docs: fix "DTO Factory and PATCH requests" section

* docs: fix "DTO Factory and PATCH requests" section

* Adjust highlighted indexes
* docs: fix `DTO Data` section with a new example

* Update docs/usage/dto/1-abstract-dto.rst

Co-authored-by: Alc-Alc <[email protected]>

---------

Co-authored-by: Alc-Alc <[email protected]>
* docs: rewrite "Builtin middleware" usage

* Fix CI

* Address review by @Alc-Alc
)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
cofin and others added 8 commits November 15, 2024 19:02
* feat: deprecate `litestar.contrib.pydantic`
…itestar-org#3860)

* docs: added `debug==True` in Testing to display exception stack trace

* docs: ruff-format

* docs: add `app.debug = True` to the fixture sample code
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Jacob Coffee <[email protected]>
Co-authored-by: guacs <[email protected]>
moves `litestar.contrib.prometheus` to `litestar.plugins.prometheus`
@dylandoamaral dylandoamaral requested review from a team as code owners November 21, 2024 16:20
@github-actions github-actions bot added area/middleware This PR involves changes to the middleware size: small type/feat pr/external Triage Required 🏥 This requires triage labels Nov 21, 2024
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 99.25558% with 6 lines in your changes missing coverage. Please review.

Project coverage is 98.41%. Comparing base (b187749) to head (e39b1b4).
Report is 25 commits behind head on v3.0.

Files with missing lines Patch % Lines
litestar/connection/request.py 90.32% 1 Missing and 2 partials ⚠️
litestar/_openapi/schema_generation/examples.py 50.00% 1 Missing ⚠️
litestar/plugins/prometheus/middleware.py 98.75% 0 Missing and 1 partial ⚠️
litestar/plugins/pydantic/utils.py 99.44% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             v3.0    #3869      +/-   ##
==========================================
+ Coverage   98.35%   98.41%   +0.05%     
==========================================
  Files         332      343      +11     
  Lines       15460    15457       -3     
  Branches     2460     1702     -758     
==========================================
+ Hits        15206    15212       +6     
- Misses        112      115       +3     
+ Partials      142      130      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3869

Copy link
Member

@provinzkraut provinzkraut left a comment

Choose a reason for hiding this comment

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

Hey @dylandoamaral, thanks for the PR!

The change is okay in general, but due to the change in the get_store_from_app signature, it would be considered breaking. You could either try to find a way to make this not breaking, or target version 3 by pointing your PR at the v3.0 branch

@dylandoamaral
Copy link
Author

Thanks for your response. It is still breaking even with an optional defaulted value ?

@provinzkraut
Copy link
Member

Thanks for your response. It is still breaking even with an optional defaulted value ?

Yes, it would.

For example, if someone has overwritten this method in a subclass, it would break for them, because their subclass does not know of this parameter.

@dylandoamaral dylandoamaral changed the base branch from main to v3.0 November 22, 2024 14:59
@dylandoamaral
Copy link
Author

dylandoamaral commented Nov 22, 2024

Oh v3.0 is not up to date with develop, my bad I will need to fix it.

@dylandoamaral
Copy link
Author

Supersed by #3871

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/middleware This PR involves changes to the middleware pr/external size: small Triage Required 🏥 This requires triage type/feat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Allow the cache to specify the namespace on a route level