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§
Sourcefn sync(
&self,
repo_root: &Path,
projects: &[ProjectOwners],
dry_run: bool,
) -> Result<SyncResult>
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 repositoryprojects- List of projects with their ownership configurationsdry_run- If true, don’t write files, just report what would happen
§Errors
Returns an error if file operations fail or configuration is invalid.