MicrosoftPremier / VstsExtensions

Documentation and issue tracking for Microsoft Premier Services Visual Studio Team Services Extensions
MIT License
56 stars 14 forks source link

Cannot read property 'filteredWarnings' of null #65

Closed doormalena closed 4 years ago

doormalena commented 4 years ago

When the warnings policy is turned on, and no baseline is available, the extension fails with error Cannot read property 'filteredWarnings' of null

image

We are using version 6.2.2 in Azure DevOps Pipelines. Its configured in a Task Group. image

Full debug log:

2020-01-14T10:14:04.7006519Z ##[debug]Evaluating condition for step: 'Check build quality' 2020-01-14T10:14:04.7006976Z ##[debug]Evaluating: succeeded() 2020-01-14T10:14:04.7007058Z ##[debug]Evaluating succeeded: 2020-01-14T10:14:04.7007215Z ##[debug]=> True 2020-01-14T10:14:04.7007387Z ##[debug]Result: True 2020-01-14T10:14:04.7007545Z ##[section]Starting: Check build quality 2020-01-14T10:14:04.7123505Z ============================================================================== 2020-01-14T10:14:04.7123608Z Task : Build Quality Checks 2020-01-14T10:14:04.7123653Z Description : Breaks a build based on quality metrics like number of warnings or code coverage. 2020-01-14T10:14:04.7123720Z Version : 6.2.2 2020-01-14T10:14:04.7123760Z Author : Microsoft Premier Services 2020-01-14T10:14:04.7123803Z Help : [Docs] 2020-01-14T10:14:04.7123872Z ============================================================================== 2020-01-14T10:14:04.9307472Z ##[debug]agent.TempDirectory=d:\a_temp 2020-01-14T10:14:04.9335185Z ##[debug]loading inputs and endpoints 2020-01-14T10:14:04.9342232Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN 2020-01-14T10:14:04.9353681Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION 2020-01-14T10:14:04.9357644Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION 2020-01-14T10:14:04.9359292Z ##[debug]loading INPUT_ALLOWCOVERAGEVARIANCE 2020-01-14T10:14:04.9360840Z ##[debug]loading INPUT_ALLOWWARNINGVARIANCE 2020-01-14T10:14:04.9373643Z ##[debug]loading INPUT_BASEBRANCHREF 2020-01-14T10:14:04.9375762Z ##[debug]loading INPUT_BASEDEFINITIONFILTER 2020-01-14T10:14:04.9377319Z ##[debug]loading INPUT_BUILDCONFIGURATION 2020-01-14T10:14:04.9378745Z ##[debug]loading INPUT_BUILDPLATFORM 2020-01-14T10:14:04.9380015Z ##[debug]loading INPUT_CHECKCOVERAGE 2020-01-14T10:14:04.9381277Z ##[debug]loading INPUT_CHECKWARNINGS 2020-01-14T10:14:04.9383582Z ##[debug]loading INPUT_COVERAGEDELTATYPE 2020-01-14T10:14:04.9385215Z ##[debug]loading INPUT_COVERAGEFAILOPTION 2020-01-14T10:14:04.9387766Z ##[debug]loading INPUT_COVERAGEPRECISION 2020-01-14T10:14:04.9389022Z ##[debug]loading INPUT_COVERAGETHRESHOLD 2020-01-14T10:14:04.9390381Z ##[debug]loading INPUT_COVERAGETYPE 2020-01-14T10:14:04.9391676Z ##[debug]loading INPUT_COVERAGEUPPERTHRESHOLD 2020-01-14T10:14:04.9394026Z ##[debug]loading INPUT_COVERAGEVARIANCE 2020-01-14T10:14:04.9396282Z ##[debug]loading INPUT_CREATEBUILDISSUES 2020-01-14T10:14:04.9398026Z ##[debug]loading INPUT_DISABLECERTCHECK 2020-01-14T10:14:04.9399627Z ##[debug]loading INPUT_EXPLICITFILTER 2020-01-14T10:14:04.9402403Z ##[debug]loading INPUT_FORCECOVERAGEIMPROVEMENT 2020-01-14T10:14:04.9404078Z ##[debug]loading INPUT_FORCEFEWERWARNINGS 2020-01-14T10:14:04.9405986Z ##[debug]loading INPUT_IGNOREDECREASEABOVEUPPERTHRESHOLD 2020-01-14T10:14:04.9407284Z ##[debug]loading INPUT_INCLUDEPARTIALLYSUCCEEDED 2020-01-14T10:14:04.9408784Z ##[debug]loading INPUT_INCLUSIVEFILTERING 2020-01-14T10:14:04.9411130Z ##[debug]loading INPUT_SHOWSTATISTICS 2020-01-14T10:14:04.9413738Z ##[debug]loading INPUT_WARNINGFAILOPTION 2020-01-14T10:14:04.9417252Z ##[debug]loading INPUT_WARNINGTASKFILTERS 2020-01-14T10:14:04.9418961Z ##[debug]loading INPUT_WARNINGTHRESHOLD 2020-01-14T10:14:04.9424292Z ##[debug]loading SECRET_CERTIFICATEPASSWORD 2020-01-14T10:14:04.9431358Z ##[debug]loaded 31 2020-01-14T10:14:04.9449226Z ##[debug]Agent.ProxyUrl=undefined 2020-01-14T10:14:04.9450584Z ##[debug]Agent.CAInfo=undefined 2020-01-14T10:14:04.9450846Z ##[debug]Agent.ClientCert=undefined 2020-01-14T10:14:04.9451045Z ##[debug]Agent.SkipCertValidation=undefined 2020-01-14T10:14:05.2024900Z ##[debug]createBuildIssues=true 2020-01-14T10:14:05.2031379Z ##[debug]check path : d:\a_tasks\BuildQualityChecks_16a2ad20-f191-11e5-bed4-ab22bcd17937\6.2.2\task.json 2020-01-14T10:14:05.2033356Z ##[debug]adding resource file: d:\a_tasks\BuildQualityChecks_16a2ad20-f191-11e5-bed4-ab22bcd17937\6.2.2\task.json 2020-01-14T10:14:05.2035570Z ##[debug]system.culture=en-US 2020-01-14T10:14:05.2071998Z ##[debug]check path : d:\a_tasks\BuildQualityChecks_16a2ad20-f191-11e5-bed4-ab22bcd17937\6.2.2\node_modules\nodeapihelpers\messages.json 2020-01-14T10:14:05.2072590Z ##[debug]adding resource file: d:\a_tasks\BuildQualityChecks_16a2ad20-f191-11e5-bed4-ab22bcd17937\6.2.2\node_modules\nodeapihelpers\messages.json 2020-01-14T10:14:05.2073001Z ##[debug]system.culture=en-US 2020-01-14T10:14:05.2083697Z ##[debug]disableCertCheck=false 2020-01-14T10:14:05.2084098Z ##[debug]BQC.LogRawData=undefined 2020-01-14T10:14:05.2084302Z ##[debug]BQC.ForceNewBaseline=false 2020-01-14T10:14:05.2084531Z ##[debug]BQC.ForceNewBaseline=false 2020-01-14T10:14:05.2089455Z SystemVssConnection exists true 2020-01-14T10:14:05.2089815Z ##[debug]SystemVssConnection exists true 2020-01-14T10:14:05.2091233Z ##[debug]System.TeamFoundationCollectionUri=https://dev.azure.com/**/ 2020-01-14T10:14:05.2124827Z ##[debug]Build.Repository.Provider=TfsGit 2020-01-14T10:14:05.2126996Z ##[debug]baseBranchRef=refs/heads/master 2020-01-14T10:14:05.2127254Z ##[debug]baseDefinitionId=null 2020-01-14T10:14:05.2127472Z ##[debug]System.DefinitionId=110 2020-01-14T10:14:05.2128982Z ##[debug]includePartiallySucceeded=true 2020-01-14T10:14:05.2133902Z ##[debug]System.TeamProject= 2020-01-14T10:14:05.2134190Z ##[debug]System.DefinitionId=110 2020-01-14T10:14:05.2134420Z ##[debug]Build.DefinitionVersion=16 2020-01-14T10:14:05.2134638Z ##[debug]Build.BuildId=10217 2020-01-14T10:14:05.2135241Z ##[debug]PSGer.Build.PollInterval=undefined 2020-01-14T10:14:05.2135777Z ##[debug]PSGer.Build.MaxWaitTime=undefined 2020-01-14T10:14:05.5561369Z ##[debug]System.PhaseDisplayName=Software 2020-01-14T10:14:05.5562654Z ##[debug]System.PhaseName=Phase_1 2020-01-14T10:14:05.5562934Z ##[debug]System.JobId=fd490c07-0b22-5182-fac9-6d67fe1e939b 2020-01-14T10:14:05.5563142Z ##[debug]System.JobDisplayName=Software 2020-01-14T10:14:05.5564737Z Using IdentifierJobResolver 2020-01-14T10:14:05.5568644Z ##[debug]getEnabledPolicies 2020-01-14T10:14:05.5570394Z ##[debug]checkWarnings=true 2020-01-14T10:14:05.5570683Z ##[debug] - warnings 2020-01-14T10:14:05.5572717Z ##[debug]checkCoverage=true 2020-01-14T10:14:05.5573049Z ##[debug] - coverage 2020-01-14T10:14:05.5574608Z ##[debug]getCurrentJobName 2020-01-14T10:14:05.5578463Z ##[debug]getCurrentJobName 2020-01-14T10:14:05.5579397Z ##[debug]runTitle=null 2020-01-14T10:14:05.5583208Z ##[debug]waitForPreviousBuildStepsToFinish 2020-01-14T10:14:05.5589806Z ##[debug]getPreviousBuildSteps 2020-01-14T10:14:05.8336666Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8337523Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8337758Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8337955Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8338107Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8338345Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8338498Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8338715Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8338936Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8339110Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8339304Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8339537Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8339687Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8339958Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8340108Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8340300Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8340488Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8340633Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8340821Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8341023Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8341177Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8341362Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8342047Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8342320Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8342565Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8342762Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8344090Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8344344Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8344639Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8365595Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8365884Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8366113Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8366350Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8366534Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8366691Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8366865Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8367194Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8367532Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.8379922Z Validating build warnings policy... 2020-01-14T10:14:05.8383797Z ##[debug]getBuildJobRecords 2020-01-14T10:14:05.9162862Z ##[debug]getCurrentJobId 2020-01-14T10:14:05.9168482Z ##[debug]showStatistics=true 2020-01-14T10:14:05.9170348Z ##[debug]warningTaskFilters=/^(((android|xcode|gradlew)\s+)?build|ant|maven|cmake|gulp)/i 2020-01-14T10:14:05.9173154Z ##[debug]WarningsAnalyzer.prepareRegexFilters 2020-01-14T10:14:05.9179479Z ##[debug]Valid regex filters: /^(((android|xcode|gradlew)\s+)?build|ant|maven|cmake|gulp)/i 2020-01-14T10:14:05.9179839Z ##[debug]warningFilters=null 2020-01-14T10:14:05.9180043Z ##[debug]WarningsAnalyzer.prepareRegexFilters 2020-01-14T10:14:05.9187823Z ##[debug]Valid regex filters: 2020-01-14T10:14:05.9204884Z ##[debug]Build.BuildId=10217 2020-01-14T10:14:05.9205305Z ##[debug]WarningsAnalyzer.analyzeWarnings 2020-01-14T10:14:05.9207310Z ##[debug]WarningsAnalyzer.getRelevantTaskRecordsFromTimeline 2020-01-14T10:14:05.9209457Z Counting warnings from tasks: 2020-01-14T10:14:05.9209652Z - Build solution 2020-01-14T10:14:05.9212765Z ##[debug]WarningsAnalyzer.runLogFileAnalysis 2020-01-14T10:14:05.9217051Z ##[debug]inclusiveFiltering=false 2020-01-14T10:14:05.9221429Z - Running MSBuild log analysis... 2020-01-14T10:14:05.9226905Z ##[debug]getTimelineLogLines 2020-01-14T10:14:06.0209760Z - Total warnings: 0, Filtered warnings: 0 2020-01-14T10:14:06.0211195Z Total warnings: 0 2020-01-14T10:14:06.0213025Z Filtered warnings: 0 2020-01-14T10:14:06.0216196Z ##[debug]warningFailOption=build 2020-01-14T10:14:06.0231958Z ##[debug]NewBaselineRule.evaluateRuleCore 2020-01-14T10:14:06.0304378Z ##[debug]CompareToBaselineWarningsRule.evaluateRuleCore 2020-01-14T10:14:06.0304962Z ##[debug]CompareToBaselineWarningsRule.getWarningsAnalysisFromBaselineBuild 2020-01-14T10:14:06.0305225Z ##[debug]getBaselineBuildId 2020-01-14T10:14:06.0305467Z ##[debug]getBaselineBuild 2020-01-14T10:14:06.0306203Z ##[debug]getCurrentJobStartTime 2020-01-14T10:14:06.5843211Z [WARNING] The baseline build could not be found. All policies based on the previous build will pass. 2020-01-14T10:14:06.5843899Z ##[warning]The baseline build could not be found. All policies based on the previous build will pass. 2020-01-14T10:14:06.5844263Z ##[debug]Processed: ##vso[task.logissue type=warning;]The baseline build could not be found. All policies based on the previous build will pass. 2020-01-14T10:14:06.5844650Z ##[debug]CompareToBaselineWarningsRule.preparePostRules 2020-01-14T10:14:06.5847297Z ##[debug]forceFewerWarnings=false 2020-01-14T10:14:06.5858659Z ##[debug]NotBelowBaselineWarningsRule.evaluateRuleCore 2020-01-14T10:14:06.5873795Z Cannot read property 'filteredWarnings' of null 2020-01-14T10:14:06.5874137Z [ERROR] Cannot read property 'filteredWarnings' of null 2020-01-14T10:14:06.5874517Z ##[error]Cannot read property 'filteredWarnings' of null 2020-01-14T10:14:06.5874748Z ##[debug]Processed: ##vso[task.logissue type=error;]Cannot read property 'filteredWarnings' of null 2020-01-14T10:14:06.5876490Z ##[debug]setTaskResult 2020-01-14T10:14:06.5877702Z ##[debug]Build.SourcesDirectory=d:\a\1\s 2020-01-14T10:14:06.5888860Z ##[debug]Processed: ##vso[task.addattachment type=Distributedtask.Core.Summary;name=Build Quality Checks;]d:\a\1\s\BuildQualityChecksSummary.md 2020-01-14T10:14:06.5889879Z ##[debug]task result: Failed 2020-01-14T10:14:06.5891491Z ##[error]At least one build quality policy was violated. See Build Quality Checks section for more details. 2020-01-14T10:14:06.5891669Z ##[debug]Processed: ##vso[task.issue type=error;]At least one build quality policy was violated. See Build Quality Checks section for more details. 2020-01-14T10:14:06.5892754Z ##[debug]Processed: ##vso[task.complete result=Failed;]At least one build quality policy was violated. See Build Quality Checks section for more details. 2020-01-14T10:14:06.5984531Z ##[section]Finishing: Check build quality

ReneSchumacher commented 4 years ago

Hi @doormalena,

thanks for reporting this. The issue is already fixed and an updated version will be published today.

René

doormalena commented 4 years ago

Thank you René. Is this fix also fixing the following error? We just saw this one popping up as well in our pipeline.

[ERROR] Cannot read property 'getAnalysis' of undefined

ReneSchumacher commented 4 years ago

Yes, it will fix that issue as well.

ReneSchumacher commented 4 years ago

Hey @doormalena,

the errors are now fixed with version 6.2.3 of the task. Please let me know if you see additional problems.

René

doormalena commented 4 years ago

Cannot read property 'getAnalysis' of undefined is still applicable in 6.2.3. The other one we're verifying now.

image

ReneSchumacher commented 4 years ago

Hmpf. I missed the combination with the ForceNewBaseline parameter. Sorry about that. I'm fixing this right away.

doormalena commented 4 years ago

Right... that is just plain luck (or dumb luck depending on your viewpoint) for finding this. We will verify it also without the override turned on. Thanks.

doormalena commented 4 years ago

Its also occurring without the override turned on. Is there a relation with the fact that there is simply no baseline available?

image

ReneSchumacher commented 4 years ago

Issue is fixed, the new version will be out in a couple minutes.