department-of-veterans-affairs / codeql-tools

MIT License
4 stars 2 forks source link

Enablement dashboard not mapping languages correctly #53

Closed mcondellva closed 1 year ago

mcondellva commented 1 year ago

The enablement dashboard is listing languages that should be mapped (e.g, typescript, kotlin) as missing analyses and databases in the table, leading to incorrect metrics being reported.

It appears to be an issue in collect-metrics/internal/github_utils.go, the MapLanguages function on line 36. language needs to be made lower case for the switch to behave correctly.

arilivigni commented 1 year ago

@mcondellva are you saying it should be

switch strings.ToLower(language) {

instead of

switch language {

For the switch to work properly?

mcondellva commented 1 year ago

Yes. The languages from the GH API are capitalized (e.g. TypeScript) so the mapping is not working correctly.

This would mimic what's being done in the other tools (see verify-scans) when mapping languages.

arilivigni commented 1 year ago

@mcondellva FYI https://github.com/department-of-veterans-affairs/codeql-tools/pull/54

lindluni commented 1 year ago

Thank you @arilivigni! I merged the change. I will check tomorrow to make sure all looks good

mcondellva commented 1 year ago

Thanks for the change, however the metrics dashboard still appears to be mishandling at least typescript and kotlin. If you see, for example the repos bio-bis-source, bip-archetype-ui-mfe-app, cds-hooks-client-api, they appear to be compliant except for the missing analysis/missing database columns which only list either typescript or kotlin.

lindluni commented 1 year ago

Hey @mcondellva

Thanks for letting me know, I see this, and now that I'm back to my computer I know why this is happening since I can actually look at code. I will get this mapped properly

Boberski commented 1 year ago

FYI, fully enabled percent is and has been reported for the last number of weeks, weekly to CISO. Have hit seemingly hit ceiling at 6% in absence of adjusted numbers, for last number of weeks.

lindluni commented 1 year ago

Pushed the changes: https://github.com/department-of-veterans-affairs/codeql-tools/commit/9a89ee2b2be872d7435afffaeb5b93a47a718947

Running the tests against it now, will have results within the hour

lindluni commented 1 year ago

This is correct now, the language needed to mapped on both the expectedLanguages side and the foundLanguages side.