microsoft / PR-Metrics

A GitHub Action & Azure Pipelines task for augmenting pull request titles to let reviewers quickly determine PR size and test coverage.
https://github.com/microsoft/Omex
MIT License
58 stars 11 forks source link

Changes are not detected - Invalid metrics #185

Closed marionzr closed 2 years ago

marionzr commented 2 years ago

Not sure if there is another hidden settings I should set, but I'm not able to the a report from the tool. What I did:

  1. Installed the tool via Markeplace
  2. Created 2 new pipeline, one using YAML and another using Classic, both using the default settings
  3. Created a file with cs extension with lots of lines. PR was marked as x-small without any additional metric
  4. Merged that PR and opened another one with 291 lines added (see screenshots below), and got the same results
  5. Setting the system.debug to true, I was able to see this output ##[debug]Test File: test.cs (0 lines) which seems wrong

image image

    Adjusting the test factor input to '1'.
    ##[debug]FileMatchingPatterns=undefined
    ##[debug]* Inputs.initializeFileMatchingPatterns()
    Adjusting the file matching patterns input to '["**/*","!**/package-lock.json"]'.
    ##[debug]CodeFileExtensions=undefined
    ##[debug]* Inputs.initializeCodeFileExtensions()
    Adjusting the code file extensions input to '["js","_js","bones","cjs","es","es6","frag","gs","jake","jsb","jscad","jsfl","jsm","jss","jsx","mjs","njs","pac","sjs","ssjs","xsjs","xsjslib","epj","erb","py","cgi","fcgi","gyp","gypi","lmi","py3","pyde","pyi","pyp","pyt","pyw","rpy","smk","spec","tac","wsgi","xpy","pyx","pxd","pxi","eb","numpy","numpyw","numsc","pytb","java","jsp","ts","tsx","cs","cake","csx","linq","php","aw","ctp","fcgi","inc","php3","php4","php5","phps","phpt","cpp","c++","cc","cp","cxx","h","h++","hh","hpp","hxx","inc","inl","ino","ipp","re","tcc","tpp","c","cats","h","idc","cl","opencl","upc","xbm","xpm","pm","sh","bash","bats","cgi","command","env","fcgi","ksh","tmux","tool","zsh","fish","ebuild","eclass","ps1","psd1","psm1","tcsh","csh","rb","builder","eye","fcgi","gemspec","god","jbuilder","mspec","pluginspec","podspec","prawn","rabl","rake","rbi","rbuild","rbw","rbx","ru","ruby","spec","thor","watchr"]'.
    ##[debug]patternRoot: 'undefined'
    ##[debug]matchOptions.debug: 'false'
    ##[debug]matchOptions.nobrace: 'true'
    ##[debug]matchOptions.noglobstar: 'false'
    ##[debug]matchOptions.dot: 'true'
    ##[debug]matchOptions.noext: 'false'
    ##[debug]matchOptions.nocase: 'true'
    ##[debug]matchOptions.nonull: 'false'
    ##[debug]matchOptions.matchBase: 'false'
    ##[debug]matchOptions.nocomment: 'false'
    ##[debug]matchOptions.nonegate: 'false'
    ##[debug]matchOptions.flipNegate: 'false'
    ##[debug]pattern: '**/*'
    ##[debug]applying include pattern against original list
    ##[debug]1 matches
    ##[debug]pattern: '!**/package-lock.json'
    ##[debug]trimmed leading '!'. pattern: '**/package-lock.json'
    ##[debug]applying exclude pattern against original list
    ##[debug]0 matches
    ##[debug]1 final results
    ##[debug]* CodeMetrics.matchFileExtension()
    ##[debug]* Inputs.codeFileExtensions
    ##[debug]* Inputs.initialize()
    ##[debug]File name 'test.cs' has extension 'cs', which is included.
    ##[debug]* CodeMetrics.constructMetrics()
    ##[debug]Test File: test.cs (0 lines)
    ##[debug]* CodeMetrics.initializeIsSufficientlyTested()
    ##[debug]* Inputs.testFactor
    ##[debug]* Inputs.initialize()
    ##[debug]* Inputs.testFactor
    ##[debug]* Inputs.initialize()
    ##[debug]* CodeMetrics.initializeSizeIndicator()
    ##[debug]* CodeMetrics.calculateSize()
    ##[debug]* Inputs.baseSize
    ##[debug]* Inputs.initialize()
    ##[debug]* CodeMetrics.getDeletedFilesNotRequiringReview()

Kindly regards

muiriswoulfe commented 2 years ago

Hi @marionzr,

Sorry to hear you're encountering issues with the tool. I can't see anything obvious from your description or from the logs that indicates what is going wrong. I believe the key piece of information I need here is the output from Git, as the tool works by parsing the Git output to see what files have been changed. It looks like, for some reason, that Git is indicating that zero lines have changed within the file.

Could you provide the full debug log output and I'll look through it in detail?

muiriswoulfe commented 2 years ago

Hi @marionzr,

I haven't heard back in 1 month, and I don't have sufficient details to assist further. I'm closing this issue, but you can reopen it if it persists. Thanks for using PR Metrics!