Skip to content

Commit 63348fa

Browse files
Address AI feedback
Signed-off-by: Lukasz Gryglicki <[email protected]> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
1 parent e108a97 commit 63348fa

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

COMMIT_AUTHORS_CACHING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
---
1515

1616
## Caching
17-
- **Co-authors cache key** are cached based on their commit traile's (`Co-authored-by:`) normalized email and name.
17+
- **Co-author cache keys** are based on normalized email and name from the commit trailers (`Co-authored-by:`).
1818
- **General cache key**: `(author_id, lower(login), lower(email)) → (user | None)`
1919
- **Per-project cache key**: `(project_id, author_id, lower(login), lower(email)) → (user | None, authorized, affiliated)`
2020
- **TTL policy**: positives **~12h** (**~3h** for per-project with signature status); negative/uncertain states use **Negative TTL = 3m**.
2121
- **Flow**: per-project cache → general cache → cold DB path. Results are stored back with the appropriate TTL.
2222
- **When signature is signed**: per-project and general caches are updated to reflect the new status (general cache is updated because given user could have no DynamoDB entry yet before signing the CLA).
23-
- There are /v2/clear-cache and /v4/clear-cache endpoints to clear the caches (for testing and operational purposes).
2423
- Thread-safe with periodic expired entries cleanup (once per hour).
24+
- There are `/v2/clear-cache` and `/v4/clear-cache` endpoints to clear caches (testing & ops).
2525

2626
---
2727

cla-backend-go/github/github_repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ func init() {
370370
// ClearCaches clears all in-memory caches maintained by the GitHub module.
371371
func ClearCaches() {
372372
f := logrus.Fields{
373-
"functionName": "github.github_repository.ClearAllCaches",
373+
"functionName": "github.github_repository.ClearCaches",
374374
}
375375
GithubUserCache.Clear()
376376
ModelUserCache.Clear()

cla-backend/cla/models/github_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ def run():
9090

9191
start_cache_cleanup()
9292

93-
def clear_all_caches():
93+
def clear_caches():
9494
"""
9595
Clears in-memory caches maintained by this module.
9696
"""
97-
fn = "cla.models.github_models.clear_all_caches"
97+
fn = "cla.models.github_models.clear_caches"
9898
try:
9999
github_user_cache.clear()
100100
cla.log.info(f"{fn} - cleared github_user_cache")

cla-backend/cla/routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from cla.controllers.github_activity import v4_easycla_github_activity
3030
from cla.controllers.project_cla_group import get_project_cla_group
3131
from cla.models.dynamo_models import Repository, Gerrit
32-
from cla.models.github_models import clear_all_caches
32+
from cla.models.github_models import clear_caches
3333
from cla.project_service import ProjectService
3434
from cla.utils import (
3535
get_supported_repository_providers,
@@ -1888,7 +1888,7 @@ def clear_cache(auth_user: check_auth):
18881888
Clears in-memory caches used by the Python GitHub layer and returns
18891889
before/after sizes for basic observability.
18901890
"""
1891-
return clear_all_caches()
1891+
return clear_caches()
18921892

18931893
@hug.post("/events", versions=1)
18941894
def create_event(

0 commit comments

Comments
 (0)