Skip to content

Conversation

@steveny91
Copy link
Contributor

What does this PR do?

Periodically check pypi for new versions of ddev.

Config is on by default. But can be controlled with upgrade_check in the config toml file. It keeps track of this in a json file cache file. It saves the version and the date.

Logic goes:

  1. See if file exist or if the last time it checked was 7 days ago or older
    2a. If file doesn't exist or is older than 7 days, ping pypi to get latest version and right it to file
    2b. if file exist and is not older than 7 days, read from the json file
    3 If current version is older than the checked latest version, print out a message after every ddev command

Example:

ddev test ddev -fs
────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ddev ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────────────────────────────────────────────────── lint ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
cmd [1] | ruff format  --config ./pyproject.toml .
2 files reformatted, 225 files left unchanged
cmd [2] | ruff check --fix --config ./pyproject.toml .
src/ddev/cli/upgrade_check.py:57:27: G004 Logging statement uses f-string
   |
55 |                 atexit.register(exit_handler, app, msg)
56 |         except requests.RequestException as e:
57 |             logging.debug(f"Upgrade check failed: {e}")
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ G004
58 |     else:
59 |         if last_version < current_version:
   |

Found 2 errors (1 fixed, 1 remaining).
Some formatting errors are still found for which ruff has no fixes available. You would need to fix them manually.

!!An upgrade to version 12.0.0 is available for ddev. Your current version is 11.0.1.dev20!!

@steveny91 steveny91 marked this pull request as ready for review July 3, 2025 19:34
@steveny91 steveny91 requested a review from a team as a code owner July 3, 2025 19:34
@codecov
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

❌ Patch coverage is 49.31507% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.17%. Comparing base (cb7659f) to head (4922e08).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
Flag Coverage Δ
krakend ?
lustre ?
proxmox ?

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 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.

lucia-sb
lucia-sb previously approved these changes Jul 9, 2025
@github-actions
Copy link

github-actions bot commented Sep 18, 2025

⚠️ Recommendation: Add qa/skip-qa label

This PR does not modify any files shipped with the agent.

To help streamline the release process, please consider adding the qa/skip-qa label if these changes do not require QA testing.

@steveny91
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@temporal-github-worker-1 temporal-github-worker-1 bot dismissed lucia-sb’s stale review November 20, 2025 20:17

Review from lucia-sb is dismissed. Related teams and files:

  • agent-integrations
    • ddev/src/ddev/cli/upgrade_check.py
@steveny91
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@steveny91
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@steveny91
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@steveny91
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@steveny91
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 56 to 60
except (requests.RequestException, OSError, json.JSONDecodeError, KeyError, InvalidVersion) as e:
logging.debug("Upgrade check failed: %s", e)
# Record the attempt to prevent even if failed
try:
write_last_run(current_version, date_now, cache_file)

Choose a reason for hiding this comment

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

P2 Badge Avoid discarding cached upgrade info on failure

If the PyPI request fails, the handler rewrites upgrade_check.json with the current version (lines 56-60). When a newer version was already cached, a transient network error will overwrite that information and reset the 7‑day timer, so users stop seeing upgrade notifications despite an update being known. Skipping the write on failure or preserving the previous cached version would avoid suppressing reminders after connectivity hiccups.

Useful? React with 👍 / 👎.

@steveny91
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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