Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
csharper2010 committed Dec 10, 2024
2 parents a65dbf9 + 0c9e442 commit 356ff7f
Show file tree
Hide file tree
Showing 630 changed files with 8,769 additions and 6,680 deletions.
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"isRoot": true,
"tools": {
"csharpasyncgenerator.tool": {
"version": "0.21.1",
"version": "0.22.0",
"commands": [
"async-generator"
]
},
"gitreleasemanager.tool": {
"version": "0.11.0",
"version": "0.18.0",
"commands": [
"dotnet-gitreleasemanager"
]
Expand Down
28 changes: 15 additions & 13 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ root=true

[*]
insert_final_newline = true
charset = utf-8

[*.cs]
indent_style = tab
Expand All @@ -15,28 +16,29 @@ csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true

dotnet_diagnostic.NUnit1032.severity = suggestion
dotnet_diagnostic.NUnit1028.severity = none
dotnet_diagnostic.NUnit2045.severity = none
# Consider using the constraint model, Assert.That
dotnet_diagnostic.NUnit2005.severity = suggestion
dotnet_diagnostic.NUnit2006.severity = suggestion
dotnet_diagnostic.NUnit2015.severity = suggestion
dotnet_diagnostic.NUnit2031.severity = suggestion
dotnet_diagnostic.NUnit2049.severity = suggestion
# The SameAs constraint always fails on value types as the actual and the expected value cannot be the same reference
dotnet_diagnostic.NUnit2040.severity = suggestion

[*.xsd]
indent_style = tab

[*.json]
indent_style = space
indent_size = 2

[*.xml]
[{*.xml,*.csproj,*.vbproj}]
indent_style = space
indent_size = 2

[*.csproj]
indent_style = space
indent_size = 2

[*.vbproj]
indent_style = space
indent_size = 2

[*.cshtml]
indent_style = space
indent_size = 4
ij_xml_space_inside_empty_tag = true

[*.g]
indent_style = tab
16 changes: 8 additions & 8 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
"groupName": "NUnit"
},
{
"matchPackagePrefixes": [
"Oracle.ManagedDataAccess"
],
"groupName": "Oracle.ManagedDataAccess"
"groupName": "Oracle.ManagedDataAccess",
"matchPackageNames": [
"Oracle.ManagedDataAccess{/,}**"
]
},
{
"matchPackagePrefixes": [
"NHibernate.Caches"
],
"groupName": "NHibernate.Caches"
"groupName": "NHibernate.Caches",
"matchPackageNames": [
"NHibernate.Caches{/,}**"
]
}
]
}
10 changes: 5 additions & 5 deletions .github/workflows/GenerateAsyncCode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ on:
paths:
- '**.cs'

permissions: {}
permissions:
contents: write

jobs:
generate-async:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
token: ${{ secrets.NHIBERNATE_BOT_TOKEN }}

- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Generate Async code
run: |
Expand Down
36 changes: 28 additions & 8 deletions .github/workflows/NetCoreTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,71 @@ jobs:
strategy:
fail-fast: false
matrix:
DB: [SQLite]
OS: [ubuntu-latest, windows-latest, macos-13]
include:
- DB: SqlServer2008
CONNECTION_STRING: "Server=localhost;initial catalog=nhibernate;User Id=sa;Password=P@ssw0rd;packet size=4096;"
OS: ubuntu-latest
DB_INIT: |
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=P@ssw0rd" -e "MSSQL_PID=Express" -p 1433:1433 -d --name sqlexpress mcr.microsoft.com/mssql/server:2019-latest;
- DB: SqlServer2008-MicrosoftDataSqlClientDriver
CONNECTION_STRING: "Server=localhost;initial catalog=nhibernate;User Id=sa;Password=P@ssw0rd;packet size=4096;"
OS: ubuntu-latest
DB_INIT: |
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=P@ssw0rd" -e "MSSQL_PID=Express" -p 1433:1433 -d --name sqlexpress mcr.microsoft.com/mssql/server:2019-latest;
- DB: PostgreSQL
CONNECTION_STRING: "Host=localhost;Username=nhibernate;Password=nhibernate;Database=nhibernate;Enlist=true;"
OS: ubuntu-latest
DB_INIT: |
docker run -d -e POSTGRES_USER=nhibernate -e POSTGRES_PASSWORD=nhibernate -e POSTGRES_DB=nhibernate -p 5432:5432 postgres:13
docker run -d -e POSTGRES_USER=nhibernate -e POSTGRES_PASSWORD=nhibernate -e POSTGRES_DB=nhibernate -p 5432:5432 postgres:13
- DB: PostgreSQL
CONNECTION_STRING: "Host=localhost;Username=postgres;Password=nhibernate;Database=nhibernate;Enlist=true;"
OS: windows-latest
DB_INIT: |
choco install postgresql13 --no-progress --params '/Password:nhibernate'
Add-Content -Path 'C:\Program Files\PostgreSQL\13\data\postgresql.conf' -Value "`r`nmax_prepared_transactions = 100"
Start-Service 'postgresql-x64-13'
- DB: Firebird
CONNECTION_STRING: "DataSource=localhost;Database=nhibernate;User=SYSDBA;Password=nhibernate;charset=utf8;"
OS: ubuntu-latest
DB_INIT: |
docker run --name firebird -e EnableWireCrypt=true -e FIREBIRD_USER=nhibernate -e FIREBIRD_PASSWORD=nhibernate -e ISC_PASSWORD=nhibernate -e FIREBIRD_DATABASE=nhibernate -p 3050:3050 -d jacobalberty/firebird:v3.0
- DB: Firebird4
CONNECTION_STRING: "DataSource=localhost;Database=nhibernate;User=SYSDBA;Password=nhibernate;charset=utf8;"
OS: ubuntu-latest
DB_INIT: |
docker run --name firebird -e EnableWireCrypt=true -e FIREBIRD_USER=nhibernate -e FIREBIRD_PASSWORD=nhibernate -e ISC_PASSWORD=nhibernate -e FIREBIRD_DATABASE=nhibernate -p 3050:3050 -d jacobalberty/firebird:v4.0
- DB: MySQL
CONNECTION_STRING: "Server=localhost;Uid=root;Password=nhibernate;Database=nhibernate;Old Guids=True;SslMode=none;"
OS: ubuntu-latest
DB_INIT: |
sudo service mysql stop
docker run --name mysql -e MYSQL_ROOT_PASSWORD=nhibernate -e MYSQL_USER=nhibernate -e MYSQL_PASSWORD=nhibernate -e MYSQL_DATABASE=nhibernate -p 3306:3306 --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 -d mysql:5.7 mysqld --lower_case_table_names=1 --character-set-server=utf8 --collation-server=utf8_general_ci
- DB: Oracle
CONNECTION_STRING: "User ID=nhibernate;Password=nhibernate;Metadata Pooling=false;Self Tuning=false;Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XEPDB1)))"
OS: ubuntu-latest
DB_INIT: |
docker run -d -p 1521:1521 -e APP_USER=nhibernate -e APP_USER_PASSWORD=nhibernate -e ORACLE_PASSWORD=nhibernate gvenzl/oracle-xe:21-slim
- DB: SQLite
runs-on: ubuntu-latest
runs-on: ${{matrix.OS}}
continue-on-error: ${{matrix.ALLOW_FAILURE == true}}
env:
LANG: en-US.UTF-8 #default POSIX locale doesn't support ignore case comparisons
name: ${{matrix.DB}}
name: ${{matrix.DB}} - ${{matrix.OS}}

steps:
- name: Set up ${{matrix.DB}}
run: ${{matrix.DB_INIT}}
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3

- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Checkout
uses: actions/checkout@v4
with:
dotnet-version: 6.0.x
show-progress: false

- name: Build and Test
run: |
Expand Down
16 changes: 16 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Security Policy

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 5.5.x | :white_check_mark: |
| 5.4.x | :white_check_mark: |
| < 5.4 | :x: |

## Reporting a Vulnerability

**Please do NOT report security vulnerabilities through public GitHub issues.**

