How to formalise interactions between extra defaults, dynamic/variant functions, and needextends filters/operations? #1498
chrisjsewell
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
TLDR; this is currently a blocker for correct ontology and type casting of field values, since some behaviours are based around values only ever being strings.
Take this example:
Currently, the needs selected would be
B
andC
, due to the need "contexts" seen by theneedextend
filter being:The "final" needs, before dynamic function "resolution", would then be:
There are a number of "implicit" behaviours going on here:
""
needextend
filter context+
(append) extend operations to extras, the strings are just concatenated-
(delete) extend operations to extras, the fields are set to the empty stringTaking a corner case for these implicit behaviours, you could even have, for example:
resulting in a need that ends up having a dynamic function that was not originally there:
what if we now wanted to say both
extra1
andextra2
should beinteger
fields, and had, for example:For the simple
B
case, I believe we would want to initially read from the directive:i.e. coercing the string values into integers
But how should the needs with dynamic functions, filter context and final needs look like?
integer
type extras, that are not specifically given in a directive, be set to0
?needextend
filter context?+
(append) extend operations, especially when the original and/or append value are dynamic functions?-
(delete) extend operations result in a0
valueIn #1497, I try to bring the dynamic function "identification" into the initial processing of the need directives,
but it is really difficult to think how this should then interact with the
needextend
filter context and operationsThe example above also does not take into account two other important questions:
needs.json
, vianeeds_external_needs
orneedimport
?The fields in these needs I would generally consider to be already "fully resolved"
sphinx-needs/sphinx_needs/utils.py
Line 522 in 6f90e99
Beta Was this translation helpful? Give feedback.
All reactions