MicrosoftPremier / VstsExtensions

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

[BQC] Error with 6.4.3 ("Cannot read property 'length' of undefined") #82

Closed gartenriese2 closed 4 years ago

gartenriese2 commented 4 years ago

Hi,

after updating BQC from 6.4.2 to 6.4.3, we get an error in the task:

2020-03-04T10:05:27.6309890Z ##[section]Starting: Check build quality 2020-03-04T10:05:27.6409738Z ============================================================================== 2020-03-04T10:05:27.6410354Z Task : Build Quality Checks 2020-03-04T10:05:27.6410861Z Description : Breaks a build based on quality metrics like number of warnings or code coverage. 2020-03-04T10:05:27.6411335Z Version : 6.4.3 2020-03-04T10:05:27.6411781Z Author : Microsoft Premier Services 2020-03-04T10:05:27.6412309Z Help : [Docs] 2020-03-04T10:05:27.6412892Z ============================================================================== 2020-03-04T10:05:28.3724224Z The current agent supports custom CA certificates through the NODE_EXTRA_CA_CERTS variable. Please use this variable instead of disabling the certificate check! 2020-03-04T10:05:28.3729481Z [WARNING] The current agent supports custom CA certificates through the NODE_EXTRA_CA_CERTS variable. Please use this variable instead of disabling the certificate check! 2020-03-04T10:05:28.3787712Z ##[warning]The current agent supports custom CA certificates through the NODE_EXTRA_CA_CERTS variable. Please use this variable instead of disabling the certificate check! 2020-03-04T10:05:28.3799851Z SystemVssConnection exists true 2020-03-04T10:05:28.5081381Z Using LegacyJobResolver 2020-03-04T10:05:28.5102008Z Cannot read property 'length' of undefined 2020-03-04T10:05:28.5102665Z [ERROR] Cannot read property 'length' of undefined 2020-03-04T10:05:28.5103738Z ##[error]Cannot read property 'length' of undefined 2020-03-04T10:05:28.5205499Z ##[error]At least one build quality policy was violated. See Build Quality Checks section for more details. 2020-03-04T10:05:28.5321993Z ##[section]Finishing: Check build quality

With 6.4.2 everything was fine:

2020-03-03T15:01:50.0780797Z ##[section]Starting: Check build quality 2020-03-03T15:01:50.0790856Z ============================================================================== 2020-03-03T15:01:50.0791281Z Task : Build Quality Checks 2020-03-03T15:01:50.0810543Z Description : Breaks a build based on quality metrics like number of warnings or code coverage. 2020-03-03T15:01:50.0811167Z Version : 6.4.2 2020-03-03T15:01:50.0811461Z Author : Microsoft Premier Services 2020-03-03T15:01:50.0811919Z Help : [Docs] 2020-03-03T15:01:50.0812820Z ============================================================================== 2020-03-03T15:01:50.8012825Z The current agent supports custom CA certificates through the NODE_EXTRA_CA_CERTS variable. Please use this variable instead of disabling the certificate check! 2020-03-03T15:01:50.8016751Z [WARNING] The current agent supports custom CA certificates through the NODE_EXTRA_CA_CERTS variable. Please use this variable instead of disabling the certificate check! 2020-03-03T15:01:50.8073518Z ##[warning]The current agent supports custom CA certificates through the NODE_EXTRA_CA_CERTS variable. Please use this variable instead of disabling the certificate check! 2020-03-03T15:01:50.8084893Z SystemVssConnection exists true 2020-03-03T15:01:50.9344461Z Using LegacyJobResolver 2020-03-03T15:01:50.9704067Z Validating build warnings policy... 2020-03-03T15:01:50.9985823Z Running task warnings analysis... 2020-03-03T15:01:50.9986734Z Counting warnings from tasks: 2020-03-03T15:01:50.9987838Z - Build solution ****.sln 2020-03-03T15:01:51.0752688Z Running MSBuild task log analysis... 2020-03-03T15:01:51.0839788Z Total warnings: 0, Filtered warnings: 0 2020-03-03T15:01:51.0841391Z Overall total warnings: 0 2020-03-03T15:01:51.0841811Z Overall filtered warnings: 0 2020-03-03T15:01:51.0864125Z [SUCCESS] Warnings policy passed with 0 warning(s). 2020-03-03T15:01:51.1457484Z Found baseline build with ID 3083. 2020-03-03T15:01:51.2245545Z Running task warnings analysis... 2020-03-03T15:01:51.2246365Z Counting warnings from tasks: 2020-03-03T15:01:51.2246846Z - Build solution ****.sln 2020-03-03T15:01:51.2941282Z Running MSBuild task log analysis... 2020-03-03T15:01:51.2976265Z Total warnings: 0, Filtered warnings: 0 2020-03-03T15:01:51.2977128Z - Check build quality 2020-03-03T15:01:51.3300288Z Running generic task log analysis... 2020-03-03T15:01:51.3309866Z Total warnings: 1, Filtered warnings: 1 2020-03-03T15:01:51.3414676Z Validating code coverage policy... 2020-03-03T15:01:53.5241524Z Waiting for code coverage data... 2020-03-03T15:01:55.6013103Z Waiting for code coverage data... 2020-03-03T15:01:57.6780065Z Waiting for code coverage data... 2020-03-03T15:01:59.7408476Z Waiting for code coverage data... 2020-03-03T15:02:01.8156795Z Successfully read code coverage data from build. 2020-03-03T15:02:01.8172059Z Evaluating coverage data from 1 filtered code coverage data sets... 2020-03-03T15:02:01.8179604Z Total blocks: 25115 2020-03-03T15:02:01.8180109Z Covered blocks: 18535 2020-03-03T15:02:01.8180533Z Code Coverage (%): 73.8005 2020-03-03T15:02:01.8195801Z [SUCCESS] Code coverage policy passed with 73.8005% (18535/25115 blocks). 2020-03-03T15:02:01.8618466Z ##[section]Finishing: Check build quality

Is is possible to downgrade the task to 6.4.2?

ReneSchumacher commented 4 years ago

Can you tell me on what version of Team Foundation Server or Azure DevOps Server you're running? I assume this is on-prem since this issue can only be caused by the predefined variable System.CollectionUri being undefined. I was quite sure that this variable is available on-prem as well.

If you are indeed on-prem and still have the old VSIX file for v6.4.2 you can simply uninstall the extension and reinstall the old version. However, I'll try to fix the issue tonight so you should quickly have a fixed version.

ReneSchumacher commented 4 years ago

Hi @gartenriese2,

we're just releasing v6.4.4 of the task which should fix your issue. Let me know if this helps in your case. Otherwise, please provide more detailed information about your environment.

Thanks, René

gartenriese2 commented 4 years ago

@ReneSchumacher

Sorry, somehow I did not get any notification from GitHub, otherwise I would have answered earlier. We are using an on-premise TFS 2017. With v6.4.4 everything works as expected. Thank you very much for the quick fix!