Instead, please submit vulnerabilities using this [form](https://github.com/nhibernate/nhibernate-core/security/advisories/new).
If the issue is confirmed, we will try to release a patch version as soon as possible depending on complexity.
4 changes: 2 additions & 2 deletions ShowBuildMenu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ testSetupMenu() {
}

testRun(){
dotnet test ./src/NHibernate.Test/NHibernate.Test.csproj -f net6.0
dotnet test ./src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj -f net6.0
dotnet test ./src/NHibernate.Test/NHibernate.Test.csproj -f net8.0
dotnet test ./src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj -f net8.0
mainMenu
}

Expand Down
2 changes: 1 addition & 1 deletion Tools/BuildTool/BuildTool.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Tools/packages.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NUnit.Console" Version="3.16.3" />
<PackageReference Include="NUnit.Console" Version="3.18.1" />
</ItemGroup>

</Project>
12 changes: 2 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ environment:
CONNECTION_STRING: Server=(local)\SQL2017;User ID=sa;Password=Password12!;initial catalog=nhibernate;
- DB: SqlServer2008-MicrosoftDataSqlClientDriver
CONNECTION_STRING: Server=(local)\SQL2017;User ID=sa;Password=Password12!;initial catalog=nhibernate;
- DB: PostgreSQL
CONNECTION_STRING: Host=localhost;Port=5432;Username=postgres;Password=Password12!;Database=nhibernate;Enlist=true;
- DB: Firebird
- DB: Firebird4
- DB: MySQL
CONNECTION_STRING: Server=127.0.0.1;Uid=root;Pwd=Password12!;Database=nhibernate;Old Guids=True;SslMode=none;CharSet=utf8;
- DB: SQLite
init:
# Required for having windows endlines in sources zip
- git config --global core.autocrlf true
Expand Down Expand Up @@ -63,17 +60,12 @@ before_test:
Pop-Location
}
'MySQL' {
Start-Service 'MySQL57'
Start-Service 'MySQL80'
# Create nhibernate database (not handled by NHibernate.TestDatabaseSetup.dll)
$env:MYSQL_PWD = 'Password12!'
& 'C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql' -e 'CREATE DATABASE nhibernate CHARACTER SET utf8 COLLATE utf8_general_ci;' --user=root
& 'C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql' -e 'CREATE DATABASE nhibernate CHARACTER SET utf8 COLLATE utf8_general_ci;' --user=root
}
'Odbc' { Start-Service 'MSSQL$SQL2017' }
'PostgreSQL' {
# Enable prepared transactions
Add-Content -Path 'C:\Program Files\PostgreSQL\10\data\postgresql.conf' -Value "`r`nmax_prepared_transactions = 100"
Start-Service 'postgresql-x64-10'
}
'SqlServer2008' { Start-Service 'MSSQL$SQL2017' }
'SqlServer2008-MicrosoftDataSqlClientDriver' { Start-Service 'MSSQL$SQL2017' }
'SqlServer2012' { Start-Service 'MSSQL$SQL2017' }
Expand Down
11 changes: 7 additions & 4 deletions build-common/NHibernate.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@
<Import Condition="Exists('NHibernate.dev.props')" Project="NHibernate.dev.props"/>

<PropertyGroup>
<NhVersion Condition="'$(NhVersion)' == ''" >5.5</NhVersion>
<NhVersion Condition="'$(NhVersion)' == ''" >5.6</NhVersion>
<VersionPatch Condition="'$(VersionPatch)' == ''">0</VersionPatch>
<!-- Clear VersionSuffix for making release and set it to dev for making development builds -->
<VersionSuffix Condition="'$(VersionSuffix)' == ''">dev</VersionSuffix>
<LangVersion Condition="'$(MSBuildProjectExtension)' != '.vbproj'">9.0</LangVersion>
<LangVersion Condition="'$(MSBuildProjectExtension)' != '.vbproj'">12.0</LangVersion>

<VersionPrefix Condition="'$(VersionPrefix)' == ''">$(NhVersion).$(VersionPatch)</VersionPrefix>
<VersionSuffix Condition="'$(VersionSuffix)' != '' AND '$(BuildNumber)' != ''">$(VersionSuffix).$(BuildNumber)</VersionSuffix>
<AssemblyVersion>$(NhVersion).0.0</AssemblyVersion>
<FileVersion Condition="'$(VersionSuffix)' != '' AND '$(BuildNumber)' != ''">$(VersionPrefix).$(BuildNumber)</FileVersion>
<FileVersion Condition="'$(FileVersion)' == ''">$(VersionPrefix).0</FileVersion>

