Skip to content

Commit f75d080

Browse files
authored
Bump docfx to 2.77.0 and adjust config (#357)
1 parent 49b6f43 commit f75d080

9 files changed

Lines changed: 45 additions & 33 deletions

File tree

.github/workflows/build-documentation.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
with:
3131
ref: live
3232
path: live
33+
3334
- name: Clear live docs repo
3435
run: rm -rf live/*
3536

@@ -40,29 +41,40 @@ jobs:
4041
ref: docs
4142
path: Npgsql
4243

44+
# Setup software
45+
- name: Setup .NET Core
46+
uses: actions/setup-dotnet@v4.0.1
47+
with:
48+
dotnet-version: 7.0.x
49+
50+
# docfx has issues specifically with analyzer/sourcegen projects; build manually before
51+
- name: Build Npgsql
52+
run: dotnet build -c Release
53+
shell: bash
54+
working-directory: Npgsql
55+
4356
- name: Checkout EFCore.PG
4457
uses: actions/checkout@v4
4558
with:
4659
repository: npgsql/Npgsql.EntityFrameworkCore.PostgreSQL
4760
ref: docs
4861
path: EFCore.PG
4962

50-
# Setup software
51-
- name: Setup .NET Core
52-
uses: actions/setup-dotnet@v4.0.1
53-
with:
54-
dotnet-version: 7.0.x
63+
- name: Build EFCore.PG
64+
run: dotnet build -c Release
65+
shell: bash
66+
working-directory: EFCore.PG
5567

5668
# Note:
5769
# Since we use a custom template to override some properties of the docfx default template, when upgrading docfx we should check
5870
# whether the default template of the new docfx version has changes we need to carry over to our modified version.
5971
# You can get the docfx default template via the following command: docfx template export default
6072
# This will put the default template folder into a directory called _exported_templates
6173
- name: Get docfx
62-
run: dotnet tool install --version 2.61.0 -g docfx
74+
run: dotnet tool install --version 2.77.0 -g docfx
6375

6476
- name: Build docs
65-
run: docfx
77+
run: docfx --warningsAsErrors
6678

6779
- name: Commit and push
6880
if: (github.event_name == 'push' || github.event_name == 'repository_dispatch') && github.repository == 'npgsql/doc' && github.ref == 'refs/heads/main'

conceptual/EFCore.PG/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ builder.Services.AddDbContextPool<BloggingContext>(opt =>
133133
o => o.ConfigureDataSource(dataSourceBuilder => dataSourceBuilder.UseClientCertificate(certificate))));
134134
```
135135

136-
`ConfigureDataSource()` provides access to a lower-level [`NpgsqlDataSourceBuilder`](../doc/basic-usage.html#data-source) which you can use to configure all aspects of the Npgsql ADO.NET provider.
136+
`ConfigureDataSource()` provides access to a lower-level [`NpgsqlDataSourceBuilder`](../Npgsql/basic-usage.md#data-source) which you can use to configure all aspects of the Npgsql ADO.NET provider.
137137

138138
> [!WARNING]
139139
> The EF provider internally creates an NpgsqlDataSource and uses that; for most configuration (e.g. connection string), the provider knows to switch between NpgsqlDataSources automatically.

conceptual/EFCore.PG/release-notes/8.0.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ Because of the NativeAOT and trimming work done for Npgsql 8.0 ([release notes](
189189

190190
PostgreSQL type | Default .NET type
191191
---------------------------------------- | --------------------------
192-
JSON POCO mapping, JsonNode and subtypes | <xref:Npgsql.INpgsqlTypeMapperExtensions.EnableDynamicJson>
193-
Unmapped enums, ranges, multiranges | <xref:Npgsql.INpgsqlTypeMapperExtensions.EnableUnmappedTypes>
194-
Read PostgreSQL records as .NET tuples | <xref:Npgsql.INpgsqlTypeMapperExtensions.EnableRecordsAsTuples>
192+
JSON POCO mapping, JsonNode and subtypes | <xref:Npgsql.TypeMapping.INpgsqlTypeMapper.EnableDynamicJson%2A>
193+
Unmapped enums, ranges, multiranges | <xref:Npgsql.TypeMapping.INpgsqlTypeMapper.EnableUnmappedTypes%2A>
194+
Read PostgreSQL records as .NET tuples | <xref:Npgsql.TypeMapping.INpgsqlTypeMapper.EnableRecordsAsTuples%2A>
195195

196196
Existing code using the above features will start throwing exceptions after upgrading to version 8.0 of the EF Core provider; the exceptions provide explicit guidance on how to add the opt-ins.
197197

conceptual/EFCore.PG/release-notes/9.0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Npgsql.EntityFrameworkCore.PostgreSQL version 9.0 is under development; previews
99

1010
The Npgsql EF provider is built on top of the lower-level Npgsql ADO.NET provider; the configuration interface between these two layers was less than ideal, and configuration been more difficult than it should have been. For version 9.0, the configuration experience has been considerably improved.
1111

12-
Since version 7, the Npgsql ADO.NET provider has been moving to [NpgsqlDataSource](../../doc/basic-usage.html#data-source) as the preferred way of configuration connections and obtaining them. At the EF level, it has been possible to pass an NpgsqlDataSource instance to `UseNpgsql()`; but this required that the user separately configure a data source and manage it. In addition, features such as plugins and enums require support from both the EF and ADO.NET layers, forcing users to perform multiple setup actions at the different layers.
12+
Since version 7, the Npgsql ADO.NET provider has been moving to [NpgsqlDataSource](../../Npgsql/basic-usage.md#data-source) as the preferred way of configuration connections and obtaining them. At the EF level, it has been possible to pass an NpgsqlDataSource instance to `UseNpgsql()`; but this required that the user separately configure a data source and manage it. In addition, features such as plugins and enums require support from both the EF and ADO.NET layers, forcing users to perform multiple setup actions at the different layers.
1313

1414
With version 9, `UseNpgsql()` becomes a single point for configuration, for both the EF and ADO.NET levels. EF can now internally set up an NpgsqlDataSource, automatically applying all the necessary configuration to it, and also exposes an API to allow users to apply arbitrary configuration to it as well:
1515

@@ -31,7 +31,7 @@ In the above code, the following configuration gestures are performed:
3131
3. `MapEnum()` maps a .NET enum type. Like `UseNodaTime()`, this also used to require a separate ADO.NET configuration gesture, but is now done automatically. As an added bonus, doing this now also adds the enum to the model, causing the enum to be created in the database via EF's migrations.
3232
4. `ConfigureDataSource()` exposes an NpgsqlDataSourceBuilder, which you can use to configure arbitrary ADO.NET options. In this example, the certificate is defined for the TLS authentication process.
3333

34-
For more information, see the [getting started docs](../index.html).
34+
For more information, see the [getting started docs](../index.md).
3535

3636
### Improved configuration for enums and plugins
3737

conceptual/Npgsql/release-notes/4.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You can now use the new [Npgsql.NodaTime](../types/nodatime.md) to have Npgsql m
3636

3737
## Json.NET
3838

39-
Another plugin, [Npgsql.Json.NET](../types/jsonnet.md), works with [Newtonsoft Json.NET](https://www.newtonsoft.com/json) to automatically serialize and deserialize PostgreSQL's `jsonb` and `json` types to your objects, providing a seamless database JSON programming experience. Instead of working with strings which you have to serialize and deserialize, Npgsql does it for you.
39+
Another plugin, [Npgsql.Json.NET](../types/json.md), works with [Newtonsoft Json.NET](https://www.newtonsoft.com/json) to automatically serialize and deserialize PostgreSQL's `jsonb` and `json` types to your objects, providing a seamless database JSON programming experience. Instead of working with strings which you have to serialize and deserialize, Npgsql does it for you.
4040

4141
## Other improvements
4242

conceptual/Npgsql/release-notes/8.0.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ For more information on registering Npgsql services in DI, see the documentation
5353
## Other features
5454

5555
* Allow using nullable value types with the generic `NpgsqlParameter<T>`, e.g. `NpgsqlParameter<int?>`.
56-
* Introduce a non-caching password provider callback via <xref:Npgsql.NpgsqlDataSourceBuilder.UsePasswordProvider?displayProperty=nameWithType>.
57-
* Allow customizing System.Text.Json JsonSerializationOptions via <xref:Npgsql.NpgsqlDataSourceBuilder.ConfigureJsonOptions?displayProperty=nameWithType>.
56+
* Introduce a non-caching password provider callback via <xref:Npgsql.NpgsqlDataSourceBuilder.UsePasswordProvider*?displayProperty=nameWithType>.
57+
* Allow customizing System.Text.Json JsonSerializationOptions via <xref:Npgsql.NpgsqlDataSourceBuilder.ConfigureJsonOptions*?displayProperty=nameWithType>.
5858
* Improvements and cleanup for networking type mappings:
5959
* In addition to .NET <xref:System.Net.IPAddress>, PostgreSQL `inet` can also mapped to be mapped to <xref:NpgsqlTypes.NpgsqlInet>, which is an immutable struct containing both IP and netmask components.
6060
* PostgreSQL `cidr` is now mapped to the newly-introduced <xref:NpgsqlTypes.NpgsqlCidr>. The mapping to `ValueTuple<IPAddress, int>` has been removed.
61-
* Allow providing the root certificate programmatically via the new <xref:Npgsql.NpgsqlDataSourceBuilder.UseRootCertificate?displayProperty=nameWithType>
61+
* Allow providing the root certificate programmatically via the new <xref:Npgsql.NpgsqlDataSourceBuilder.UseRootCertificate*?displayProperty=nameWithType>
6262

6363
Version 8.0 contains many other smaller features and bug fixes, [see the 8.0.0 milestone](https://github.com/npgsql/npgsql/milestone/97?closed=1) for the full list of issues.
6464

@@ -70,9 +70,9 @@ Npgsql 8.0 is fully compatible with NativeAOT and trimming (see above). While mo
7070

7171
PostgreSQL type | Default .NET type
7272
---------------------------------------- | --------------------------
73-
JSON POCO mapping, JsonNode and subtypes | <xref:Npgsql.INpgsqlTypeMapperExtensions.EnableDynamicJson>
74-
Unmapped enums, ranges, multiranges | <xref:Npgsql.INpgsqlTypeMapperExtensions.EnableUnmappedTypes>
75-
Read PostgreSQL records as .NET tuples | <xref:Npgsql.INpgsqlTypeMapperExtensions.EnableRecordsAsTuples>
73+
JSON POCO mapping, JsonNode and subtypes | <xref:Npgsql.TypeMapping.INpgsqlTypeMapper.EnableDynamicJson%2A>
74+
Unmapped enums, ranges, multiranges | <xref:Npgsql.TypeMapping.INpgsqlTypeMapper.EnableUnmappedTypes%2A>
75+
Read PostgreSQL records as .NET tuples | <xref:Npgsql.TypeMapping.INpgsqlTypeMapper.EnableRecordsAsTuples%2A>
7676

7777
Existing code using the above features will start throwing exceptions after upgrading to Npgsql 8.0; the exceptions provide explicit guidance on how to add the opt-ins.
7878

conceptual/Npgsql/security.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ If the root CA of the server certificate isn't installed in your machine's CA st
8080

8181
Note that Npgsql does not perform certificate revocation validation by default, since this is an optional extension not implemented by all providers and CAs. To turn on certificate revocation validation, specify `Check Certificate Revocation=true` on the connection string.
8282

83-
Finally, if the above options aren't sufficient for your scenario, you can call <xref:Npgsql.NpgsqlDataSourceBuilder.UseUserCertificateValidationCallback(System.Net.Security.RemoteCertificateValidationCallback)?displayProperty=nameWithType> to provide your custom server certificate validation logic (this gets set on the underlying .NET [`SslStream`](https://docs.microsoft.com/dotnet/api/system.net.security.sslstream.-ctor#System_Net_Security_SslStream__ctor_System_IO_Stream_System_Boolean_System_Net_Security_RemoteCertificateValidationCallback_System_Net_Security_LocalCertificateSelectionCallback_)).
83+
Finally, if the above options aren't sufficient for your scenario, you can call <xref:Npgsql.NpgsqlDataSourceBuilder.UseUserCertificateValidationCallback*?displayProperty=nameWithType> to provide your custom server certificate validation logic (this gets set on the underlying .NET [`SslStream`](https://docs.microsoft.com/dotnet/api/system.net.security.sslstream.-ctor#System_Net_Security_SslStream__ctor_System_IO_Stream_System_Boolean_System_Net_Security_RemoteCertificateValidationCallback_System_Net_Security_LocalCertificateSelectionCallback_)).
8484

8585
### Client certificates
8686

@@ -92,7 +92,7 @@ PostgreSQL may be configured to require valid certificates from connecting clien
9292

9393
To provide a password for a client certificate, set either the `SSL Password` (6.0 and higher) or `Client Certificate Key` (5.0 and lower) connection string parameter.
9494

95-
Finally, you can call <xref:Npgsql.NpgsqlDataSourceBuilder.UseClientCertificate(System.Security.Cryptography.X509Certificates.X509Certificate)?displayProperty=nameWithType>, <xref:Npgsql.NpgsqlDataSourceBuilder.UseClientCertificates(System.Security.Cryptography.X509Certificates.X509CertificateCollection)?displayProperty=nameWithType> or <xref:Npgsql.NpgsqlDataSourceBuilder.UseClientCertificatesCallback(System.Action{System.Security.Cryptography.X509Certificates.X509CertificateCollection})?displayProperty=nameWithType> to programmatically provide a certificate, multiple certificates or a callback which returns certificates (this works like on the underlying .NET [`SslStream`](https://docs.microsoft.com/dotnet/api/system.net.security.sslstream.-ctor#System_Net_Security_SslStream__ctor_System_IO_Stream_System_Boolean_System_Net_Security_RemoteCertificateValidationCallback_System_Net_Security_LocalCertificateSelectionCallback_)).
95+
Finally, you can call <xref:Npgsql.NpgsqlDataSourceBuilder.UseClientCertificate*?displayProperty=nameWithType>, <xref:Npgsql.NpgsqlDataSourceBuilder.UseClientCertificates*?displayProperty=nameWithType> or <xref:Npgsql.NpgsqlDataSourceBuilder.UseClientCertificatesCallback*?displayProperty=nameWithType> to programmatically provide a certificate, multiple certificates or a callback which returns certificates (this works like on the underlying .NET [`SslStream`](https://docs.microsoft.com/dotnet/api/system.net.security.sslstream.-ctor#System_Net_Security_SslStream__ctor_System_IO_Stream_System_Boolean_System_Net_Security_RemoteCertificateValidationCallback_System_Net_Security_LocalCertificateSelectionCallback_)).
9696

9797
> [!NOTE]
9898
> Npgsql supports .PFX and .PEM certificates starting with 6.0. Previously, only .PFX certificates were supported.

conceptual/Npgsql/types/json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ With this mapping style, you're fully responsible for serializing/deserializing
4646
4747
If your column JSON contains documents with a stable schema, you can map them to your own .NET types (or POCOs). The provider will use System.Text.Json APIs under the hood to serialize instances of your types to JSON documents before sending them to the database, and to deserialize documents coming back from the database. This effectively allows mapping an arbitrary .NET type - or object graph - to a single column in the database.
4848

49-
Starting with Npgsql 8.0, to use this feature, you must first enable it by calling <xref:Npgsql.INpgsqlTypeMapperExtensions.EnableDynamicJson> on your <xref:Npgsql.NpgsqlDataSourceBuilder>, or, if you're not yet using data sources, on `NpgsqlConnection.GlobalTypeMapper`:
49+
Starting with Npgsql 8.0, to use this feature, you must first enable it by calling <xref:Npgsql.TypeMapping.INpgsqlTypeMapper.EnableDynamicJson*> on your <xref:Npgsql.NpgsqlDataSourceBuilder>, or, if you're not yet using data sources, on `NpgsqlConnection.GlobalTypeMapper`:
5050

5151
### [NpgsqlDataSource](#tab/datasource)
5252

docfx.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@
33
{
44
"src": [
55
{
6-
"files": [ "src/**/*.csproj" ],
6+
"files": [ "src/Npgsql/Npgsql.csproj" ],
77
"exclude": [ "src/MSI/**", "src/VSIX/**", "**/bin/**", "**/obj/**" ],
8-
"cwd": "Npgsql/"
8+
"src": "Npgsql/"
99
}
1010
],
1111
"dest": "obj/api/Npgsql",
1212
"properties": {
13-
"TargetFramework": "netstandard2.1"
13+
"TargetFramework": "net8.0"
1414
}
1515
},
1616
{
1717
"src": [
1818
{
1919
"files": [ "src/**/*.csproj" ],
2020
"exclude": [ "**/bin/**", "**/obj/**", "Properties/NpgsqlStrings.*" ],
21-
"cwd": "EFCore.PG"
21+
"src": "EFCore.PG"
2222
}
2323
],
2424
"dest": "obj/api/EFCore.PG",
2525
"properties": {
26-
"TargetFramework": "net6.0"
26+
"TargetFramework": "net8.0"
2727
}
2828
}
2929
],
@@ -35,27 +35,27 @@
3535
"content": [
3636
{
3737
"files": [ "**/*.yml" ],
38-
"cwd": "obj/api/Npgsql",
38+
"src": "obj/api/Npgsql",
3939
"dest": "doc/api"
4040
},
4141
{
4242
"files": [ "**/*.yml" ],
43-
"cwd": "obj/api/EFCore.PG",
43+
"src": "obj/api/EFCore.PG",
4444
"dest": "efcore/api"
4545
},
4646
{
4747
"files": [ "**.md", "toc.yml" ],
48-
"cwd": "conceptual/Npgsql",
48+
"src": "conceptual/Npgsql",
4949
"dest": "doc"
5050
},
5151
{
5252
"files": [ "**.md", "toc.yml" ],
53-
"cwd": "conceptual/EFCore.PG",
53+
"src": "conceptual/EFCore.PG",
5454
"dest": "efcore"
5555
},
5656
{
5757
"files": [ "**.md", "toc.yml" ],
58-
"cwd": "conceptual/EF6.PG",
58+
"src": "conceptual/EF6.PG",
5959
"dest": "ef6"
6060
},
6161
{

0 commit comments

Comments
 (0)