codeowners-validator icon indicating copy to clipboard operation
codeowners-validator copied to clipboard

Release v1

Open mszostok opened this issue 3 years ago • 0 comments

Description

This tool was created a long time ago, and I already got a lot of feedback.

I plan to release the v1 once:

  • All bugs will be fixed

  • Such enhancements:

    • New checks:
      • https://github.com/mszostok/codeowners-validator/issues/94
      • #117
    • UX:
      • https://github.com/mszostok/codeowners-validator/issues/16 && https://github.com/mszostok/codeowners-validator/issues/73 This is important as this will change the way how validator is configured. It will give users a lot of freedom for customization ( with sensible defaults). Here we will move away from environment variables, and instead we will introduce support for YAML files configuration. Format is not yet defined, but to give you the overall idea, see:
        # config.yaml
        
        # all available settings of specific linters
        checks-settings:
        
          owner:
            # The owner and repository name separated by slash. Used to check if GitHub owner is in the given organization.
            # (required)
            repository: "gh-codeowners/codeowners-samples"
        
            # Excluding configuration
            exclude-rules: # support excluded only for some users so outside collaborators are not check but the rest are validated
        
              # excluded for all as no owners provided
              - rule: valid-definition
              - rule: has-github-account
              - rule: team-exists
        
        
              # excluded only for a given owners
              - rule: is-in-organization
                owners:
                  - @owner1
                  - @owner2
                  - @owner3
        
      • https://github.com/mszostok/codeowners-validator/issues/50. In general, documentation will be moved to a dedicated website with more readable interface.
      • https://github.com/mszostok/codeowners-validator/issues/61

    Other:

    • #49 to ensure no regression on v1.
    • add benchmarks and ensure no regression on execution time.

Additionally, I would like to:

  • add an option to format CODEOWNERS files.
  • and an option to add/remove a given owner from CODEOWNERS files and create related PRs automatically. For example, with such (draft) config:
    updateRepositories:
      - path: "/tmp/cloned/repository" # local repository
      - url: "org/repo" # clone to temp dir
      - url: "org/other-repo" # clone to temp dir
      - url: "org/*" # maybe in the next version add pattern support?
    
    insert:
      - owners: [ "@hakuna", "@matata" ]
        condition:
          pattern: "*.go"
      - owners: [ "@baz", "@bar" ]
        condition:
          associatedWithOwner: "@ghost"
    
    pullRequest:
      titleFormat: "Add {{ .NewOwner }} as a code owner in {{ .RepoName }}"
    
    Pull requests will be created in dedicated repositories.

As a result, maybe this project will be changed to codeowners-manager or simply codeowners as the spectrum of responsibilities will be much wider:

  • codeowners fmt
  • codeowners validate
  • codeowners add # across repositories
  • codeowners remove # across repositories
  • codeowners fix

mszostok avatar Feb 11 '22 19:02 mszostok