-
Notifications
You must be signed in to change notification settings - Fork 17
Bugfix/rdmp 359 internal catalogue bugs #2311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9470a4a
add drag and drop fix for internal catalogues
JFriel 41884bc
prevent commit of internal catalogues
JFriel 94199b1
add changelog
JFriel 11d0480
fix typo
JFriel 56ffdbb
add internal cohort test
JFriel ba9c21e
update test
JFriel 95fcc16
fix shared assembly number
JFriel c6a2757
Merge branch 'develop' into bugfix/RDMP-359-internal-catalogue-bugs
JFriel 18d6876
Update CHANGELOG.md
JFriel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
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.
Check notice
Code scanning / CodeQL
Missed opportunity to use Where Note
Copilot Autofix
AI about 1 month ago
In general, to fix a "missed opportunity to use Where" in a
foreachloop that immediately tests each element with anifand either continues or breaks, you replace the loop with a LINQ query that directly expresses the predicate, then act on the filtered result(s). This usually reduces nesting and makes it obvious you are searching or filtering, rather than performing arbitrary per-element logic.For this specific case, the loop is only interested in whether there exists any aggregate configuration whose
Catalogueis non-null andIsInternalDataset. On finding the first such configuration, it setstask.CrashMessageandtask.Stateand stops iterating. The clearest equivalent using LINQ is to obtain the first offending configuration viaFirstOrDefault, then if that result is non-null, setCrashMessage/State. We already haveusing System.Linq;at the top, so no new imports are needed. The behavior remains unchanged: there is at most one place whereCrashMessage/Stateare set in this block, and enumeration stops as soon as the first problematic configuration is found.Concretely, in
Rdmp.Core/CohortCreation/Execution/CohortCompiler.cs, replace theforeachblock at lines 325–333 with code that callscac.GetAggregateConfigurations().FirstOrDefault(...)using the same predicate (ac => ac.Catalogue != null && ac.Catalogue.IsInternalDataset). If a matching configuration is found, construct the sameArgumentExceptionusing that configuration’sCatalogue.Nameand settask.State = CompilationState.Crashed;. No additional methods or fields are required.