Skip to content

analyze cmdlets differences #20460

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 45 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4990a26
Set up first CI try with Azure Pipelines
greathongtu Jan 13, 2023
103ba72
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 13, 2023
874fdae
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 13, 2023
226983a
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 13, 2023
21b9335
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 13, 2023
22414ff
Merge pull request #1 from xtR0d666/pipeline_try
greathongtu Jan 13, 2023
e33c2f6
commit me
greathongtu Jan 18, 2023
8cc1bf1
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
8fe0488
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
8003867
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
c5bcdd2
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
ca0b088
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
6afa3f2
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
6f6893f
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
181393e
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
ab51199
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
20abb71
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
278007e
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
301ed0d
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
7233ce1
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
7b3c2dc
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
2546edf
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
599b761
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
a2c690b
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
b2a1d7d
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
bb94d2d
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
aa78cb1
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
52e38cf
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
8c8ea6a
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
e167084
Update azure-pipelines.yml for Azure Pipelines
greathongtu Jan 18, 2023
f97299b
Merge branch 'Azure:main' into main
greathongtu Jan 19, 2023
789ab64
remove test yml
Jan 19, 2023
153ec3a
Merge branch 'main' of https://github.com/xtR0d666/azure-powershell
Jan 19, 2023
f5781f0
Merge branch 'main' of https://github.com/xtR0d666/azure-powershell
Feb 7, 2023
c4ab24a
fresh new branch
Feb 7, 2023
a38d880
Merge branch 'main' of https://github.com/xtR0d666/azure-powershell
Feb 10, 2023
7d1ce51
Merge branch 'main' of https://github.com/xtR0d666/azure-powershell
Feb 10, 2023
04c5fc6
Merge branch 'main' of https://github.com/xtR0d666/azure-powershell
Feb 10, 2023
e460da4
fresh new branch
Feb 7, 2023
8b15260
Add new static analysis phase
Feb 14, 2023
806022a
fix conflict
Feb 14, 2023
a652061
fix md name
Feb 14, 2023
29c1407
change PipelineReult json
Feb 17, 2023
9a1b7fa
change PipelineReult json
Feb 17, 2023
cda64cf
Set moduleInfo.Status to Succeeded
Feb 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .ci-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@
"signature:module",
"test:dependence-module",
"file-change:module",
"ux:module"
"ux:module",
"cmdlet-diff:module"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class CIFilterTask : Task

private const string BUILD_PHASE = "build";
private const string TEST_PHASE = "test";
private readonly List<string> ANALYSIS_PHASE_LIST = new List<string>() { "breaking-change", "help-example", "help", "dependency", "signature", "file-change", "ux" };
private readonly List<string> ANALYSIS_PHASE_LIST = new List<string>() { "breaking-change", "help-example", "help", "dependency", "signature", "file-change", "ux", "cmdlet-diff" };
private const string ACCOUNT_MODULE_NAME = "Accounts";

private const string MODULE_NAME_PLACEHOLDER = "ModuleName";
Expand Down Expand Up @@ -173,7 +173,7 @@ private List<string> GetSelectedModuleList()
private List<string> GetTestCsprojList(string moduleName, Dictionary<string, string[]> csprojMap)
{
return GetRelatedCsprojList(moduleName, csprojMap)
.Where(x => x.Contains("Test")).ToList();;
.Where(x => x.Contains("Test")).ToList();
}

private bool ProcessTargetModule(Dictionary<string, string[]> csprojMap)
Expand All @@ -196,7 +196,7 @@ private bool ProcessTargetModule(Dictionary<string, string[]> csprojMap)
Console.WriteLine("--------------------------------------------------------");

FilterTaskResult.PhaseInfo = influencedModuleInfo;

return true;
}

Expand Down Expand Up @@ -388,7 +388,7 @@ private bool ProcessFileChanged(Dictionary<string, string[]> csprojMap)
influencedModuleInfo = CalculateCsprojForBuildAndTest(influencedModuleInfo, csprojMap);
DateTime endTime = DateTime.Now;
Console.WriteLine(string.Format("Takes {0} seconds for RE match, {1} seconds for phase config.", (endOfRegularExpressionTime - startTime).TotalSeconds, (endTime - endOfRegularExpressionTime).TotalSeconds));

FilterTaskResult.PhaseInfo = influencedModuleInfo;

if (!Directory.Exists(config.ArtifactPipelineInfoFolder))
Expand Down
22 changes: 22 additions & 0 deletions tools/ExecuteCIStep.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ Param(
[Switch]
$StaticAnalysisUX,

[Switch]
$StaticAnalysisCmdletDiff,

[String]
$RepoArtifacts='artifacts',

Expand Down Expand Up @@ -239,6 +242,7 @@ If ($StaticAnalysis)
.("$PSScriptRoot/ExecuteCIStep.ps1") -StaticAnalysisSignature @Parameters
.("$PSScriptRoot/ExecuteCIStep.ps1") -StaticAnalysisHelp @Parameters
.("$PSScriptRoot/ExecuteCIStep.ps1") -StaticAnalysisUX @Parameters
.("$PSScriptRoot/ExecuteCIStep.ps1") -StaticAnalysisCmdletDiff @Parameters
Return
}

Expand Down Expand Up @@ -331,3 +335,21 @@ If ($StaticAnalysisUX)
}
Return
}

If ($StaticAnalysisCmdletDiff)
{
If ($PSBoundParameters.ContainsKey("TargetModule"))
{
$CmdletDiffModuleList = $TargetModule
}
Else
{
$CmdletDiffModuleList = Join-String -Separator ';' -InputObject $CIPlan.'cmdlet-diff'
}
If ("" -Ne $CmdletDiffModuleList)
{
Write-Host "Running static analysis for cmdlet diff..."
dotnet $RepoArtifacts/StaticAnalysis/StaticAnalysis.Netcore.dll -p $RepoArtifacts/$Configuration -r $StaticAnalysisOutputDirectory --analyzers cmdlet-diff -u -m $CmdletDiffModuleList
}
Return
}
6 changes: 6 additions & 0 deletions tools/PipelineResultTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
"Details": [
]
},
"cmdlet-diff": {
"PhaseName": "Cmdlet Diff Check",
"Order": 7,
"Details": [
]
},
"test": {
"PhaseName": "Test",
"Order": 100,
Expand Down
Loading