Skip to content

Commit 7b479d5

Browse files
authored
Merge branch 'main' into repo-assist/fix-issue-611-schema-org-microdata-901d33ea78032988
2 parents 66e96ed + c87020d commit 7b479d5

31 files changed

Lines changed: 722 additions & 520 deletions

.github/aw/actions-lock.json

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,19 @@
11
{
22
"entries": {
3-
"actions/checkout@v5": {
3+
"actions/checkout@v6.0.2": {
44
"repo": "actions/checkout",
5-
"version": "v5",
6-
"sha": "93cb6efe18208431cddfb8368fd83d5badbf9bfd"
5+
"version": "v6.0.2",
6+
"sha": "de0fac2e4500dabe0009e67214ff5f5447ce83dd"
77
},
88
"actions/github-script@v8": {
99
"repo": "actions/github-script",
1010
"version": "v8",
1111
"sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd"
1212
},
13-
"github/gh-aw/actions/setup@v0.47.6": {
13+
"github/gh-aw/actions/setup@v0.51.0": {
1414
"repo": "github/gh-aw/actions/setup",
15-
"version": "v0.47.6",
16-
"sha": "3b6ab5488e05abd34d6a599d61459477e45d5299"
17-
},
18-
"github/gh-aw/actions/setup@v0.48.1": {
19-
"repo": "github/gh-aw/actions/setup",
20-
"version": "v0.48.1",
21-
"sha": "26b6572ae210580303087bc3142fe58d140bf65c"
22-
},
23-
"github/gh-aw/actions/setup@v0.49.0": {
24-
"repo": "github/gh-aw/actions/setup",
25-
"version": "v0.49.0",
26-
"sha": "0eb518a648ba8178f4f42559a4c250d3e513acd1"
27-
},
28-
"github/gh-aw/actions/setup@v0.49.7": {
29-
"repo": "github/gh-aw/actions/setup",
30-
"version": "v0.49.7",
31-
"sha": "0ea0cf123dda697de607a0cd6e3315746680eb86"
32-
},
33-
"github/gh-aw/actions/setup@v0.50.0": {
34-
"repo": "github/gh-aw/actions/setup",
35-
"version": "v0.50.0",
36-
"sha": "8624e99d3979177875f082b4959b14da951d9ffe"
37-
},
38-
"github/gh-aw/actions/setup@v0.50.1": {
39-
"repo": "github/gh-aw/actions/setup",
40-
"version": "v0.50.1",
41-
"sha": "fad43e3c91a4e1d43e458f68e96574127934e7d1"
42-
},
43-
"github/gh-aw/actions/setup@v0.50.4": {
44-
"repo": "github/gh-aw/actions/setup",
45-
"version": "v0.50.4",
46-
"sha": "90ebf8057e8e005103b8d123732d2c64c30e9b27"
15+
"version": "v0.51.0",
16+
"sha": "19c329d562f8cd58c3b6f07c7d9894c60bc609d2"
4717
}
4818
}
4919
}

.github/workflows/repo-assist.lock.yml

Lines changed: 103 additions & 112 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/repo-assist.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ network:
3838
- http://www.w3.org
3939
- http://schemas.microsoft.com
4040
- www.google.com
41+
# wikipedia, ebay, imdb websites for HTML
42+
- https://en.wikipedia.org
43+
- https://www.ebay.com
44+
- https://www.imdb.com
4145

4246
safe-outputs:
4347
add-comment:
@@ -77,7 +81,7 @@ tools:
7781
bash: true
7882
repo-memory: true
7983

80-
source: githubnext/agentics/workflows/repo-assist.md@afb00b92a9514fee9a14c583f059a03d05738f70
84+
source: githubnext/agentics/workflows/repo-assist.md@da02dddebe71d9a937665abdcd1f5214dab852a7
8185
---
8286

8387
# Repo Assist

RELEASE_NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
- Add schema.org microdata support to `HtmlProvider`: when an HTML document contains elements with `itemscope`/`itemtype`/`itemprop` attributes, the provider now generates a typed `Schemas` container (e.g. `doc.Schemas.Person`) with one strongly-typed property per `itemprop` name discovered in the sample (closes #611)
66
- Add JSON-LD support to `HtmlProvider`: when an HTML document contains `<script type="application/ld+json">` blocks, the provider generates a typed `JsonLd` container (e.g. `doc.JsonLd.Article`) with one strongly-typed property per top-level scalar field discovered in the sample — Wikipedia pages, for instance, embed schema.org `Article` JSON-LD with `name`, `headline`, `description`, `url`, `datePublished`, and `dateModified`
7+
- Add `ExceptionIfMissing` static parameter to `JsonProvider` and `XmlProvider`: when true, accessing a non-optional field that is missing in the data raises an exception instead of silently returning a default value (empty string for string, NaN for float). Defaults to false for backward compatibility.
78
- Add `Http.ParseLinkHeader` utility for parsing RFC 5988 `Link` response headers (used by GitHub, GitLab, and other paginated APIs) into a `Map<string, string>` from relation name to URL (closes #805)
89
- Add `PreferDateTimeOffset` parameter to `CsvProvider`, `JsonProvider`, and `XmlProvider`: when true, date-time values without an explicit timezone offset are inferred as `DateTimeOffset` (using local offset) instead of `DateTime` (closes #1100, #1072)
910
- Make `Http.AppendQueryToUrl` public (closes #1325)
1011
- Add `PreferOptionals` parameter to `JsonProvider` and `XmlProvider` (defaults to `true` to match existing behavior; set to `false` to use empty string or `NaN` for missing values, like the CsvProvider default) (closes #649)
1112
- Add `UseSchemaTypeNames` parameter to `XmlProvider`: when `true` and `Schema` is provided, multiple elements sharing the same XSD complex type generate a single F# type (named after the XSD type) instead of separate per-element types (closes #1488)
13+
- Mark all runtime Core libraries as trimmable (`IsTrimmable=true`); replace reflection-based stack-trace preservation in `Http.fs` with `ExceptionDispatchInfo`, and remove dead Mono-detection code (closes #1436)
1214

1315
## 8.0.0 - Feb 25 2026
1416

src/FSharp.Data.Csv.Core/CsvExtensions.fs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ open FSharp.Data.Runtime
1313
[<Extension>]
1414
type StringExtensions =
1515

16+
/// <summary>Converts the string to an integer. Fails if the value is not a valid integer.</summary>
17+
/// <param name="x">The string to convert.</param>
18+
/// <param name="cultureInfo">Optional culture info for parsing. Defaults to InvariantCulture.</param>
1619
[<Extension>]
1720
static member AsInteger(x: String, [<Optional>] ?cultureInfo) =
1821
let cultureInfo = defaultArg cultureInfo CultureInfo.InvariantCulture
@@ -21,6 +24,9 @@ type StringExtensions =
2124
| Some i -> i
2225
| _ -> failwithf "Not an int: %s" x
2326

27+
/// <summary>Converts the string to a 64-bit integer. Fails if the value is not a valid 64-bit integer.</summary>
28+
/// <param name="x">The string to convert.</param>
29+
/// <param name="cultureInfo">Optional culture info for parsing. Defaults to InvariantCulture.</param>
2430
[<Extension>]
2531
static member AsInteger64(x: String, [<Optional>] ?cultureInfo) =
2632
let cultureInfo = defaultArg cultureInfo CultureInfo.InvariantCulture
@@ -29,6 +35,9 @@ type StringExtensions =
2935
| Some i -> i
3036
| _ -> failwithf "Not an int64: %s" x
3137

38+
/// <summary>Converts the string to a decimal. Fails if the value is not a valid decimal.</summary>
39+
/// <param name="x">The string to convert.</param>
40+
/// <param name="cultureInfo">Optional culture info for parsing. Defaults to InvariantCulture.</param>
3241
[<Extension>]
3342
static member AsDecimal(x: String, [<Optional>] ?cultureInfo) =
3443
let cultureInfo = defaultArg cultureInfo CultureInfo.InvariantCulture
@@ -37,6 +46,10 @@ type StringExtensions =
3746
| Some d -> d
3847
| _ -> failwithf "Not a decimal: %s" x
3948

49+
/// <summary>Converts the string to a float. Fails if the value is not a valid float.</summary>
50+
/// <param name="x">The string to convert.</param>
51+
/// <param name="cultureInfo">Optional culture info for parsing. Defaults to InvariantCulture.</param>
52+
/// <param name="missingValues">Values to treat as missing (NaN). Defaults to standard missing value strings.</param>
4053
[<Extension>]
4154
static member AsFloat(x: String, [<Optional>] ?cultureInfo, [<Optional>] ?missingValues) =
4255
let cultureInfo = defaultArg cultureInfo CultureInfo.InvariantCulture
@@ -46,12 +59,17 @@ type StringExtensions =
4659
| Some f -> f
4760
| _ -> failwithf "Not a float: %s" x
4861

62+
/// <summary>Converts the string to a boolean. Fails if the value is not a valid boolean.</summary>
63+
/// <param name="x">The string to convert. Accepts "true", "false", "yes", "no", "1", "0" (case-insensitive).</param>
4964
[<Extension>]
5065
static member AsBoolean(x: String) =
5166
match TextConversions.AsBoolean x with
5267
| Some b -> b
5368
| _ -> failwithf "Not a boolean: %s" x
5469

70+
/// <summary>Converts the string to a DateTime. Fails if the value is not a valid date/time string.</summary>
71+
/// <param name="x">The string to convert. Accepts ISO 8601 format or MSFT JSON date format.</param>
72+
/// <param name="cultureInfo">Optional culture info for parsing. Defaults to InvariantCulture.</param>
5573
[<Extension>]
5674
static member AsDateTime(x: String, [<Optional>] ?cultureInfo) =
5775
let cultureInfo = defaultArg cultureInfo CultureInfo.InvariantCulture
@@ -60,6 +78,9 @@ type StringExtensions =
6078
| Some d -> d
6179
| _ -> failwithf "Not a datetime: %s" x
6280

81+
/// <summary>Converts the string to a DateTimeOffset. Fails if the value is not a valid date/time with offset string.</summary>
82+
/// <param name="x">The string to convert. Accepts ISO 8601 format with timezone offset or MSFT JSON date with offset.</param>
83+
/// <param name="cultureInfo">Optional culture info for parsing. Defaults to InvariantCulture.</param>
6384
[<Extension>]
6485
static member AsDateTimeOffset(x, [<Optional>] ?cultureInfo) =
6586
let cultureInfo = defaultArg cultureInfo CultureInfo.InvariantCulture
@@ -68,6 +89,9 @@ type StringExtensions =
6889
| Some d -> d
6990
| _ -> failwithf "Not a datetime offset: %s" <| x
7091

92+
/// <summary>Converts the string to a TimeSpan. Fails if the value is not a valid time span string.</summary>
93+
/// <param name="x">The string to convert.</param>
94+
/// <param name="cultureInfo">Optional culture info for parsing. Defaults to InvariantCulture.</param>
7195
[<Extension>]
7296
static member AsTimeSpan(x: String, [<Optional>] ?cultureInfo) =
7397
let cultureInfo = defaultArg cultureInfo CultureInfo.InvariantCulture
@@ -76,6 +100,8 @@ type StringExtensions =
76100
| Some t -> t
77101
| _ -> failwithf "Not a time span: %s" x
78102

103+
/// <summary>Converts the string to a Guid. Fails if the value is not a valid GUID string.</summary>
104+
/// <param name="x">The string to convert.</param>
79105
[<Extension>]
80106
static member AsGuid(x: String) =
81107
match x |> TextConversions.AsGuid with

src/FSharp.Data.Csv.Core/FSharp.Data.Csv.Core.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<PackageIcon>logo.png</PackageIcon>
1010
<!-- always have tailcalls on for design time compiler add-in to allow repo to compile in DEBUG, see https://github.com/fsprojects/FSharp.Data/issues/1410 -->
1111
<Tailcalls>true</Tailcalls>
12+
<IsTrimmable>true</IsTrimmable>
1213
</PropertyGroup>
1314
<ItemGroup>
1415
<Compile Include="CsvRuntime.fs" />

src/FSharp.Data.DesignTime/CommonProviderImplementation/ConversionsGenerator.fs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ let getBackConversionQuotation missingValuesStr cultureStr typ value : Expr<stri
7575

7676
/// Creates a function that takes Expr<string option> and converts it to
7777
/// an expression of other type - the type is specified by `field`
78-
let internal convertStringValue missingValuesStr cultureStr (field: PrimitiveInferedProperty) =
78+
let internal convertStringValue missingValuesStr cultureStr exceptionIfMissing (field: PrimitiveInferedProperty) =
7979
let fieldName = field.Name
8080
let field = field.Value
8181

@@ -95,16 +95,20 @@ let internal convertStringValue missingValuesStr cultureStr (field: PrimitiveInf
9595
let convert value =
9696
getConversionQuotation missingValuesStr cultureStr field.InferedType value
9797

98+
let getNonOptionalValueMethod =
99+
if exceptionIfMissing then
100+
nameof (TextRuntime.GetNonOptionalValueStrict)
101+
else
102+
nameof (TextRuntime.GetNonOptionalValue)
103+
98104
match field.TypeWrapper with
99105
| TypeWrapper.None ->
100106
//prevent value being calculated twice
101107
let var = Var("value", typeof<string option>)
102108
let varExpr = Expr.Cast<string option>(Expr.Var var)
103109

104110
let body =
105-
typeof<TextRuntime>?(nameof (TextRuntime.GetNonOptionalValue))
106-
field.RuntimeType
107-
(fieldName, convert varExpr, varExpr)
111+
typeof<TextRuntime>?(getNonOptionalValueMethod) field.RuntimeType (fieldName, convert varExpr, varExpr)
108112

109113
Expr.Let(var, value, body)
110114
| TypeWrapper.Option -> convert value

src/FSharp.Data.DesignTime/Csv/CsvGenerator.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module internal CsvTypeBuilder =
3333
inferredFields
3434
|> List.mapi (fun index field ->
3535
let typ, typWithoutMeasure, conv, convBack =
36-
ConversionsGenerator.convertStringValue missingValuesStr cultureStr field
36+
ConversionsGenerator.convertStringValue missingValuesStr cultureStr false field
3737

3838
let propertyName =
3939
if useOriginalNames then

src/FSharp.Data.DesignTime/Html/HtmlGenerator.fs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ module internal HtmlGenerator =
6767
columns
6868
|> List.mapi (fun index field ->
6969
let typ, typWithoutMeasure, conv, _convBack =
70-
ConversionsGenerator.convertStringValue missingValuesStr cultureStr field
70+
ConversionsGenerator.convertStringValue missingValuesStr cultureStr false field
7171

7272
{ TypeForTuple = typWithoutMeasure
7373
ProvidedProperty =
@@ -165,6 +165,7 @@ module internal HtmlGenerator =
165165
ConversionsGenerator.convertStringValue
166166
missingValuesStr
167167
cultureStr
168+
false
168169
(StructuralTypes.PrimitiveInferedProperty.Create("", typ, optional, None))
169170

170171
typ, conv
@@ -173,6 +174,7 @@ module internal HtmlGenerator =
173174
ConversionsGenerator.convertStringValue
174175
missingValuesStr
175176
cultureStr
177+
false
176178
(StructuralTypes.PrimitiveInferedProperty.Create("", typeof<string>, false, None))
177179

178180
typ, conv
@@ -238,6 +240,7 @@ module internal HtmlGenerator =
238240
ConversionsGenerator.convertStringValue
239241
missingValuesStr
240242
cultureStr
243+
false
241244
(StructuralTypes.PrimitiveInferedProperty.Create("", typ, optional, None))
242245

243246
typ, conv
@@ -246,6 +249,7 @@ module internal HtmlGenerator =
246249
ConversionsGenerator.convertStringValue
247250
missingValuesStr
248251
cultureStr
252+
false
249253
(StructuralTypes.PrimitiveInferedProperty.Create("", typeof<String>, false, None))
250254

251255
typ, conv

src/FSharp.Data.DesignTime/Json/JsonConversionsGenerator.fs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ let internal convertJsonValue
5656
missingValuesStr
5757
cultureStr
5858
canPassAllConversionCallingTypes
59+
exceptionIfMissing
5960
(field: PrimitiveInferedValue)
6061
=
6162

@@ -80,15 +81,21 @@ let internal convertJsonValue
8081
let convert value =
8182
getConversionQuotation missingValuesStr cultureStr field.InferedType value
8283

84+
let getNonOptionalValueMethod =
85+
if exceptionIfMissing then
86+
nameof (JsonRuntime.GetNonOptionalValueStrict)
87+
else
88+
nameof (JsonRuntime.GetNonOptionalValue)
89+
8390
match field.TypeWrapper, canPassAllConversionCallingTypes with
8491
| TypeWrapper.None, true ->
8592
wrapInLetIfNeeded value (fun (varExpr: Expr<JsonValueOptionAndPath>) ->
86-
typeof<JsonRuntime>?(nameof (JsonRuntime.GetNonOptionalValue))
93+
typeof<JsonRuntime>?(getNonOptionalValueMethod)
8794
(field.RuntimeType)
8895
(<@ (%varExpr).Path @>, convert <@ (%varExpr).JsonOpt @>, <@ (%varExpr).JsonOpt @>))
8996
| TypeWrapper.None, false ->
9097
wrapInLetIfNeeded value (fun (varExpr: Expr<IJsonDocument>) ->
91-
typeof<JsonRuntime>?(nameof (JsonRuntime.GetNonOptionalValue))
98+
typeof<JsonRuntime>?(getNonOptionalValueMethod)
9299
(field.RuntimeType)
93100
(<@ (%varExpr).Path() @>, convert <@ Some (%varExpr).JsonValue @>, <@ Some (%varExpr).JsonValue @>))
94101
| TypeWrapper.Option, true -> convert <@ (%%value: JsonValue option) @>

0 commit comments

Comments
 (0)