Skip to content

Commit

Permalink
Cache the project name instead of its fullname
Browse files Browse the repository at this point in the history
Fixes: #1234

Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Nov 5, 2024
1 parent f4531d4 commit 62a8d82
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog.d/1234.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cache the project name instead of its fullname
2 changes: 1 addition & 1 deletion fmn/rules/tracking_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(), ())
Expand Down
8 changes: 4 additions & 4 deletions tests/rules/tracking_rules/test_artifacts_group_owned.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
)

0 comments on commit 62a8d82

Please sign in to comment.