Fix run with Azure Pipelines as CI Source and Azure Repos Git as Request Source#1284
Merged
Conversation
…nes, undo project and slug vars initialization from Danger::RequestSources::VSTS and exclude git as proviter in Danger::AzurePipelines (provided by Danger::VSTS)
Generated by 🚫 Danger |
Member
|
Yeah, I think VSTS and Pipelines are now basically the same - it'd be good to get a test for this, but otherwise looks good to me |
Contributor
Author
|
I added tests for Danger::AzurePipelines but I think CI build should be rerun. |
Member
|
Thanks! Looks good to me |
This was referenced Jan 23, 2023
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.
When running Danger with Azure Pipeline (CI Source), 2 CI Source (Danger::CI subclass) match :
Danger::AzurePipelinesandDanger::VSTS, the first is always selected.The problem is, when I use Azure Repos Git (Request Source),
Danger::RequestSources::VSTSis inDanger::VSTS.supported_request_sourcesbut not inDanger::AzurePipeline.supported_request_sources.So, like it's
Danger::AzurePipelinesselected as default CI Source, an error is throw.I added a filter in
Danger::AzurePipelines.validates_as_ci?to return false if Request Source is Azure Repos Git without changing the previous value in other case.For that I use
BUILD_REPOSITORY_PROVIDERenvironment variable defined by Azure Pipeline (see Predefined variables - Azure Pipelines). The value of this environment variable is "TfsGit" only if Request Provider (Request Source) is Azure Repos Git.Conclusion: If I use Azure Pipelines with Azure Repos Git,
Danger::AzurePipelineswill not be selected because it does not supportDanger::RequestSources::VSTS. The selected CI Source will beDanger::VSTS, as expected.PS: I think
Danger::AzurePipelinesandDanger::VSTSshould be merged because I think they represent the same CI Source (Azure Pipeline is the evolution of VSTS).