dzunke/panaly-codeowners

A Panaly plugin that makes it able to write paths from a CODEOWNERS file to metrics

dev-main 2024-08-13 18:01 UTC

This package is auto-updated.

Last update: 2024-11-13 18:39:47 UTC


README

The plugin to the Panaly Project Analyzer can be utilized to enable metrics which are supporting paths receiving them from a CODEOWNERS file.

Example Configuration

# panaly.dist.yaml
plugins:
    DZunke\PanalyCodeOwners\CodeOwnersPlugin:
        codeowners: CODEOWNERS
        exclude_directories: [ 'vendor' ]
        replace:
            -   metric: filesystem.file_count
                type: relative
                write: paths
                option: paths
                owners: [ '@Hulk', '@DrStrange' ]

groups:
    ownership:
        title: "Information around the Project Ownership"
        metrics:
            unowned_directories: ~
            owned_files_count:
                owners: [ '@my_owner_group' ]
            owned_files_list:
                owners: [ '@my_owner_group' ]
            owned_directories_count:
                owners: [ '@my_owner_group', '@another_owner_group' ]
            owned_directories_list:
                owners: [ '@my_owner_group', '@another_owner_group' ]

Options for single metric replacement

Available Metrics

Unowned Directories

The directory count with the name unowned_directories gives an Table result with a listing of all unowned directories. Beware that the list can be very long. There are no options available. The CODEOWNER file from the plugin options is utilized.

Owned Files Count

The file count with the name owned_files_count gives an IntegerValue result with a summarization of all owned files of specific owners. The owners option has to be given to let the metric work correct, otherwise it will return a zero value.

Owned Files Listing

The file count with the name owned_files_list gives an Table result with a listing of all owned files with relative path of specific owners. The owners option has to be given to let the metric work correct, otherwise it will return an empty list.

Owned Directories Count

The directory count with the name owned_directories_count gives an IntegerValue result with a summarization of all owned directories of specific owners. The owners option has to be given to let the metric work correct, otherwise it will return a zero value.

Owned Directory Listing

The file count with the name owned_directories_list gives an Table result with a listing of all owned directories with relative path of specific owners. The owners option has to be given to let the metric work correct, otherwise it will return an empty list.

Known Problems

  • There is no general specification for the CODEOWNERS file, so currently just the Github specification is supported

Thanks and License

Panaly Project Analyzer - CODEOWNERS Plugin © 2024+, Denis Zunke. Released utilizing the MIT License.

GitHub @dzunke  ·  Twitter @DZunke