fix(191): reconcile JD error-code drift (wire JD0023/JD0025)#202
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #202 +/- ##
==========================================
+ Coverage 83.70% 92.19% +8.48%
==========================================
Files 92 92
Lines 4788 4791 +3
Branches 737 614 -123
==========================================
+ Hits 4008 4417 +409
+ Misses 485 374 -111
+ Partials 295 0 -295
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…purious JD0022 double-log)
fef772a to
5173218
Compare
Contributor
Code Coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #191 (ERROR-CODE DRIFT sub-item). Reconciles emitted-vs-documented JD00xx error codes so every documented code has exactly one emitting call site and vice versa.
Enumeration (emitted vs. documented)
log.Error("JDxxxx", ...)/log.Warn("JDxxxx", ...)insrc/): JD0001, JD0002, JD0003, JD0011, JD0012, JD0013, JD0014, JD0015, JD0016, JD0017, JD0018, JD0019, JD0020, JD0021, JD0022, JD0024, JD0026, JD0027, JD0028, JD0030, JD0031 (viaSourceNotInstalledCode/SecretNotFoundCodebuilders), JD0032, JD0033, JD0034, JD0040, JD0041.### JDxxxxheadings indocs/user-guide/error-codes.md): JD0001-3, JD0011-19, JD0040-41, JD0020-28, JD0030-34 — a full 1:1 match with emitted codes except for two drift points found:AddSqlFileWarnings.csemitted the corresponding warning message with no JD code at all (log.Warn($"Failed to process {file}: ...")).RunSqlPackage.cs'sExecuteSqlPackagehad notry/catcharoundProcess.Start/WaitForExitat all, so any exception there (e.g. a non-executable tool path) fell through to the generic, uncoded top-level task exception handler instead of a JD-coded error.No other drift was found: JD0026-28 (#186 tool acquisition), JD0030-34 (#188 connection-string sources), and JD0017-19/JD0040-41 (#184 custom providers) are all correctly documented and emitted 1:1 — left untouched per instructions.
Changes
src/JD.Efcpt.Build.Tasks/AddSqlFileWarnings.cs: wired the per-file exception warning tolog.Warn("JD0025", ...).docs/user-guide/error-codes.md: corrected JD0025 severity from Error to Warning (matches thelog.Warncall site) and updated its example to reflect the actual message format and warning prefix.src/JD.Efcpt.Build.Tasks/RunSqlPackage.cs: wrapped the sqlpackage process execution (ExecuteSqlPackage) in atry/catch, emittinglog.Error("JD0023", $"SqlPackage execution failed: {ex.Message}")for the exception path, whileJD0022remains the exit-code (non-exception) failure path.tests/JD.Efcpt.Build.Tests/AddSqlFileWarningsTests.cs:Continues_when_individual_file_failsnow assertsCode == "JD0025"on the logged warning (previously only checked the message text).tests/JD.Efcpt.Build.Tests/RunSqlPackageTests.cs: addedSqlPackage_execution_exception_error, which pointsToolPathat a non-executable file to trigger a genuineProcess.Startexception and assertsCode == "JD0023".Deliberately not changed
AddSqlFileWarnings.csremains uncoded — it's a benign no-op informational warning with no corresponding documented code.Test plan
dotnet build JD.Efcpt.Build.sln -c Debug— 0 errors, 6 pre-existing NuGet TFM-support warnings unrelated to this change (build hasTreatWarningsAsErrors=trueand passed)dotnet test tests/JD.Efcpt.Build.Tests --filter "FullyQualifiedName~AddSqlFileWarnings |FullyQualifiedName~RunSqlPackage|FullyQualifiedName~SqlPackage"— 55/55 passed