Skip to content

chore(parameters): deprecate ParamConfigRenderer by moving bindings into ParametersDefinition#10100

Merged
leon-ape merged 16 commits intomainfrom
support/pd-direct-binding
Mar 26, 2026
Merged

chore(parameters): deprecate ParamConfigRenderer by moving bindings into ParametersDefinition#10100
leon-ape merged 16 commits intomainfrom
support/pd-direct-binding

Conversation

@leon-ape
Copy link
Copy Markdown
Contributor

@leon-ape leon-ape commented Mar 20, 2026

Summary

This PR deprecates ParamConfigRenderer from the runtime path and moves component parameter binding metadata into ParametersDefinition.

After this change:

  • runtime resolves bindings directly from ParametersDefinition
  • base templates are always rerendered before applying parameter updates
  • runtime no longer depends on Payload / reRenderResourceTypes
  • legacy ParamConfigRenderer remains supported through fallback compatibility logic

Why

The old model had two main issues:

  1. ParamConfigRenderer added an extra indirection in the runtime chain:

    • Component -> ComponentDefinition -> ParamConfigRenderer -> ParametersDefinition
  2. conditional rerendering depended on limited trigger metadata, while templates actually rendered from live component state, which could make final config depend on event order instead of current state.

This PR simplifies the model and makes config rendering behave more like a normal reconcile loop.

Main Changes

  • Added binding metadata to ParametersDefinition:

    • componentDef
    • serviceVersion
    • templateName
    • fileName
    • fileFormatConfig
  • Changed runtime resolution from:

    • Component -> ComponentDefinition -> ParamConfigRenderer -> ParametersDefinition
      to:
    • Component -> ComponentDefinition -> matched ParametersDefinitions
  • Removed conditional rerender gating and always rerender the base template before applying parameter patches

  • Removed runtime dependency on Payload / reRenderResourceTypes

  • Made ComponentParameter react directly to Component changes by watching Component and comparing applied Component.Generation

  • Removed the legacy ParamConfigRenderer controller from runtime registration

Compatibility

Backward compatibility is preserved.

  • Old addons and old instances that still use ParamConfigRenderer are supported through fallback
  • New addons can use direct ParametersDefinition bindings
  • Mixed migration is supported:
    • if some files are defined by new PD and others still come from legacy PCR, runtime merges them by file
    • if both define the same file, new PD wins

Other compatibility notes:

  • legacy fallback no longer depends on ParamConfigRenderer.status.phase
  • ParamConfigRenderer API/CRD is retained and marked deprecated
  • RBAC keeps the read permissions needed for legacy fallback

Tests

Added and updated coverage for:

  • direct ParametersDefinition binding resolution
  • legacy fallback
  • mixed new PD + legacy PCR resolution
  • same-file conflict where new PD overrides legacy PCR
  • malformed unrelated legacy PCR not breaking fallback
  • controller-level mixed-mode rendering
  • rerender on component change
  • always-rerender-before-apply behavior

Also tightened controller test fixtures to avoid cache timing races and flaky ComponentParameter not found failures.

Follow-up

This PR keeps the deprecated ParamConfigRenderer API only for compatibility.

A later cleanup PR can remove the remaining compatibility surface after addon migration is complete.

@leon-ape leon-ape added this to the Release 1.2.0 milestone Mar 20, 2026
@leon-ape leon-ape requested a review from kizuna-lek March 20, 2026 14:03
@leon-ape leon-ape added the nopick Not auto cherry-pick when PR merged label Mar 20, 2026
@leon-ape leon-ape force-pushed the support/pd-direct-binding branch from 380704e to 2540387 Compare March 21, 2026 04:44
@leon-ape leon-ape changed the title chore(parameters): resolve component config from parameters definition chore(parameters): deprecate ParamConfigRenderer by moving bindings into ParametersDefinition Mar 21, 2026
@leon-ape leon-ape changed the base branch from support/always-rerender-parameters-template to main March 21, 2026 06:07
@github-actions github-actions bot added the size/XXL Denotes a PR that changes 1000+ lines. label Mar 21, 2026
@leon-ape leon-ape force-pushed the support/pd-direct-binding branch from 77eea21 to f6808af Compare March 21, 2026 06:14
@leon-ape leon-ape force-pushed the support/pd-direct-binding branch from f6808af to 3668bdc Compare March 21, 2026 06:19
@leon-ape leon-ape marked this pull request as ready for review March 21, 2026 07:00
@leon-ape leon-ape requested a review from a team as a code owner March 21, 2026 07:00
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 21, 2026

Codecov Report

❌ Patch coverage is 52.67857% with 159 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.74%. Comparing base (edbff89) to head (1281398).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/parameters/config_util.go 49.41% 64 Missing and 23 partials ⚠️
...estutil/parameters/parametersdefinition_factory.go 0.00% 24 Missing ⚠️
pkg/parameters/config_metadata.go 13.33% 13 Missing ⚠️
pkg/parameters/parameter_utils.go 55.55% 4 Missing and 4 partials ⚠️
.../parameters/componentparameter_controller_utils.go 69.56% 2 Missing and 5 partials ⚠️
...ollers/parameters/componentparameter_controller.go 64.70% 4 Missing and 2 partials ⚠️
pkg/parameters/core/config_patch_util.go 50.00% 4 Missing ⚠️
controllers/parameters/reconfigure_controller.go 50.00% 1 Missing and 2 partials ⚠️
...ntrollers/parameters/parameter_controller_utils.go 60.00% 1 Missing and 1 partial ⚠️
pkg/parameters/core/reconfigure_util.go 0.00% 2 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10100      +/-   ##
==========================================
+ Coverage   51.60%   51.74%   +0.13%     
==========================================
  Files         525      525              
  Lines       58397    58243     -154     
==========================================
+ Hits        30138    30140       +2     
+ Misses      25305    25148     -157     
- Partials     2954     2955       +1     
Flag Coverage Δ
unittests 51.74% <52.67%> (+0.13%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@apecloud-bot apecloud-bot added the approved PR Approved Test label Mar 25, 2026
@apecloud-bot apecloud-bot removed the approved PR Approved Test label Mar 26, 2026
@leon-ape
Copy link
Copy Markdown
Contributor Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Mar 26, 2026
@leon-ape leon-ape merged commit 4ec0147 into main Mar 26, 2026
52 of 54 checks passed
@leon-ape leon-ape deleted the support/pd-direct-binding branch March 26, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved PR Approved Test nopick Not auto cherry-pick when PR merged size/XXL Denotes a PR that changes 1000+ lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants