Open alllex opened 2 months ago
We have other Parameters-like concepts, the UX for which should ideally be the same:
WorkParameters
have a javadoc contract about forbidding access to parameters
, when they are None
FlowParameters
also explicitly forbids calling parameters
when None
, but the None
instance of parameters seems to be passed to the flow action regardless.TransformParameters
also forbids calling parameters
when None
This feature request is in the backlog of the relevant team and is prioritized by them.
We should make all aforementioned places (and BuildServiceParameters) behave in the same way. Preferrably, we should allow getting None instances in both getParameters
and when registering/configuring, just for simplicity of the contract.
+1 for removing the specialness of None
.
Consider the following snippet:
This currently fails with:
There seems to be no contract for accessing the parameters for a value source that has
ValueSourceParameters.None
, e.g. in any of the javadocs.It is currently forbidden by failing, but there seems to be no reason why this shouldn't be supported.
There are at least two use-cases:
None
without updating the implementation code that still accesses the parametersValueSourceParameters.None
as a parameter type.Build scan: https://ge.gradle.org/s/yxps2f3m5husm/failure#1