|
94 | 94 | $folderName = @() |
95 | 95 | $changeList | ForEach-Object { |
96 | 96 | $fileName = $_.filename |
97 | | - if ($fileName -match 'eng/mgmt/mgmtmetadata') { |
| 97 | + if ($fileName -match '(?<!sdk)/eng/mgmt/mgmtmetadata') { |
98 | 98 | $mataPath += $fileName |
99 | 99 | } |
100 | 100 | } |
@@ -182,47 +182,18 @@ try { |
182 | 182 | if ($item -notmatch 'SdkInfo_') { |
183 | 183 | $exitCode ++ |
184 | 184 | } |
185 | | - else { |
186 | | - $changeContent = @() |
187 | | - $content = git -c core.safecrlf=false diff -U0 HEAD --ignore-space-at-eol $diffResult[0] |
188 | | - $content[4..($content.Length - 1)] | ForEach-Object { |
189 | | - if ($_.StartsWith('+') -or $_.StartsWith('-')) { |
190 | | - $changeContent += $_ |
191 | | - } |
192 | | - } |
193 | | - if ($changeContent.Length -ne 11) { |
194 | | - $exitCode ++ |
195 | | - } |
196 | | - |
197 | | - # metaDataContent doesn't contains 'AutoRestCmdExecuted' part since it can't be verified |
198 | | - $metaDataContent = @('- // BEGIN: Code Generation Metadata Section', |
199 | | - '- public static readonly String AutoRestVersion = "v2";', |
200 | | - '- public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413";', |
201 | | - '- public static readonly String GithubForkName = "Azure";', |
202 | | - '- public static readonly String GithubBranchName = "master";', |
203 | | - '- public static readonly String GithubCommidId = "{0}";'.Replace('{0}', $commit), |
204 | | - '- public static readonly String CodeGenerationErrors = "";', |
205 | | - '- public static readonly String GithubRepoName = "azure-rest-api-specs";', |
206 | | - '- // END: Code Generation Metadata Section' |
207 | | - ) |
208 | | - foreach ($metaString in $metaDataContent) { |
209 | | - if ($metaString -notin $changeContent) { |
210 | | - Write-Output "Diff in" $metaString |
211 | | - $exitCode ++ |
212 | | - break |
213 | | - } |
214 | | - } |
215 | | - } |
216 | 185 | } |
217 | 186 |
|
218 | 187 | if ($exitCode -ne 0) { |
219 | 188 | Write-Output "Git Diff file is:" |
220 | 189 | $diffResult | ForEach-Object { |
221 | 190 | Write-Output $_ |
222 | 191 | } |
223 | | - LogError "============================" |
| 192 | + Write-Output "Git Diff detail: " |
| 193 | + git -c core.safecrlf=false diff HEAD --ignore-space-at-eol |
| 194 | + Write-Host "============================" |
224 | 195 | LogError "Discrepancy detected between generated code in PR and reference generation. Please note, the files in the Generated folder should not be modified OR adding/excluding files. You may need to re-run sdk<RP_Name>\generate.ps1." |
225 | | - LogError "============================" |
| 196 | + Write-Host "============================" |
226 | 197 | Write-Host "For reference, we are using this command for the code check: " -ForegroundColor red -BackgroundColor white |
227 | 198 | Write-Host " autorest https://github.com/<Repo_Name>/azure-rest-api-specs/blob/<Commit_Id>/specification/<RP_Name>/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=<SDK_Repo_Path>/sdk --use:@microsoft.azure/autorest.csharp@2.3.90" -ForegroundColor red -BackgroundColor white |
228 | 199 | } |
|
0 commit comments