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: Added precedence of CLI parameters over envs #3190

Merged

Conversation

kedod
Copy link
Contributor

@kedod kedod commented Mar 12, 2024

Description

  • Added precedence of CLI parameters over envs

  • Add docs

  • Add tests for envs

  • Refactor

Closes #3188

@kedod kedod force-pushed the 3188-fix-consistency-in-cli-command branch from 1904dc9 to 134294b Compare March 12, 2024 07:07
Copy link

codecov bot commented Mar 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.25%. Comparing base (272a423) to head (1734dfe).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3190      +/-   ##
===========================================
- Coverage    98.27%   98.25%   -0.03%     
===========================================
  Files          322      322              
  Lines        14676    14651      -25     
  Branches      2330     2327       -3     
===========================================
- Hits         14423    14395      -28     
- Misses         112      116       +4     
+ Partials       141      140       -1     

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

@kedod kedod force-pushed the 3188-fix-consistency-in-cli-command branch 8 times, most recently from 0983620 to ec17254 Compare March 14, 2024 21:47
@kedod kedod marked this pull request as ready for review March 14, 2024 21:51
@kedod kedod requested review from a team as code owners March 14, 2024 21:51
Copy link
Contributor

@peterschutt peterschutt left a comment

Choose a reason for hiding this comment

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

Thanks @kedod - I agree that cli args should take precedence over env vars. A few comments, LMK if I've misunderstood anything.

Cheers.

Copy link

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

Copy link
Contributor

@peterschutt peterschutt left a comment

Choose a reason for hiding this comment

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

LGTM, cheers!

@JacobCoffee
Copy link
Member

youre on a roll 🎉

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.

@kedod Since you added the CommaSeparatedPath as a type, that would make this a feature and you'd have to target develop with it.

You could either do that or split that particular change into a different PR.

@kedod kedod force-pushed the 3188-fix-consistency-in-cli-command branch from 0e06265 to 0340e0a Compare March 17, 2024 14:55
@kedod kedod changed the base branch from main to develop March 17, 2024 14:55
@kedod
Copy link
Contributor Author

kedod commented Mar 17, 2024

@kedod Since you added the CommaSeparatedPath as a type, that would make this a feature and you'd have to target develop with it.

You could either do that or split that particular change into a different PR.

Rebased to dev.

@kedod kedod changed the title fix: Added precedence of CLI parameters over envs feat: Added precedence of CLI parameters over envs Mar 17, 2024
@kedod kedod force-pushed the 3188-fix-consistency-in-cli-command branch from 0340e0a to 375aad3 Compare March 17, 2024 15:07
@JacobCoffee JacobCoffee enabled auto-merge (squash) March 17, 2024 17:52
@JacobCoffee JacobCoffee added this to the 2.8.0 milestone Mar 17, 2024
@JacobCoffee JacobCoffee disabled auto-merge March 17, 2024 17:55
@JacobCoffee JacobCoffee merged commit 9b9159d into litestar-org:develop Mar 17, 2024
19 of 20 checks passed
provinzkraut pushed a commit that referenced this pull request Mar 18, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
provinzkraut pushed a commit that referenced this pull request Mar 18, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
JacobCoffee added a commit that referenced this pull request Mar 22, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
provinzkraut pushed a commit that referenced this pull request Mar 29, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
provinzkraut pushed a commit to robswc/litestar that referenced this pull request Mar 29, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
provinzkraut pushed a commit to robswc/litestar that referenced this pull request Mar 29, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
provinzkraut pushed a commit that referenced this pull request Mar 29, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
provinzkraut pushed a commit that referenced this pull request Mar 30, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
guacs pushed a commit that referenced this pull request Apr 1, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
JacobCoffee added a commit that referenced this pull request Apr 5, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
peterschutt added a commit that referenced this pull request Apr 5, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
provinzkraut pushed a commit to robswc/litestar that referenced this pull request Apr 7, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
provinzkraut pushed a commit to robswc/litestar that referenced this pull request Apr 7, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
cofin pushed a commit that referenced this pull request Aug 25, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
cofin pushed a commit that referenced this pull request Aug 25, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
provinzkraut pushed a commit that referenced this pull request Aug 25, 2024
* feat: Added precedence of CLI parameters over envs

* Update docs/usage/cli.rst

Co-authored-by: Peter Schutt <[email protected]>

* Remove redundant LitestarEnv fields and fix tests

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

* Update docs/usage/cli.rst

* Update docs/usage/cli.rst

* Update litestar/cli/commands/core.py

---------

Co-authored-by: kedod <kedod>
Co-authored-by: Peter Schutt <[email protected]>
Co-authored-by: Jacob Coffee <[email protected]>
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.

Bug: Arguments precedence inconsistency in CLI run command
4 participants