-
Notifications
You must be signed in to change notification settings - Fork 60
Merge master and fix CI: add RuntimeHelpers unit tests #305
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
Changes from all commits
d8be152
10c894b
4c99f4d
26f4e90
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,6 @@ on: | |
| branches: | ||
| - master | ||
| pull_request: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "sdk": { | ||
| "version": "10.0.103", | ||
| "rollForward": "minor" | ||
| "version": "10.0.100", | ||
| "rollForward": "latestPatch" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -145,6 +145,22 @@ module RuntimeHelpers = | |
| content | ||
| | _ -> failwith $"Unexpected parameter type {boxedStream.GetType().Name} instead of IO.Stream" | ||
|
|
||
| // Unwraps F# option values: returns the inner value for Some, null for None. | ||
| // This prevents `Some(value)` from being sent as-is in form data. | ||
| let private unwrapFSharpOption(value: obj) : obj = | ||
| if isNull value then | ||
| null | ||
| else | ||
| let ty = value.GetType() | ||
|
|
||
| if | ||
| ty.IsGenericType | ||
| && ty.GetGenericTypeDefinition() = typedefof<option<_>> | ||
| then | ||
| ty.GetProperty("Value").GetValue(value) | ||
| else | ||
| value | ||
|
Comment on lines
+148
to
+162
|
||
|
|
||
| let getPropertyValues(object: obj) = | ||
| if isNull object then | ||
| Seq.empty | ||
|
|
@@ -162,6 +178,7 @@ module RuntimeHelpers = | |
| | _ -> prop.Name | ||
|
|
||
| prop.GetValue(object) | ||
| |> unwrapFSharpOption | ||
| |> Option.ofObj | ||
| |> Option.map(fun value -> (name, value))) | ||
|
|
||
|
|
||
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.
global.jsonnow pins the SDK to feature band10.0.100withrollForward: latestPatch. This requires a10.0.1xxSDK to be installed; it will not roll forward to a newer feature band (e.g.,10.0.2xx). The workflow currently installs10.0.x, which may resolve to a different feature band over time and causedotnetto fail with “SDK not found” whenglobal.jsoncan’t be satisfied. Consider aligning CI withglobal.json(e.g., install10.0.100/10.0.1xx, or configuresetup-dotnetto use the global.json), or relax rollForward back to a mode that allows feature-band roll-forward if that’s intended.