Skip to content

Commit 01c12a8

Browse files
author
Alex J Lennon
committed
Update to v1.2.0: Document stable CI configuration
- Update version to 1.2.0 - Document new CI structure (test job first, then parallel builds) - Add CRITICAL warning not to modify CI workflow - Update PROJECT_CONTEXT.md with latest CI configuration details
1 parent 0a81611 commit 01c12a8

File tree

2 files changed

+58
-46
lines changed

2 files changed

+58
-46
lines changed

PROJECT_CONTEXT.md

Lines changed: 54 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@
66

77
**Status**: Active Development
88
**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)
1111
**Repository**: `[email protected]:DynamicDevices/cga-coordinate-mapping.git`
1212
**License**: GPLv3 (see LICENSE file)
1313

1414
## Recent Updates (2025-11-14)
1515

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+
1624
### Major Features Added
1725
-**Logging Framework**: Replaced all `Console.WriteLine` with `Microsoft.Extensions.Logging`
1826
- Centralized `AppLogger` class for application-wide logging
@@ -413,55 +421,59 @@ Beacons can be provided dynamically via MQTT messages. Nodes with `positionKnown
413421

414422
### ⚠️ CRITICAL: CI Configuration Stability
415423

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):**
417429

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:
419431

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
421439

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
427445

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
436452

437-
**Root Cause Analysis:**
453+
**Root Cause of Previous Issues:**
438454
- Both projects share the same `obj` directory (via `Directory.Build.props`)
439455
- 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:**
460471
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
463474
4. Only then commit and push
464475
5. Monitor the CI run closely after pushing
476+
6. Be prepared to revert immediately if it breaks
465477

466478
### Target Platform
467479
- **Primary**: Linux ARM64 (embedded systems)
@@ -538,7 +550,7 @@ The CI workflow (`.github/workflows/ci.yml`) uses a carefully sequenced restore/
538550
- **Performance**: Optimized neighbor lookups using Dictionary<string, UWB> for O(1) access instead of O(n) linear search
539551
- **Versioning**: Semantic versioning (MAJOR.MINOR.PATCH) with build metadata (date, git commit hash)
540552
- **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.
542554

543555
## Contact & Maintenance
544556

src/InstDotNet.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
<Nullable>enable</Nullable>
1515

1616
<!-- Semantic Versioning -->
17-
<Version>1.1.0</Version>
18-
<AssemblyVersion>1.1.0.0</AssemblyVersion>
19-
<FileVersion>1.1.0.0</FileVersion>
20-
<VersionPrefix>1.1.0</VersionPrefix>
17+
<Version>1.2.0</Version>
18+
<AssemblyVersion>1.2.0.0</AssemblyVersion>
19+
<FileVersion>1.2.0.0</FileVersion>
20+
<VersionPrefix>1.2.0</VersionPrefix>
2121
<VersionSuffix></VersionSuffix>
2222

2323
<!-- Build metadata -->

0 commit comments

Comments
 (0)