Repository navigation
Request explicit properties and items in an API build - #2854
rainersigwald merged 1 commit into
Conversation
There was a problem hiding this comment.
What's the threshold of parameters where we decide to stop adding them to the constructor and just have a setter? 😁
There was a problem hiding this comment.
Perpetually Just One More!
There was a problem hiding this comment.
Is there a way to only filter when we're about to send the data over the wire? I feel that would be more straightforward where the out-of-proc node has all the data and as its writing to the named pipe its filtering out properties/items. This seems to clone the ProjectInstance in preparation for serializing. Do you think it would be better to do what I suggest and is it even possible with our current code?
There was a problem hiding this comment.
I don't think we can intercept only at serialization time. This approach (filter in the TargetBuilder when constructing a BuildResult) has the advantage of working in-proc as well, which is nice.
Though I guess the contract could be "return at least the requested state", and returning the whole shebang in-proc would actually be faster (no deep clone).
If we were to do the filtering at the Translator level, we'd have to have the filter available in ProjectInstance, so that its TranslateAllState method could apply the filter. That's possible, but it seems like odd layering: only the result really cares about the filter; why should the ProjectInstance care?
Thoughts?
a5ba3d2 to
d70feb2
Compare
|
Note that I dropped filtering of TargetResults--it can be added again later if it proves necessary. |
rainersigwald
left a comment
There was a problem hiding this comment.
This is now ready for review. A couple of design-y questions.
There was a problem hiding this comment.
Should we require this, or infer it when you pass a RequestedProjectState? Right now it's not really distinct.
There was a problem hiding this comment.
How do we feel about this interface? Would it be preferable to have constructor arguments, or another data type? One thing of concern is that it'd be nice to enforce case-insensitivity on in-proc cases.
Allow an API consumer to explicitly specify a subset of properties, items, and metadata names that they care about, allowing inspection of project state after (partial) builds without the overhead of returning uninteresting state.
d70feb2 to
598c3ec
Compare
First stab at a design for #2640.
TODO:
Filter(Dropping for now as a secondary goal)ResultsByTargetEnsure in-procBuildResultcache doesn't get polluted after filteringResultsByTarget