Skip to content

Request explicit properties and items in an API build - #2854

Merged
rainersigwald merged 1 commit into
dotnet:vs15.6from
rainersigwald:buildrequest-explicit-state-return
Jan 24, 2018
Merged

rainersigwald merged 1 commit into
dotnet:vs15.6from
rainersigwald:buildrequest-explicit-state-return

Conversation

@rainersigwald

@rainersigwald rainersigwald commented Jan 11, 2018 •

Copy link
Copy Markdown
Member

First stab at a design for #2640.

TODO:

  • Design approval from CPS
  • Tests
  • Filter ResultsByTarget (Dropping for now as a secondary goal)
  • Ensure in-proc BuildResult cache doesn't get polluted after filtering ResultsByTarget

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the threshold of parameters where we decide to stop adding them to the constructor and just have a setter? 😁

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perpetually Just One More!

Comment thread src/Build/Instance/ProjectInstance.cs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@rainersigwald rainersigwald reopened this Jan 18, 2018
@rainersigwald
rainersigwald changed the base branch from master to vs15.6 January 23, 2018 18:23
@rainersigwald
rainersigwald force-pushed the buildrequest-explicit-state-return branch from a5ba3d2 to d70feb2 Compare January 23, 2018 21:00
@rainersigwald rainersigwald changed the title WIP: Request explicit properties and items in an API build Request explicit properties and items in an API build Jan 23, 2018
@rainersigwald

Copy link
Copy Markdown
Member Author

Note that I dropped filtering of TargetResults--it can be added again later if it proves necessary.

@rainersigwald
rainersigwald changed the base branch from vs15.6 to master January 23, 2018 21:05

@rainersigwald rainersigwald left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now ready for review. A couple of design-y questions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we require this, or infer it when you pass a RequestedProjectState? Right now it's not really distinct.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@rainersigwald
rainersigwald force-pushed the buildrequest-explicit-state-return branch from d70feb2 to 598c3ec Compare January 23, 2018 22:29
@rainersigwald
rainersigwald changed the base branch from master to vs15.6 January 23, 2018 22:39
@rainersigwald
rainersigwald merged commit a581790 into dotnet:vs15.6 Jan 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants