add a periodic upgrade check for ddev
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:
- 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!!
Codecov Report
:x: Patch coverage is 87.75510% with 18 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 91.01%. Comparing base (37b01a5) to head (afae4bb).
:warning: Report is 3 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.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
⚠️ 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.
@codex review
@codex review
@codex review
@codex review
@codex review
@codex review
@codex review
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".
⚠️ Warnings
❄️ 1 New flaky test detected
test_statement_metrics_and_plans[master-EXEC encryptedProc-expected_queries_patterns2-param_groups2-5-True-True-True-False-encryptedproc]fromtest_statements.py(Datadog) (Fix with Cursor)missing expected matching rows assert 0 == 1 + where 0 = len([]) + and 1 = len([''])
🧪 2 Tests failed
This comment will be updated automatically if new data arrives.
test_custom_queries[incorrect formatting custom query]fromtest_integration.py(Datadog) (Fix with Cursor)assert "Invalid syntax: no viable alternative at input 'selectt'." in "ERROR datadog_checks.base.checks.base.cloudera:api_v7.py:221 Skipping custom query query='selectt' tags=('baz',) due to the following exception: 'HTTPResponse' object has no attribute 'getheaders'\n" + where "ERROR datadog_checks.base.checks.base.cloudera:api_v7.py:221 Skipping custom query query='selectt' tags=('baz',) due to the following exception: 'HTTPResponse' object has no attribute 'getheaders'\n" = <_pytest.logging.LogCaptureFixture object at 0x7f2cec11cd60>.text
test_custom_queries[non existent metric custom query]fromtest_integration.py(Datadog) (Fix with Cursor)assert "Invalid metric 'fake_foo' in 'select fake_foo'" in "ERROR datadog_checks.base.checks.base.cloudera:api_v7.py:221 Skipping custom query query='select fake_foo' tags=('baz',) due to the following exception: 'HTTPResponse' object has no attribute 'getheaders'\n" + where "ERROR datadog_checks.base.checks.base.cloudera:api_v7.py:221 Skipping custom query query='select fake_foo' tags=('baz',) due to the following exception: 'HTTPResponse' object has no attribute 'getheaders'\n" = <_pytest.logging.LogCaptureFixture object at 0x7f2cec36a9e0>.text
* Fix with Cursor requires Datadog plugin ≥v2.17.0
🔗 Commit SHA: afae4bb | Docs | Datadog PR Page | Was this helpful? Give us feedback!