From 47ceffc6fd1cf0160ae21b9728ff6eb5097c825f Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Mon, 11 Nov 2024 15:34:16 +1300 Subject: [PATCH] Add support for dotnet-sdk package ecosystem --- .github/workflows/cleanup.yml | 1 + .github/workflows/updater.yml | 1 + Rakefile | 1 + .../tasks/dependabotV2/utils/dependabot/parseConfigFile.ts | 2 ++ server/Tingle.Dependabot.Tests/Workflow/UpdateRunnerTests.cs | 1 + server/Tingle.Dependabot/Workflow/UpdateRunner.cs | 1 + updater/bin/update_script.rb | 1 + updater/lib/tinglesoftware/dependabot/job.rb | 1 + 8 files changed, 9 insertions(+) diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index 8a8864f9..adf2e097 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -16,6 +16,7 @@ jobs: - { ecosystem: cargo } - { ecosystem: composer } - { ecosystem: docker } + - { ecosystem: dotnet-sdk } - { ecosystem: elm } - { ecosystem: gitsubmodule } - { ecosystem: github-actions } diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml index 8544175d..2e60073a 100644 --- a/.github/workflows/updater.yml +++ b/.github/workflows/updater.yml @@ -35,6 +35,7 @@ jobs: - { ecosystem: cargo } - { ecosystem: composer } - { ecosystem: docker } + - { ecosystem: dotnet-sdk } - { ecosystem: elm } - { ecosystem: gitsubmodule } - { ecosystem: github-actions } diff --git a/Rakefile b/Rakefile index 1c5491de..8ddb9638 100644 --- a/Rakefile +++ b/Rakefile @@ -17,6 +17,7 @@ GEMSPECS = %w( go_modules/dependabot-go_modules.gemspec terraform/dependabot-terraform.gemspec docker/dependabot-docker.gemspec + dotnet_sdk/dependabot-dotnet_sdk.gemspec git_submodules/dependabot-git_submodules.gemspec github_actions/dependabot-github_actions.gemspec nuget/dependabot-nuget.gemspec diff --git a/extension/tasks/dependabotV2/utils/dependabot/parseConfigFile.ts b/extension/tasks/dependabotV2/utils/dependabot/parseConfigFile.ts index 5440cf0a..f8a5db8b 100644 --- a/extension/tasks/dependabotV2/utils/dependabot/parseConfigFile.ts +++ b/extension/tasks/dependabotV2/utils/dependabot/parseConfigFile.ts @@ -158,6 +158,8 @@ function parseUpdates(config: any): IDependabotUpdate[] { switch (ecosystem) { case 'devcontainer': return 'devcontainers'; + case 'dotnet-sdk': + return 'dotnet_sdk'; case 'github-actions': return 'github_actions'; case 'gitsubmodule': diff --git a/server/Tingle.Dependabot.Tests/Workflow/UpdateRunnerTests.cs b/server/Tingle.Dependabot.Tests/Workflow/UpdateRunnerTests.cs index 10dc0a55..6fd55cb9 100644 --- a/server/Tingle.Dependabot.Tests/Workflow/UpdateRunnerTests.cs +++ b/server/Tingle.Dependabot.Tests/Workflow/UpdateRunnerTests.cs @@ -309,6 +309,7 @@ public void ConvertEcosystemToPackageManager_Works(string ecosystem, string expe public static TheoryData ConvertEcosystemToPackageManagerValues => new() { + { "dotnet-sdk", "dotnet_sdk" }, { "github-actions", "github_actions" }, { "gitsubmodule", "submodules" }, { "gomod", "go_modules" }, diff --git a/server/Tingle.Dependabot/Workflow/UpdateRunner.cs b/server/Tingle.Dependabot/Workflow/UpdateRunner.cs index 0c41f804..fa340b27 100644 --- a/server/Tingle.Dependabot/Workflow/UpdateRunner.cs +++ b/server/Tingle.Dependabot/Workflow/UpdateRunner.cs @@ -474,6 +474,7 @@ internal static IList> MakeExtraCredentials(ICollecti return ecosystem switch { + "dotnet-sdk" => "dotnet_sdk", "github-actions" => "github_actions", "gitsubmodule" => "submodules", "gomod" => "go_modules", diff --git a/updater/bin/update_script.rb b/updater/bin/update_script.rb index c2020fa6..01d99154 100644 --- a/updater/bin/update_script.rb +++ b/updater/bin/update_script.rb @@ -132,6 +132,7 @@ # https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#package-ecosystem # [Hash] PACKAGE_ECOSYSTEM_MAPPING = { + "dotnet-sdk" => "dotnet_sdk", "github-actions" => "github_actions", "gitsubmodule" => "submodules", "gomod" => "go_modules", diff --git a/updater/lib/tinglesoftware/dependabot/job.rb b/updater/lib/tinglesoftware/dependabot/job.rb index b7ca9d8c..a1ecd335 100644 --- a/updater/lib/tinglesoftware/dependabot/job.rb +++ b/updater/lib/tinglesoftware/dependabot/job.rb @@ -190,6 +190,7 @@ def _package_manager # GitHub native implementation modifies some of the names in the config file # https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#package-ecosystem { + "dotnet-sdk" => "dotnet_sdk", "github-actions" => "github_actions", "gitsubmodule" => "submodules", "gomod" => "go_modules",