Followup changes for https://github.com/hi-godot/godot-ai/pull/446#453
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Followup to PR #446. Centralizes shared EditorSettings key constants (SETTING_HTTP_PORT, SETTING_EXCLUDED_DOMAINS, SETTING_TELEMETRY_ENABLED) and small helpers (truthy, env_truthy, telemetry_enabled) into a new plugin/addons/godot_ai/utils/settings.gd (McpSettings), and adds tests/comments for the telemetry toggle plumbing.
Changes:
- Introduce
McpSettingsutility holding setting keys and env/truthy helpers, and routeclient_configurator.gd,mcp_dock.gd,server_lifecycle.gd,telemetry.gd,plugin.gd, and test code through it. - Add GDScript tests for the telemetry toggle UI,
_inject_telemetry_envlifecycle behavior, and theEditorSettingfallback inTelemetry; tighten the Pythontest_cleanup_logs_warning_on_oserrorto assert the warning message. - Update self-update smoke harness + its test to patch port/telemetry constants from their new home (
utils/settings.gd); refresh docs/comments to describe the env-var + UI opt-out priority.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin/addons/godot_ai/utils/settings.gd(.uid) | New McpSettings class with shared keys + truthy/telemetry helpers. |
| plugin/addons/godot_ai/client_configurator.gd | Move SETTING_HTTP_PORT / SETTING_EXCLUDED_DOMAINS to McpSettings. |
| plugin/addons/godot_ai/mcp_dock.gd | Use McpSettings keys/helpers; rename local var; wrap min_size in Vector2i; tweak tooltip and reload typing. |
| plugin/addons/godot_ai/plugin.gd | Drop _env_truthy, delegate to McpSettings.truthy; inject telemetry env around start_dev_server spawn. |
| plugin/addons/godot_ai/telemetry.gd | Delegate disable resolution to McpSettings.telemetry_enabled(); update docs. |
| plugin/addons/godot_ai/utils/server_lifecycle.gd | Simplify _inject_telemetry_env via McpSettings.telemetry_enabled(). |
| src/godot_ai/telemetry.py | Doc/comment tweaks reflecting cleanup-on-disable behavior. |
| docs/TELEMETRY.md | Document UI + env-var opt-out paths together. |
| script/local-self-update-smoke | Patch settings keys in new utils/settings.gd path. |
| tests/unit/test_self_update_smoke_harness.py | Assert keys in utils/settings.gd. |
| tests/unit/test_telemetry.py | Assert warning is logged on cleanup OSError. |
| test_project/tests/test_telemetry_setting.gd | Migrate to McpSettings.SETTING_TELEMETRY_ENABLED. |
| test_project/tests/test_telemetry_toggle.gd(.uid) | New tests for the dock's telemetry CheckButton disabled state. |
| test_project/tests/test_plugin_telemetry.gd | Add tests for EditorSetting-driven enable/disable in Telemetry. |
| test_project/tests/test_server_lifecycle.gd | Add tests for _inject_telemetry_env across env/setting combos. |
| test_project/tests/test_clients.gd | Update setting references to McpSettings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- mcp_dock.gd: clarify the Vector2i wrap with a comment explaining that `Vector2i * float` returns `Vector2`, and use `Vector2(560, 460)` as the literal so the cast reads as intentional instead of doubled. - telemetry.gd: normalize tab indentation and "MCP dock" casing in the opt-out priority docstring. - test_telemetry_setting.gd: remove the contradictory "may or may not remove the key depending on Godot version" caveat; passing null to EditorSettings.set_setting has been the documented unset path for many years. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Pushed
All 11 CI checks green; squash-merged as |
|
Thanks again @a-johnston ! |
|
I had to be afk for a few hours but this was still in progress. I'll make a followup to the followup pr. |
|
Ah roger thought it was done. I had a cluster of PRs to push out today and I try to get them all in one release to isolate issues picked by telemetry. |
|
No problem, the changes again were all test surface and comments. I should've noted that I actually have a new test file to add which was missed when I first committed and pushed this up. |
This is a grab bag of changes following up on the copilot review of #446. Many of the changes are test additions, comment changes, or md changes. Common setting constants used between modules and helpers are moved to
plugin/addons/godot_ai/utils/settings.gd.