Add Dependabot Alert Dismissal migration support to GEI#1351
Draft
Add Dependabot Alert Dismissal migration support to GEI#1351
Conversation
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] GEI support for Dependabot Alert Dismissal
Add Dependabot Alert Dismissal migration support to GEI
Jun 7, 2025
dylan-smith
reviewed
Jun 10, 2025
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
dylan-smith
reviewed
Jun 10, 2025
src/gei/Commands/MigrateDependabotAlerts/MigrateDependabotAlertsCommand.cs
Outdated
Show resolved
Hide resolved
…grateDependabotAlertsCommand Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
dylan-smith
reviewed
Jun 10, 2025
dylan-smith
reviewed
Jun 10, 2025
Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Unit Test Results 1 files 1 suites 21s ⏱️ Results for commit 0d85875. ♻️ This comment has been updated with latest results. |
Contributor
|
|
…ormat Co-authored-by: dylan-smith <1508559+dylan-smith@users.noreply.github.com>
Contributor
Author
Fixed the formatting issues. The problem was missing final newlines in the newly added Dependabot Alert files - applied |
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.
This PR adds support for migrating Dependabot alert dismissals in the GitHub Enterprise Importer (GEI), addressing the need to preserve dismissed Dependabot alerts and their dismissal reasons when migrating repositories.
New Features
CLI Command
gh gei migrate-dependabot-alerts- New command to migrate Dependabot alert states and dismissal informationmigrate-code-scanning-alertsandmigrate-secret-alertscommandsAlert Matching Strategy
The implementation uses a robust two-tier matching approach:
This ensures reliable alert matching even when security advisory IDs differ between source and target instances.
Supported Dismissal Reasons
Preserves all standard Dependabot dismissal reasons:
false_positive- Alert is not actually vulnerableinaccurate- Alert is not accuratenot_used- Vulnerable code is not usedno_bandwidth- No time to fix right nowtolerable_risk- Risk is acceptableState Migration
openanddismissedstates (skipsfixedas it's automatically managed)Implementation Details
Core Components
DependabotAlert,DependabotAlertDependency,DependabotAlertSecurityAdvisory,DependabotAlertSecurityVulnerabilityDependabotAlertStatewith validation for states and dismissal reasonsDependabotAlertServicehandles the migration logicDependabotAlertServiceFactoryfor dependency injectionError Handling
Testing
Added 15 comprehensive tests covering:
All existing tests continue to pass (903 total tests).
Example Usage
This resolves the issue for organizations with large numbers of dismissed Dependabot alerts who need to preserve their security review decisions during repository migrations.
Fixes #1286.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
api.github.com/home/REDACTED/work/gh-gei/gh-gei/src/gei/bin/Debug/net8.0/gei migrate-dependabot-alerts --dry-run --source-org test-org --source-repo test-repo --target-org test-org --target-repo test-repo --github-source-pat dummy --github-target-pat dummy(dns block)http://www.microsoft.com:80/pkiops/crl/Microsoft%20Identity%20Verification%20Root%20Certificate%20Authority%202020.crldotnet build src/OctoshiftCLI.sln(http block)http://www.microsoft.com:80/pkiops/crl/Microsoft%20Public%20RSA%20Timestamping%20CA%202020.crldotnet build src/OctoshiftCLI.sln(http block)www.githubstatus.com/home/REDACTED/work/gh-gei/gh-gei/src/gei/bin/Debug/net8.0/gei --help(dns block)/home/REDACTED/work/gh-gei/gh-gei/src/gei/bin/Debug/net8.0/gei migrate-dependabot-alerts --help(dns block)/home/REDACTED/work/gh-gei/gh-gei/src/gei/bin/Debug/net8.0/gei migrate-dependabot-alerts --dry-run --source-org test-org --source-repo test-repo --target-org test-org --target-repo test-repo --github-source-pat dummy --github-target-pat dummy(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.