CodeownersProvider

Trait CodeownersProvider 

Source
pub trait CodeownersProvider: Send + Sync {
    // Required methods
    fn platform(&self) -> Platform;
    fn sync(
        &self,
        repo_root: &Path,
        projects: &[ProjectOwners],
        dry_run: bool,
    ) -> Result<SyncResult>;
    fn check(
        &self,
        repo_root: &Path,
        projects: &[ProjectOwners],
    ) -> Result<CheckResult>;
}
Expand description

Trait for CODEOWNERS sync providers.

Each platform (GitHub, GitLab, Bitbucket) implements this trait to provide platform-specific sync behavior.

Required Methods§

Source

fn platform(&self) -> Platform

Get the platform type.

Source

fn sync( &self, repo_root: &Path, projects: &[ProjectOwners], dry_run: bool, ) -> Result<SyncResult>

Sync CODEOWNERS from project configurations.

Aggregates ownership rules from all projects and writes the appropriate CODEOWNERS file(s) for this platform.

§Arguments
  • repo_root - Root directory of the repository
  • projects - List of projects with their ownership configurations
  • dry_run - If true, don’t write files, just report what would happen
§Errors

Returns an error if file operations fail or configuration is invalid.

Source

fn check( &self, repo_root: &Path, projects: &[ProjectOwners], ) -> Result<CheckResult>

Check if CODEOWNERS is in sync with configuration.

§Arguments
  • repo_root - Root directory of the repository
  • projects - List of projects with their ownership configurations
§Errors

Returns an error if file operations fail or configuration is invalid.

Implementors§