-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[Draft, DO-Not-Merge] multipart #40967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of Request is mispelled in this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be added in Azure.Core 2.0. Do we need it before that ships?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the options be defaulted/optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@annelo-msft This method is needed for multipart feature. I added there for current prototyping. When Azure.Core 2.0 released and I will remove the duplicate one. Thanks
And I think we can provide a default value ModelReaderWriterOptions.Json
for options
parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't ship betas of Azure.Core. Please add any beta features to Azure.Core.Experimental first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I will put all Azure.Core library files in Azure.Core.Experimental first.
Great! You should also be able to put any System.ClientModel files in Azure.Core.Experimental as well in order to beta them before shipping them GA in one of the GA Core libraries.
eng/Packages.Data.props
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot arbitrarily upgrade package dependencies - we have to be aware of the versions Functions and PowerShell use to prevent runtime errors from trying to load multiple versions into the same environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider adding a comment above these package references that links to the specific guidance for vetting interactions with Functions, PowerShell, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that idea @christothes - would you be willing to put up a PR for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created #40978 to track this. I think we have some folks that have recently investigated this that might be better suited to pick it up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @annelo-msft @christothes . But we need to use the 'MediaType' property of BinaryData
which is released in latest System.Memory.Data
version 8.0.0.
So what's the process to upgrade the dependency library? Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find anything indicating that PowerShell has a dependency on this package, so I don't think this update would cause versioning issues there.
- https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/System.Management.Automation.csproj
- https://github.com/PowerShell/PowerShell/blob/master/tools/cgmanifest.json
- https://grep.app/search?q=system.memory.data&filter[repo][0]=PowerShell/PowerShell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I don't have any context around this PR but just wanted to check - this is changing the reference in the Track 1 dependencies list, was that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @m-redding!! Super helpful. I may see if I can do this change in the new System.ClientModel PR given @KrzysztofCwalina's comment: #41016 (comment)
@JoshLove-msft, do you know how we can understand if this would be a problem for Functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functions runs against net6.0
and, for the in-proc model, will silently downgrade dependencies that the host has. We should stick with a package in the 6.0 line, if possible. If we need this, we'll have to run it past Fabio Cavalante to ensure that it won't conflict with the host.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't be bumping the T1 libraries section regardless. These bumps should be made only in the T2 sections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put this in Azure.Core.Experimental for first beta release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@annelo-msft This is in System.ClientModel
library which will be common library for both azure and non-azure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Types in the System. namespace can also be added to Azure.Core.Experimental in order to beta them prior to GA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put this feature in Azure.Core.Experimental for a first beta release.
Please add a description to this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I realize that lot's of this code was just copied from ASP.NET, but the code is internal in ASP.NET (probably for a reason). If we want to make the APIs public, we need to do proper cleanup and review with the BCL/ASP.NET team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this hear and not on the base type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the options be defaulted/optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use ToMemory? It does not allocate but ToArray might. I think, you will have to multitraget to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. Please use ToMemory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the right namespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this throw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So many substrings. Please use slicing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the warning disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this for?
Yes. I will put all Azure.Core library files in |
This is a prototype of End-to-End Multipart support. I added this in the description. Thanks. |
} | ||
private BinaryData GetData() | ||
{ | ||
BinaryData data = ModelReaderWriter.Write(_model, _options); // will call the write function in serialization file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our ModelReaderWriter can write to a sequence of buffers. But this Write method (returning BinaryData) forces the sequence to be copied to one contiguous buffer. Can we avoid that? Can we keep a sequence of buffers in ModelReadWriteRequestContent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @KrzysztofCwalina I only can find the api public static BinaryData Write<T>(T model, ModelReaderWriterOptions? options = default) where T : IPersistableModel<T>
in ModelReaderWriter.cs
. And I don't see a API which return a sequence of buffers.
Is it a new API which will be released in later version?
<PackageReference Update="System.Text.Encodings.Web" Version="4.5.1" /> | ||
<PackageReference Update="System.Text.Json" Version="4.7.2" /> | ||
<PackageReference Update="System.Text.Encodings.Web" Version="8.0.0" /> | ||
<PackageReference Update="System.Text.Json" Version="8.0.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We know that these are not safe to upgrade past the 6.0 line due to conflicts with Functions. We also know that 6.0 is good with the currently supported versions of PowerShell.
eng/Packages.Data.props
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't be bumping the T1 libraries section regardless. These bumps should be made only in the T2 sections.
Hi @chunyu3. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
Contributing to the Azure SDK
This is a prototype for end-to-end multipart/form-data support. It contains the libraries and APIs needed in System.CodeModel and Azure.Core.
MultipartFormData
to help construct a multipart/form-data request content (RequestContent
for Azure, andRequestBody
to others) and Deserialize a Mulitpart/form-data response body (BinaryData) to ModelPlease see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.
For specific information about pull request etiquette and best practices, see this section.