PLUGINAPI-190 Promote hidden to a first-class flag on PropertyDefinition - #290
Conversation
Summary
This PR promotes A backward-compatibility translation is built into the annotation parser: the legacy pattern The validation rule preventing What reviewers should knowStart by reviewing:
Key decisions to verify:
Watch for:
|
11aee1a to
6d8052c
Compare
6d8052c to
6365a7c
Compare
|
Dropping this change. |
Persist `hidden` as an instance field on PropertyDefinition with a public `hidden()` getter, so consumers can filter UI listings on it. Drop the build-time mutex that forbade combining `.hidden()` with `.onConfigScopes(...)` / `.onlyOnConfigScopes(...)`, and drop the `if (hidden) global = false` coercion. `hidden` is now orthogonal to `global` and `configScopes`, enabling per-project-settable properties that are not exposed in the Settings UI.
6365a7c to
defbc5f
Compare
|
lukasz-jarocki-sonarsource
left a comment
There was a problem hiding this comment.
Well done!
|
aleksandra-bozhinoska-sonarsource
left a comment
There was a problem hiding this comment.
Looks good to me!




WHY:
The current plugin-api exposes
hidden,setScope, andsetOnlyScope. However, the effect ofhiddenis limited and only covers hiding the global variable when defined with scope. It is unusable with a scope. Internally, it is dropped, and its effect comes through theglobalflag, which disables showing the parameter at the instance level when no scope is defined.This is against the initial intention described in MMF-339.
WHAT:
Add support for hiding properties independently from their scoped or global definition.
Keep backward compatibility with existing definitions.
HOW:
Keep the
hiddenvalue as defined by the builder, and setglobalto represent whether the property is intended to be configured at the global level.hiddennow has the meaning of hiding the property from the UI by not listing it.globalnow has the meaning of allowing get/edit of properties at the instance level.This allows simplifying the code by removing checks on
globaland scope that were carrying thehiddenmeaning before.A backward-compatible translation is put in place for the legacy
@Property(global = false, scope=[])idiom. It is auto-translated tohidden = true, global = true, configScopes = []which keep the behavior intact. The annotation itself is intentionally not extended with ahiddenfield, as it is already considered legacy and the builder should be used instead.Current behavior — truth table
.hidden().onConfigScopes(X).onlyOnConfigScopes(X)globalconfigScopesisGlobalfallback)Proposed behavior — truth table
.hidden().onConfigScopes(X).onlyOnConfigScopes(X)hiddenglobalconfigScopes!hidden)!hidden)!hidden)!hidden)!hidden)