Skip to content

Commit ed73a79

Browse files
committed
fix: address review comment
1 parent feb2129 commit ed73a79

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

sync-team/src/github/tests/test_utils.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,15 @@ impl GithubRead for GithubMock {
624624

625625
fn repo_rulesets(
626626
&self,
627-
_org: &str,
628-
_repo: &str,
627+
org: &str,
628+
repo: &str,
629629
) -> anyhow::Result<Vec<crate::github::api::Ruleset>> {
630-
// Return empty list for tests - rulesets not used in mock tests yet
631-
Ok(Vec::new())
630+
Ok(self
631+
.get_org(org)
632+
.rulesets
633+
.get(repo)
634+
.cloned()
635+
.unwrap_or_default())
632636
}
633637

634638
fn repo_environments(
@@ -660,6 +664,8 @@ struct GithubOrg {
660664
repo_members: HashMap<String, RepoMembers>,
661665
// Repo name -> Vec<(protection ID, branch protection)>
662666
branch_protections: HashMap<String, Vec<(String, BranchProtection)>>,
667+
// Repo name -> Vec<ruleset>
668+
rulesets: HashMap<String, Vec<crate::github::api::Ruleset>>,
663669
// Repo name -> HashMap<env name, environment>
664670
repo_environments: HashMap<String, HashMap<String, Environment>>,
665671
}

0 commit comments

Comments
 (0)