Secret Scanning Alerts migration - update to new location types #1306
+368
−96
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.
PR implements #1305
ThirdPartyNotices.txt
(if applicable)Summary of code changes
src/Octoshift/Models/GithubSecretScanningAlert.cs
GithubSecretScanningAlert
to include resolution commentGithubSecretScanningAlertLocation
to include types of location and related infosrc/Octoshift/Services/GithubApi.cs
to work with new model definitionresolution_comment
when updating alertsrc/Octoshift/Services/SecretScanningAlertService.cs
in regards to matching the locations of alerts criteria to include the new location types; and the algorithm for matching alerts between source and target repositories.Instead of iterating thru all alerts in a list to match an alert from source and target we now use dictionary for the lookup. We use this lookup to match all locations on all alerts; The criteria for matching alerts follows the similar structure as before but included couple of guards/pre-flight checks to further speed up the matching process. Performance optimization has benefits when migrating repositories with big number of alerts.