-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Update Batch cmdlets to use latest management plane and data plane sdk #11721
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
|
Cmdlet review for the new cmdlets added in this PR was completed here: https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/547 |
|
I still need to update the management plane SDK reference so don't merge this yet. |
76498ec to
d317f00
Compare
|
This is good to merge now -- the management plane SDK has been updated |
a5015be to
743dd4f
Compare
bgklein
left a comment
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.
|
@bgklein - Yeah, that happened when I regenerated the help text, so I assume that it's a change pushed by the powershell core devs. |
Matthew, you probably need to use |
|
Hi Matthew, your design review stated that this was for a preview release, right? If that's still the case, I'll create a branch for your PR, it contains breaking change so it cannot be merged into master. |
|
@isra-fel - we changed our plans to merge as a master release when we realized that there is a breaking change planned for 5/7 (code complete) as part of the S169 milestone - since there is a breaking change planned for 5/7 we figured it made sense to go in there rather than wait another 6 months. The only reason we were originally planning private preview is because this included breaking changes and we hadn't yet realized that a breaking change release was imminent. |
|
Will fix the issue with help documents and |
743dd4f to
f4f0ab8
Compare
|
@matthchr That's totally fine. Thought I highly recommend adding breaking change attributes ahead of breaking change release to surprise our customers less next time :) |
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.
There's no need to use nullable types for optional parameters (a [Parameter] is by default not mandatory)
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 issue here is that I really need 3 states.
Kind == nullwhich means "use the old defaulting behavior, CER if no password, PFX if password"Kind == CER- the data is a certificate.Kind == PFX- The data is a PFX.
If I make this non-nullable I need some other way to determine if this parameter was specified or not - it seemed easier to just let the parameter itself support 3 states, "not specified" (null), and the other two.
If there's a better way to do this let me know (see below in the ExecuteCmdletImpl where this logic is applied and you see the defaulting behavior).
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 think the problem with a nullable + optional parameter is the user may think that passing null or not specifying this param may have different results.
Besides, making it not-nullable, i.e. changing the first state to "user not specify Kind" won't make the code much more complex:
- this.Kind ?? (password == null ? PSCertificateKind.Cer : PSCertificateKind.Pfx),
+ this.IsParameterBound(c => c.Kind) ? (password == null ? PSCertificateKind.Cer : PSCertificateKind.Pfx) : nullThere 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 @isra-fel - I was not familiar with IsparameterBound - will use that isntead.
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 pushed an update which does as you suggested @isra-fel
@isra-fel - Yep, totally agree. Part of the issue this time is that these changes were for JEDI and so we didn't have a lot of lead time, so the changes were implemented quickly and we didn't get a chance to do much ahead of time notification. But will keep your suggestion in mind for future changes (cc @bgklein). |
f4f0ab8 to
4d17c19
Compare
|
I also removed all of the new cmdlets which were duplicate from what the networking team already had (as per email thread we had going on). I think that this should be good to merge now! |
5d40c9c to
4686fd4
Compare
|
All of our tests are failing in CI due to: @isra-fel, can you help on figuring out why our tests are failing to import this assembly? From what I can tell, the nuget package I am referencing ( Given the breaking change contents of this PR and the upcoming breaking change release (whose code complete date has already passed), I am worried these last minute changes are going to prevent us from making it in in time – can you help? If we can’t figure it out ASAP I can revert the new test (and changes) which are causing the issue for now and we can investigate further after the release happens (I have already tested the cmdlets manually and they work, and as I mentioned our automated test also works on my machine). |
- Add new CertificateKind parameter to New-AzBatchCertificate command. - Update models to support new options exposed in the data plane API. - Re-record tests using the new data plane API version.
- Add new tests for the new cmdlets. - Re-record tests using the new management plane API version.
- The breaking changes detected are expected because this is
a breaking change release.
- Also add a test in Batch.Tests
- The networking team already wrote generic ones
4686fd4 to
a85cfef
Compare
|
I think I got it figured out -- master had updated their reference to Microsoft.Azure.Management.networking but my branch hadn't. |
isra-fel
left a comment
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.
LGTM

Description
Checklist
CONTRIBUTING.mdChangeLog.mdfile(s) has been updated: