Skip to content

fix: keep overrides whose settings are not exposed, and name them on the form - #7

Merged
Decipher merged 1 commit into
feature/2-exclude-mail-notificationfrom
feature/5-preserve-unrendered-overrides
Aug 26, 2026
Merged

fix: keep overrides whose settings are not exposed, and name them on the form#7
Decipher merged 1 commit into
feature/2-exclude-mail-notificationfrom
feature/5-preserve-unrendered-overrides

Conversation

@Decipher

@Decipher Decipher commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

ConsumerOverridesForm::submitForm() rebuilt the stored override map from the rendered rows alone, so an override whose setting stopped being exposed (a shrunk exposure list, or a theme switch renaming every <theme>.settings:* key) was silently deleted on the next save of that consumer.

Changes

  • src/Form/ConsumerOverridesForm.php: the save starts from the stored map and applies the rendered rows on top, set on tick and remove on untick, so a row can only change its own key. The form also names stored overrides that have no exposed setting in a warning, so cleanup becomes a decision instead of an accident.
  • tests/src/Kernel/FormLogicTest.php: a regression test that saves an unrelated row and asserts the orphaned theme-style key survives, and one asserting the warning names the orphan.

SettingsMerger::pruneUnexposed() stays uncalled from src/: pruning is exactly the silent deletion this removes. A deliberate cleanup action can adopt it later.

Summary by CodeRabbit

  • Bug Fixes

    • Preserved saved settings that are no longer exposed in the configuration form.
    • Prevented unselected visible settings from affecting unrelated stored settings.
    • Added a warning when previously saved settings are no longer available.
  • Tests

    • Added coverage for preserving hidden settings and warning about orphaned configuration entries.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e0964d5-c830-4b8d-bc4c-551967e3e28a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c8c42c07-188e-497d-a7dd-fe83c94c682d

📥 Commits

Reviewing files that changed from the base of the PR and between 5465239 and fd08808.

📒 Files selected for processing (2)
  • src/Form/ConsumerOverridesForm.php
  • tests/src/Kernel/FormLogicTest.php

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The consumer override form now warns about stored settings that are no longer exposed. It preserves those settings during save and removes only unticked exposed settings. Tests cover renamed settings and warning output.

Changes

Consumer override preservation

Layer / File(s) Summary
Orphaned override detection
src/Form/ConsumerOverridesForm.php, tests/src/Kernel/FormLogicTest.php
The form warns when stored overrides have no matching form rows. Tests verify the warning and setting key.
Override-preserving submission
src/Form/ConsumerOverridesForm.php, tests/src/Kernel/FormLogicTest.php
Submission starts from existing overrides and removes only unticked exposed settings. Tests verify unexposed and renamed settings remain stored.

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

Merge Risk: ⚪ Minimal · up to fd088

This localized change preserves previously stored overrides when settings are no longer exposed and names those overrides for deliberate cleanup; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary changes: preserving overrides for unexposed settings and naming them in the form.
✨ 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 feature/5-preserve-unrendered-overrides

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.

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.12%. Comparing base (4a406de) to head (cfac1c5).

Additional details and impacted files
@@                           Coverage Diff                           @@
##           feature/2-exclude-mail-notification       #7      +/-   ##
=======================================================================
+ Coverage                                85.86%   86.12%   +0.25%     
=======================================================================
  Files                                        9        9              
  Lines                                      481      490       +9     
=======================================================================
+ Hits                                       413      422       +9     
  Misses                                      68       68              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@Decipher

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
✅ 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.

@Decipher
Decipher changed the base branch from 1.0.x to feature/2-exclude-mail-notification August 26, 2026 05:22
@Decipher
Decipher force-pushed the feature/5-preserve-unrendered-overrides branch from fd08808 to cfac1c5 Compare August 26, 2026 05:24
@Decipher
Decipher merged commit 703f923 into 1.0.x Aug 26, 2026
19 checks passed
@Decipher
Decipher deleted the feature/5-preserve-unrendered-overrides branch August 26, 2026 06:24
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