|
6 | 6 |
|
7 | 7 | **Status**: Active Development |
8 | 8 | **Last Updated**: 2025-11-14 |
9 | | -**Version**: 1.1.0 |
10 | | -**Latest Release**: [v1.1.0](https://github.com/DynamicDevices/cga-coordinate-mapping/releases/tag/v1.1.0) (2025-11-14) |
| 9 | +**Version**: 1.2.0 |
| 10 | +**Latest Release**: [v1.2.0](https://github.com/DynamicDevices/cga-coordinate-mapping/releases/tag/v1.2.0) (2025-11-14) |
11 | 11 | **Repository **: `[email protected]:DynamicDevices/cga-coordinate-mapping.git` |
12 | 12 | **License**: GPLv3 (see LICENSE file) |
13 | 13 |
|
14 | 14 | ## Recent Updates (2025-11-14) |
15 | 15 |
|
| 16 | +### CI Workflow Restructured (2025-11-14) |
| 17 | +- ✅ **Simplified CI Structure**: Test job runs first, then build jobs run in parallel |
| 18 | +- ✅ **Stable CI Configuration**: Explicit restore before tests ensures xunit is available |
| 19 | +- ✅ **Reliable Build Pipeline**: All 92 tests pass consistently, both architectures build successfully |
| 20 | +- ⚠️ **CRITICAL**: CI configuration is now stable - DO NOT modify `.github/workflows/ci.yml` (see CI Configuration Stability section) |
| 21 | + |
| 22 | +## Previous Updates (2025-11-14) |
| 23 | + |
16 | 24 | ### Major Features Added |
17 | 25 | - ✅ **Logging Framework**: Replaced all `Console.WriteLine` with `Microsoft.Extensions.Logging` |
18 | 26 | - Centralized `AppLogger` class for application-wide logging |
@@ -413,55 +421,59 @@ Beacons can be provided dynamically via MQTT messages. Nodes with `positionKnown |
413 | 421 |
|
414 | 422 | ### ⚠️ CRITICAL: CI Configuration Stability |
415 | 423 |
|
416 | | -**🚨 DO NOT CHANGE THE CI WORKFLOW - IT IS WORKING CORRECTLY 🚨** |
| 424 | +**🚨🚨🚨 DO NOT MODIFY THE CI WORKFLOW - IT IS WORKING CORRECTLY 🚨🚨🚨** |
| 425 | + |
| 426 | +**The CI has been broken multiple times by unnecessary changes. The current configuration is stable and working. DO NOT change `.github/workflows/ci.yml` unless there is a critical bug that cannot be fixed any other way.** |
| 427 | + |
| 428 | +**Current Working CI Configuration (2025-11-14):** |
417 | 429 |
|
418 | | -**The CI is currently working and all tests pass. Any changes to `.github/workflows/ci.yml` risk breaking the build pipeline. Only modify if absolutely necessary and after extensive local testing.** |
| 430 | +The CI workflow uses a **two-job structure** that is simple and reliable: |
419 | 431 |
|
420 | | -The CI workflow (`.github/workflows/ci.yml`) uses a carefully sequenced restore/build pattern to handle the shared `obj` directory issue. The current working configuration uses: |
| 432 | +1. **Test Job** (runs first): |
| 433 | + - Clean `obj` and `bin` directories |
| 434 | + - Restore test project: `dotnet restore tests/InstDotNet.Tests.csproj` |
| 435 | + - This restores both the test project AND the main project (as a dependency) |
| 436 | + - Ensures xunit is included in the shared `project.assets.json` |
| 437 | + - Run tests: `dotnet test tests/InstDotNet.Tests.csproj --no-restore` |
| 438 | + - Uses the restored dependencies, builds both projects, runs all 92 tests |
421 | 439 |
|
422 | | -1. **Restore solution** (`dotnet restore InstDotNet.sln`) - Gets all packages including xunit |
423 | | -2. **Build main project** (`dotnet build src/InstDotNet.csproj -r runtime`) - Builds with runtime, may restore again |
424 | | -3. **Restore test project** (`dotnet restore tests/InstDotNet.Tests.csproj --force`) - **CRITICAL**: Ensures xunit is in assets file after main project restore may have overwritten it |
425 | | -4. **Build test project** (`dotnet build tests/InstDotNet.Tests.csproj --no-restore`) - Uses packages from restore above |
426 | | -5. **Run tests** (`dotnet test --no-build`) - Uses pre-built test project |
| 440 | +2. **Build Jobs** (run in parallel after tests pass): |
| 441 | + - One job for `linux-arm64`, one for `linux-x64` |
| 442 | + - Clean `obj`, `bin`, and `publish` directories |
| 443 | + - Publish: `dotnet publish src/InstDotNet.csproj -r ${{ matrix.runtime }}` |
| 444 | + - Create archives and upload artifacts |
427 | 445 |
|
428 | | -**Why this is reliable:** |
429 | | -- Solution restore gets all packages upfront |
430 | | -- Main project build gets runtime-specific assets |
431 | | -- **Explicit test project restore with --force ensures xunit is always in assets file** (this is the key fix) |
432 | | -- Test build uses `--no-restore` to avoid overwriting assets |
433 | | -- Test run uses `--no-build` to use pre-built project |
434 | | -- All steps in one script block for atomic execution |
435 | | -- Tested with both linux-arm64 and linux-x64 |
| 446 | +**Why This Works:** |
| 447 | +- **Simple separation**: Tests run first, builds run after |
| 448 | +- **Explicit restore**: Restoring the test project ensures xunit is in the assets file |
| 449 | +- **No restore conflicts**: Test job and build jobs are separate, so no shared assets file conflicts |
| 450 | +- **Clean state**: Each job starts with a clean `obj` directory |
| 451 | +- **Tested and verified**: All 92 tests pass consistently |
436 | 452 |
|
437 | | -**Root Cause Analysis:** |
| 453 | +**Root Cause of Previous Issues:** |
438 | 454 | - Both projects share the same `obj` directory (via `Directory.Build.props`) |
439 | 455 | - They share the same `project.assets.json` file |
440 | | -- When main project restores with runtime, it also restores test project (via project reference), overwriting assets file |
441 | | -- This can remove xunit packages from the assets file |
442 | | -- **Solution**: Explicitly restore test project AFTER main project build to ensure xunit is always present |
443 | | - |
444 | | -**Before modifying CI:** |
445 | | -- Test locally with the exact same commands |
446 | | -- Verify all 92 tests pass |
447 | | -- Test both linux-arm64 and linux-x64 builds locally |
448 | | -- Review git history for previous working configurations |
449 | | - |
450 | | -**Current stable configuration:** Commit (latest) - 5-step restore/build sequence |
451 | | - |
452 | | -**Known Issue - Intermittent Test Failures:** |
453 | | -- Tests may fail intermittently due to race conditions with static state |
454 | | -- Static state includes: `AppLogger`, `MQTTControl.OnMessageReceived`, `UWB2GPSConverter._configuredBeacons` |
455 | | -- **Fix applied**: Disabled parallel test execution (`xUnitDisableParallelTestExecution=true`) to ensure test isolation |
456 | | -- All test classes that modify static state use `[Collection("LoggerTests")]` to run sequentially |
457 | | -- If CI fails intermittently, check for test isolation issues first |
458 | | - |
459 | | -**⚠️ IMPORTANT: This CI configuration is working correctly. DO NOT modify it unless there is a critical need. The CI has been broken multiple times in the past by unnecessary changes. If you must modify it:** |
| 456 | +- When restoring projects with different runtime identifiers, the assets file can be overwritten |
| 457 | +- This can remove xunit packages needed by the test project |
| 458 | +- **Solution**: Separate test job that restores explicitly, then build jobs that don't interfere |
| 459 | + |
| 460 | +**⚠️ CRITICAL WARNING - DO NOT CHANGE:** |
| 461 | +- **DO NOT** combine test and build steps in the same job |
| 462 | +- **DO NOT** remove the explicit restore step before tests |
| 463 | +- **DO NOT** try to optimize or simplify the workflow further |
| 464 | +- **DO NOT** add restore steps to the build jobs unless absolutely necessary |
| 465 | +- **DO NOT** change the order of steps |
| 466 | +- **DO NOT** modify the restore/build commands |
| 467 | + |
| 468 | +**The CI has been broken repeatedly by "improvements" that seemed logical but caused failures. The current configuration is the result of extensive troubleshooting and is working correctly. Please respect this warning.** |
| 469 | + |
| 470 | +**If you absolutely must modify the CI:** |
460 | 471 | 1. Test locally with the exact same commands first |
461 | | -2. Verify all 92 tests pass locally |
462 | | -3. Test both linux-arm64 and linux-x64 builds locally |
| 472 | +2. Verify all 92 tests pass locally for both architectures |
| 473 | +3. Test the complete workflow: clean, restore, test, then build |
463 | 474 | 4. Only then commit and push |
464 | 475 | 5. Monitor the CI run closely after pushing |
| 476 | +6. Be prepared to revert immediately if it breaks |
465 | 477 |
|
466 | 478 | ### Target Platform |
467 | 479 | - **Primary**: Linux ARM64 (embedded systems) |
@@ -538,7 +550,7 @@ The CI workflow (`.github/workflows/ci.yml`) uses a carefully sequenced restore/ |
538 | 550 | - **Performance**: Optimized neighbor lookups using Dictionary<string, UWB> for O(1) access instead of O(n) linear search |
539 | 551 | - **Versioning**: Semantic versioning (MAJOR.MINOR.PATCH) with build metadata (date, git commit hash) |
540 | 552 | - **License**: GPLv3 - See LICENSE file for full terms |
541 | | -- **CI Stability**: ⚠️ **CRITICAL** - The CI workflow is working correctly. DO NOT modify `.github/workflows/ci.yml` unless absolutely necessary. See "CI Configuration Stability" section above for details. The CI has been broken multiple times by unnecessary changes - please respect this warning. |
| 553 | +- **CI Stability**: ⚠️⚠️⚠️ **CRITICAL** - The CI workflow is working correctly. **DO NOT modify `.github/workflows/ci.yml`**. The CI has been broken multiple times by unnecessary changes. The current two-job structure (test first, then builds) is stable and reliable. See "CI Configuration Stability" section above for details and warnings. |
542 | 554 |
|
543 | 555 | ## Contact & Maintenance |
544 | 556 |
|
|
0 commit comments