yonahd / kor

A Golang Tool to discover unused Kubernetes Resources
MIT License
974 stars 91 forks source link

feat: Deduplicate exceptions workflow #332

Closed doronkg closed 2 months ago

doronkg commented 2 months ago

What this PR does / why we need it?

This PR removes exception duplications found in JSONs under pkg/kor/exceptions. In addition, it enhances the CI workflow to discover exceptions and dedup them.

Examples:

$ make validate-exception-duplications
The following JSON files contain duplications:
        pkg/kor/exceptions/clusterroles/clusterroles.json
        pkg/kor/exceptions/storageclasses/storageclasses.json
        pkg/kor/exceptions/configmaps/configmaps.json
        pkg/kor/exceptions/crds/crds.json
Run the following command to deduplicate all files recursively: make dedup-exception-files

PR Checklist

GitHub Issue

Closes #309

Notes for your reviewers

Renamed exceptions-json-sort.yml to validate-exception-jsons to be more generic for future related actions.

codecov-commenter commented 2 months ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 42.39%. Comparing base (01ce4a6) to head (4997aa0).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #332 +/- ## ======================================= Coverage 42.39% 42.39% ======================================= Files 61 61 Lines 3236 3236 ======================================= Hits 1372 1372 Misses 1644 1644 Partials 220 220 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

yonahd commented 2 months ago

Lgtm