Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ trim_trailing_whitespace = false
[*.cs]

# New line preferences
end_of_line = crlf
end_of_line = lf
insert_final_newline = true

# Indentation preferences
Expand Down
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
###############################################################################
* text=auto

# C# sources are normalized to LF so dotnet format behaves identically on
# Windows and Linux agents.
*.cs text eol=lf

###############################################################################
# Set default behavior for command prompt diff.
#
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ env:

jobs:
build:
name: Build & Test
runs-on: windows-latest
name: Build & Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
timeout-minutes: 15

steps:
Expand Down Expand Up @@ -54,4 +58,4 @@ jobs:
retention-days: 14

- name: Audit NuGet packages
run: dotnet nuget audit
run: dotnet restore --force /p:NuGetAudit=true /p:NuGetAuditMode=all /p:NuGetAuditLevel=moderate
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ format:
nuget_audit:
stage: security
script:
- dotnet nuget audit
- dotnet restore --force /p:NuGetAudit=true /p:NuGetAuditMode=all /p:NuGetAuditLevel=moderate
allow_failure: true
7 changes: 6 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
<FileVersion>2.0.0.0</FileVersion>
<InformationalVersion>2.0.0</InformationalVersion>
<UserSecretsId>spo2sql-modernization-secrets</UserSecretsId>
<NoWarn>$(NoWarn);CS8618;CS8600;CS8601;CS8602;CS8603;CS8604;CS8625;CS8605;CS8605;CA1416;NU1603;CS0618;CS0649;CA1305;CA1310;CA1311;CA1304;CA1846;CA1862;CA1866;CA5350;CA2201;CA1805</NoWarn>
<NoWarn>$(NoWarn);NU1603</NoWarn>
</PropertyGroup>

<ItemGroup>
<!-- Explicit patched version: 8.0.0 is affected by GHSA-8g4q-xg66-9fp4 and GHSA-hh2w-p6rv-4g7w. -->
<PackageReference Include="System.Text.Json" Version="8.0.6" />
</ItemGroup>
</Project>
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- Per-list column mapping, destination names, data types, and ignore rules.
- Retry handling for transient SharePoint and network failures.
- Startup health checks for SharePoint and SQL connectivity.
- Operation statistics, structured logging, and cancellation support.
- End-to-end async I/O with cancellation, per-list operation statistics and structured logging.
- Credential providers for environment variables, Windows DPAPI, and application configuration.
- Automated build, test, formatting, dependency-audit, and CodeQL workflows.

Expand Down Expand Up @@ -53,7 +53,9 @@ docs/ Configuration, security, modernization, and operational
- SQL Server access with permission to read source metadata and create/update destination tables
- A SharePoint account or supported application identity configured for the target tenant

The current authentication path uses username/password token acquisition. Environments requiring interactive MFA or Conditional Access should use an app-only/service-principal authentication design instead of relying on password-based authentication.
Two authentication modes are supported. For unattended jobs, configure app-only authentication by setting `SharePoint:TenantId`, `SharePoint:ClientId` and `SharePoint:CertificatePath` (plus `CertificatePassword` when the PFX is protected); this uses client credentials with a certificate and is not blocked by MFA or Conditional Access. When those values are absent, the legacy username/password flow is used as a fallback, which will fail in tenants that enforce MFA.

Run `dotnet run -- --setup-secrets` to store credentials in the current user's DPAPI-protected store (Windows only).

## Build and test

Expand Down Expand Up @@ -98,7 +100,11 @@ The console application binds these sections:
"Password": "",
"TimeoutSeconds": 120,
"MaxRetries": 3,
"InitialRetryDelayMs": 1000
"InitialRetryDelayMs": 1000,
"TenantId": "",
"ClientId": "",
"CertificatePath": "",
"CertificatePassword": ""
},
"Sql": {
"ConnectionString": "Server=.;Database=SPO2SQL;Integrated Security=true;Encrypt=true;TrustServerCertificate=false;",
Expand Down Expand Up @@ -160,7 +166,7 @@ The detailed security guidance is available in [`docs/SECURITY.md`](docs/SECURIT

## CI/CD

GitHub Actions runs on pushes and pull requests:
GitHub Actions runs on pushes and pull requests on both Linux and Windows:

1. Restore NuGet dependencies.
2. Build with warnings treated as errors.
Expand Down
24 changes: 14 additions & 10 deletions UPGRADE_SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,17 @@ Logger (Enhanced)

---

## Future Improvements

- [ ] Add async/await support for SharePoint operations
- [ ] Implement connection pooling for SQL Server
- [ ] Add retry logic with exponential backoff
- [ ] Create configuration service layer
- [ ] Add metrics/performance monitoring
- [ ] Implement proper dependency injection
- [ ] Add unit test suite
- [ ] Add telemetry for debugging
## Status of Previously Planned Improvements

This summary describes an earlier modernization pass. The items below were
subsequently delivered in the current codebase (see `docs/PROGRESS.md`):

- [x] Async/await for SharePoint and SQL operations, with cancellation
- [x] Retry logic with exponential backoff and jitter (`RetryPolicy`)
- [x] Configuration service layer (`SyncSettings` plus validated options)
- [x] Per-list metrics logging via `OperationStatistics`
- [x] Dependency injection in the .NET host
- [x] Unit test suite across both projects
- [x] App-only authentication, real health checks and warning-free nullable build

Still open: OpenTelemetry export and live integration tests.
Loading
Loading