⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@steveny91
Copy link
Contributor

What does this PR do?

  • Fix an issue where the cahce file wasn't working correctly in windows.
  • Don't check for updates when the current version is a dev version

@steveny91 steveny91 changed the title ignore dev releases and fix cache directory Ignore upgrade check in dev versions and also fix windows cache location Jan 15, 2026
@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.00%. Comparing base (a4a801c) to head (81980d2).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@steveny91 steveny91 marked this pull request as ready for review January 15, 2026 21:44
@steveny91 steveny91 requested a review from a team as a code owner January 15, 2026 21:44
Copy link
Contributor

@AAraKKe AAraKKe left a comment

Choose a reason for hiding this comment

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

Thanks @steveny91 !! Added some comments and a general set of requests not related with this comment but with the original implementation.

return Path(user_cache_dir('ddev', appauthor=False)).expanduser() / "upgrade_check.json"


CACHE_FILE = default_cache_file()
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: I would probably remove this constant and made the cache file parameter None by default. The reason is that even though we are importing platformdirs in the method itself, this method will be called everytime we import the module, defeating the purpose of importing platformdirs only when needed.

This is a suggestion because we already import platformdirs to work with the config file, which is needed on startup of the cli, so we are really not benefiting a lot. But to be consistent with minimizing the number of imports we do I think we should move in that direction.

try:
version_to_cache = last_version if last_version else current_version
write_last_run(version_to_cache, date_now, cache_file)
except OSError:
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: when we do try/except -> pass there is a more idiomatic way of doing it using the contextlib.supress method.

Copy link
Contributor

Choose a reason for hiding this comment

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

request: these are general requests on the overall file. We should build this to follow our cli design. This means that:

  • Remove logging import, we do not log with logging and using debug, info or other logging levels cannot be controlled in ddev. We use our console printing for this controlled by verbosity levels to be able to format the output.
  • We should inject the console, or our Terminal wrapper, which is what Application inherits from, into this command and use the proper methods to write to terminal. I.e. inject the app itself into the upgrade_check method and use its own display_* methods to print information on screen.
  • This remove the need of using ANSI escape codes when printing with formatting.
  • Annotate all methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants