diff --git a/changelog.d/1234.fixed b/changelog.d/1234.fixed new file mode 100644 index 000000000..4ba99a5f7 --- /dev/null +++ b/changelog.d/1234.fixed @@ -0,0 +1 @@ +Cache the project name instead of its fullname diff --git a/fmn/rules/tracking_rules.py b/fmn/rules/tracking_rules.py index 2c8661772..2c003e46e 100644 --- a/fmn/rules/tracking_rules.py +++ b/fmn/rules/tracking_rules.py @@ -83,7 +83,7 @@ async def prime_cache(self, cache): for role in PagureRole.GROUP_ROLES_MAINTAINER_SET: for artifact_type in ArtifactType: getattr(cache, artifact_type.name).update( - p["fullname"] + p["name"] for p in owned if p["namespace"] == artifact_type.value and group in p["access_groups"].get(role.name.lower(), ()) diff --git a/tests/rules/tracking_rules/test_artifacts_group_owned.py b/tests/rules/tracking_rules/test_artifacts_group_owned.py index d5db6ddc4..253760912 100644 --- a/tests/rules/tracking_rules/test_artifacts_group_owned.py +++ b/tests/rules/tracking_rules/test_artifacts_group_owned.py @@ -29,8 +29,8 @@ async def test_artifacts_group_owned_cache(requester, cache): tr = ArtifactsGroupOwned(requester, ["group1"], owner="testuser") await tr.prime_cache(cache) assert cache == Tracked( - packages=set(["rpms/rpms-1", "rpms/rpms-2"]), - containers=set(["containers/containers-1", "containers/containers-2"]), - modules=set(["modules/modules-1", "modules/modules-2"]), - flatpaks=set(["flatpaks/flatpaks-1", "flatpaks/flatpaks-2"]), + packages=set(["rpms-1", "rpms-2"]), + containers=set(["containers-1", "containers-2"]), + modules=set(["modules-1", "modules-2"]), + flatpaks=set(["flatpaks-1", "flatpaks-2"]), )