<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net48;net6.0</NhAppTargetFrameworks>
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;net48;netcoreapp2.0;netstandard2.0;netstandard2.1;net6.0</NhLibTargetFrameworks>
<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net48;net8.0</NhAppTargetFrameworks>
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;net48;netcoreapp2.0;netstandard2.0;netstandard2.1;net6.0;net8.0</NhLibTargetFrameworks>
<RuntimeFrameworkVersion Condition="'$(TargetFramework)' == 'netcoreapp2.0'">2.0.3</RuntimeFrameworkVersion>
<NhNetFx>false</NhNetFx>
<NhNetFx Condition="$(TargetFramework.StartsWith('net4'))">true</NhNetFx>
<!-- Visual Basic requires to use coma (,) as a separator, other project types - semicolon (;) -->
<DefineConstants Condition="$(NhNetFx) AND '$(MSBuildProjectExtension)' != '.vbproj'">NETFX;$(DefineConstants)</DefineConstants>
<DefineConstants Condition="$(NhNetFx) AND '$(MSBuildProjectExtension)' == '.vbproj'">NETFX,$(DefineConstants)</DefineConstants>
<NoWarn>$(NoWarn);NU1903</NoWarn>
<NoWarn Condition="'$(TargetFramework)' == 'net6.0'">$(NoWarn);SYSLIB0011</NoWarn>
<NoWarn Condition="'$(TargetFramework)' == 'net8.0'">$(NoWarn);SYSLIB0011;SYSLIB0050;SYSLIB0051</NoWarn>

<Product>NHibernate</Product>
<Company>NHibernate.info</Company>
Expand Down
2 changes: 2 additions & 0 deletions build-common/teamcity-hibernate.cfg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
<property name="odbc.explicit_datetime_scale"></property>
<property name="oracle.use_n_prefixed_types_for_unicode"></property>
<property name="query.default_cast_length"></property>
<property name="transaction.ignore_session_synchronization_failures"></property>
<property name="transaction.system_completion_lock_timeout"></property>
</session-factory>
</hibernate-configuration>
20 changes: 20 additions & 0 deletions default.build
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,26 @@
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
</namespaces>
</xmlpoke>

<!-- Make sure the property exists - it's only set for some scenarios. -->
<property name="nhibernate.transaction.ignore_session_synchronization_failures" value="" unless="${property::exists('nhibernate.transaction.ignore_session_synchronization_failures')}"/>
<xmlpoke file="${app.config}"
xpath="//*/hbm:property[@name='transaction.ignore_session_synchronization_failures']"
value="${nhibernate.transaction.ignore_session_synchronization_failures}">
<namespaces>
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
</namespaces>
</xmlpoke>

<!-- Make sure the property exists - it's only set for some scenarios. -->
<property name="nhibernate.transaction.system_completion_lock_timeout" value="" unless="${property::exists('nhibernate.transaction.system_completion_lock_timeout')}"/>
<xmlpoke file="${app.config}"
xpath="//*/hbm:property[@name='transaction.system_completion_lock_timeout']"
value="${nhibernate.transaction.system_completion_lock_timeout}">
<namespaces>
<namespace prefix="hbm" uri="urn:nhibernate-configuration-2.2" />
</namespaces>
</xmlpoke>
</target>

<target name="put-connection-settings-into-app-config">
Expand Down
3 changes: 2 additions & 1 deletion doc/reference/modules/basic_mapping.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3919,7 +3919,8 @@
<row>
<entry><literal>CultureInfo</literal></entry>
<entry><literal>System.Globalization.CultureInfo</literal></entry>
<entry><literal>DbType.String</literal> - 5 chars for culture</entry>
<entry><literal>DbType.String</literal> - 5 chars for culture by default;
can be modified by the <literal>length</literal> mapping attribute.</entry>
<entry>Default when no <literal>type</literal> attribute specified.</entry>
</row>
<row>
Expand Down
Loading

0 comments on commit 356ff7f

Please sign in to comment.