Skip to content

Commit f69e377

Browse files
committed
chore: add comments to typo in sourceId
1 parent d2b6984 commit f69e377

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

services/apps/git_integration/src/crowdgit/services/commit/commit_service.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class CommitService(BaseService):
4949
_GIT_PLATFORM = "git"
5050
_USERNAME_TYPE = "username"
5151
_EMAIL_TYPE = "email"
52-
_COMMITTED_COMMIT_SUFFIX = "commited-commit"
5352

5453
MAX_CHUNK_SIZE = 250
5554

@@ -517,8 +516,10 @@ def create_activities_from_commit(
517516

518517
# Only create committer activity if author and committer are different
519518
if author_name != committer_name or author_email != committer_email:
520-
# Pre-calculate hash components to avoid repeated string operations
521-
hash_input = f"{commit_hash}{CommitService._COMMITTED_COMMIT_SUFFIX}{committer_email}"
519+
# IMPORTANT: hash_input has a typo in "commited" instead of "committed"
520+
# however fixing it requires recalculating sourceId/parentSourceId for ALL git activities in db
521+
# so far the typo doesn't have any major effect, since the activity type "committed-commit" is correct
522+
hash_input = f"{commit_hash}commited-commit{committer_email}"
522523
committer_source_id = hashlib.sha1(hash_input.encode("utf-8")).hexdigest()
523524

524525
committer = {

0 commit comments

Comments
 (0)