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

Fixes typo in Caching envvar #424

Merged

Conversation

mynameisfiber
Copy link
Contributor

@mynameisfiber mynameisfiber commented Apr 8, 2024

Envvar to set caching mode was previously CLOUPATHLIB_FILE_CACHE_MODE (missing D in CLOUDPATHLIB). This commit fixes this typo and introduces some code to help migrate projects to the new envvar. The current logic for migration warnings is:

  • If the old envvar is set and not the new one, use the old one and issue a deprecation warning
  • If the old and new envvars are set, use the new version and issue a warning if the two disagree

Closes #423


Contributor checklist:

  • I have read and understood CONTRIBUTING.md
  • Confirmed an issue exists for the PR, and the text Closes #issue appears in the PR summary (e.g., Closes #123).
  • Confirmed PR is rebased onto the latest base
  • Confirmed failure before change and success after change
  • Any generic new functionality is replicated across cloud providers if necessary
  • Tested manually against live server backend for at least one provider
  • Added tests for any new functionality
  • Linting passes locally
  • Tests pass locally
  • Updated HISTORY.md with the issue that is addressed and the PR you are submitting. If the top section is not `## UNRELEASED``, then you need to add a new section to the top of the document for your change.

Envvar to set caching mode was previously CLOUPATHLIB_FILE_CACHE_MODE
(missing D in CLOUDPATHLIB). This commit fixes this typo and introduces
some code to help migrate projects to the new envvar. The current logic
for migration warnings is:

- If the old envvar is set and not the new one, use the old one and
  issue a deprecation warning
- If the old and new envvars are set, use the new version and issue a
  warning if the two disagree
Copy link
Member

@pjbull pjbull left a comment

Choose a reason for hiding this comment

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

Great, thanks! I think this should be good when the tests are passing. You should be able to run locally to diagnose with the make test command:
https://cloudpathlib.drivendata.org/stable/contributing/#tests

Could you also file an issue to remove the deprecated code in a future release?

cloudpathlib/enums.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Apr 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.4%. Comparing base (d368501) to head (4ec2833).

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #424     +/-   ##
========================================
- Coverage    93.8%   93.4%   -0.4%     
========================================
  Files          23      23             
  Lines        1639    1646      +7     
========================================
+ Hits         1538    1539      +1     
- Misses        101     107      +6     
Files Coverage Δ
cloudpathlib/enums.py 100.0% <100.0%> (ø)

... and 3 files with indirect coverage changes

@pjbull pjbull changed the base branch from master to 424-live-tests April 9, 2024 16:16
@pjbull pjbull merged commit 65e9ad2 into drivendataorg:424-live-tests Apr 9, 2024
22 of 24 checks passed
@pjbull
Copy link
Member

pjbull commented Apr 9, 2024

Moving to repo-local branch where the live backend tests can run. Thanks @mynameisfiber!

pjbull added a commit that referenced this pull request Apr 9, 2024
* Fixes typo in Caching envvar

Envvar to set caching mode was previously CLOUPATHLIB_FILE_CACHE_MODE
(missing D in CLOUDPATHLIB). This commit fixes this typo and introduces
some code to help migrate projects to the new envvar. The current logic
for migration warnings is:

- If the old envvar is set and not the new one, use the old one and
  issue a deprecation warning
- If the old and new envvars are set, use the new version and issue a
  warning if the two disagree

* Added deprecation version

* Fully reset envvars after testing

Co-authored-by: Micha Gorelick <[email protected]>
@jayqi jayqi mentioned this pull request Apr 9, 2024
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.

Typo in Cache Mode envvar
2 participants