Skip to content

fix(testing): stop enabled:false schema defaults from silently disabling harness tests - #408

Merged
ChuckBuilds merged 1 commit into
mainfrom
fix/harness-enabled-config-merge
Jul 14, 2026
Merged

fix(testing): stop enabled:false schema defaults from silently disabling harness tests#408
ChuckBuilds merged 1 commit into
mainfrom
fix/harness-enabled-config-merge

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • check_plugin.py, render_plugin.py, and test/plugins/test_plugin_matrix.py (the real pytest CI matrix) each built config as {"enabled": True} then merged config_schema.json defaults on top, letting a plugin's own enabled: false default silently win.
  • 15 of 23 real plugins in this ecosystem ship enabled: false as a reasonable default (seasonal/opt-in plugins like march-madness, odds-ticker, calendar, etc.) — every harness/CI render of those plugins was silently testing "disabled, do nothing" instead of real behavior.
  • Extracted build_full_config() into testing/loading.py (already the shared home for this kind of logic per its own docstring) and switched all three call sites to it: schema defaults → forced enabled: True → harness.json config → explicit caller config. A caller can still deliberately test the disabled path via an explicit override; it just can't happen by accident via the plugin's own shipped default anymore.

Test plan

  • Added TestBuildFullConfigForcesEnabled (4 new tests) to test/plugins/test_harness.py — unit tests for the helper plus an end-to-end check_one() regression test with a fixture plugin whose schema defaults enabled: false.
  • pytest test/plugins/test_harness.py — 29 passed.
  • pytest test/plugins/test_plugin_matrix.py (deselecting f1-scoreboard, which is independently rate-limited by its external API right now, unrelated to this change) — 23 passed, no regressions.
  • Manually confirmed check_plugin.py --plugin march-madness --sizes 192x48 and --plugin odds-ticker --sizes 192x48, with no --config override, now render real (non-blank) content — previously required an explicit --config '{"enabled":true}' workaround.

Summary by CodeRabbit

  • New Features

    • Plugin configuration is now assembled consistently across plugin checks, rendering, and test matrix workflows.
    • Configuration values follow a clear precedence order, with command-line and harness settings overriding defaults.
  • Bug Fixes

    • Plugins are enabled by default during checks and rendering, even when their schema default is disabled.
    • Explicit configuration overrides can still disable a plugin when required.
  • Tests

    • Added coverage for configuration precedence and plugin enablement behavior.

… disabling harness tests

check_plugin.py, render_plugin.py, and the pytest plugin matrix each built
config as {"enabled": True} then merged in config_schema.json's defaults on
top, letting a plugin's own enabled:false default (a reasonable choice for
a seasonal/opt-in plugin -- 15 of 23 real plugins ship one) silently win.
Every harness/CI render of those plugins was testing "disabled, do
nothing" rather than real behavior.

Extract build_full_config() into testing/loading.py (already the shared
home for plugin-discovery/config-default logic) and use it from all three
call sites: schema defaults, then a forced enabled=True, then harness.json's
config, then the caller's explicit config -- so a test can still
deliberately disable a plugin on purpose, it just can't happen by accident
via the plugin's own shipped schema default anymore.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2596d375-cf49-44be-85a5-9beab8e2e137

📥 Commits

Reviewing files that changed from the base of the PR and between 6edd80d and f1efc36.

📒 Files selected for processing (5)
  • scripts/check_plugin.py
  • scripts/render_plugin.py
  • src/plugin_system/testing/loading.py
  • test/plugins/test_harness.py
  • test/plugins/test_plugin_matrix.py

📝 Walkthrough

Walkthrough

Adds build_full_config() to centralize plugin configuration precedence, forces plugins enabled by default during testing, and updates checking, rendering, and matrix tests to use the shared helper.

Changes

Plugin configuration flow

Layer / File(s) Summary
Configuration builder and regression coverage
src/plugin_system/testing/loading.py, test/plugins/test_harness.py
build_full_config() merges schema defaults, forced enabled: True, harness configuration, and CLI overrides; tests cover default and explicit disabled states.
Script and matrix integration
scripts/check_plugin.py, scripts/render_plugin.py, test/plugins/test_plugin_matrix.py
Plugin checking, rendering, and matrix tests replace manual configuration merges with build_full_config().

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the core fix: schema defaults of enabled:false no longer disable harness tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/harness-enabled-config-merge

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@ChuckBuilds

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ChuckBuilds

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ChuckBuilds
ChuckBuilds merged commit 3d347a3 into main Jul 14, 2026
8 checks passed
@ChuckBuilds
ChuckBuilds deleted the fix/harness-enabled-config-merge branch July 14, 2026 12:21
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.

1 participant