Skip to content

Task/rdmp 365 better load metadata logging#2323

Open
JFriel wants to merge 16 commits into
developfrom
task/RDMP-365-better-load-metadata-logging
Open

Task/rdmp 365 better load metadata logging#2323
JFriel wants to merge 16 commits into
developfrom
task/RDMP-365-better-load-metadata-logging

Conversation

@JFriel

@JFriel JFriel commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator

Proposed Change

Catalogues can currently only be associated with a single load metadata.
This is a bit weird, as multiple data loads can populate a catalogue.

This change migrates away from this 1-1 model to a many-to-many model.

Each load metadata -> catalogue linkage will have a name (default "Loading ()"
with multiple linkages being able to have the same name

This means that we will be able to now identify logs for each catalogue based on the linkage to a loadmetadata rather than just by catalogue.

This will solve the issue where LMD2 logs were showing up in LMD1 due to both LMD1 and LMD2 importing data into a single catalogue

Type of change

What types of changes does your code introduce? Tick all that apply.

  • Bugfix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation-Only Update
  • Other (if none of the other choices apply)

Checklist

By opening this PR, I confirm that I have:

  • Ensured that the PR branch is in sync with the target branch (i.e. it is automatically merge-able)
  • Created or updated any tests if relevant
  • Have validated this change against the Test Plan
  • Requested a review by one of the repository maintainers
  • Have written new documentation or updated existing documentation to detail any new or updated functionality and how to use it
  • Have added an entry into the changelog

@JFriel JFriel marked this pull request as ready for review March 13, 2026 14:13
}
}
var missingTasks = catalogues.Where(c => c.LoggingDataTasks.Count() ==0).ToArray();
var potentialTasks = catalogues.Except(missingTasks).SelectMany(c => c.LoggingDataTasks).Distinct().ToArray();

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This assignment to
potentialTasks
is useless, since its value is never read.

Copilot Autofix

AI 3 months ago

In general, to fix a “useless assignment to local variable” you either (1) remove the unused variable and its assignment if the computed value is not needed, or (2) start using the variable in place of recomputing the same value elsewhere. Here, the variable potentialTasks is assigned but never read, and the right-hand side is a pure LINQ expression without side effects, so the simplest non‑functional change is to remove the declaration/assignment entirely.

Concretely, in MetadataLoggingConfigurationChecks.Check within Rdmp.Core/DataLoad/Engine/Checks/Checkers/MetadataLoggingConfigurationChecks.cs, in the #region Fix missing LoggingDataTask block, leave the missingTasks line intact and delete the line that declares and initializes potentialTasks. No other code changes or imports are required, since potentialTasks is not referenced anywhere else in the shown snippet. This preserves existing behavior while eliminating the dead assignment and the associated CodeQL warning.

Suggested changeset 1
Rdmp.Core/DataLoad/Engine/Checks/Checkers/MetadataLoggingConfigurationChecks.cs

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/Rdmp.Core/DataLoad/Engine/Checks/Checkers/MetadataLoggingConfigurationChecks.cs b/Rdmp.Core/DataLoad/Engine/Checks/Checkers/MetadataLoggingConfigurationChecks.cs
--- a/Rdmp.Core/DataLoad/Engine/Checks/Checkers/MetadataLoggingConfigurationChecks.cs
+++ b/Rdmp.Core/DataLoad/Engine/Checks/Checkers/MetadataLoggingConfigurationChecks.cs
@@ -64,7 +64,6 @@
         #region Fix missing LoggingDataTask
 
         var missingTasks = catalogues.Where(c => c.LoggingDataTasks.Count() ==0).ToArray();
-        var potentialTasks = catalogues.Except(missingTasks).SelectMany(c => c.LoggingDataTasks).Distinct().ToArray();
 
         #endregion
 
EOF
@@ -64,7 +64,6 @@
#region Fix missing LoggingDataTask

var missingTasks = catalogues.Where(c => c.LoggingDataTasks.Count() ==0).ToArray();
var potentialTasks = catalogues.Except(missingTasks).SelectMany(c => c.LoggingDataTasks).Distinct().ToArray();

#endregion

Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants