Conversation
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Pull request overview
This PR introduces a re-onboarding counter mechanism to track how many times a repository has been re-onboarded, enabling the identification of unreachable commits through activity cycle tagging.
Key Changes
- Added
reOnboardingCountdatabase column with default value of 0 to track re-onboarding events - Enhanced activity processing to tag commits from re-onboarding cycles with
activity.attributes.cyclepattern - Implemented automatic counter increment when repositories require re-onboarding
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/src/database/migrations/V1765185575__addReOnboardingCountToGitRepos.sql | Adds reOnboardingCount INTEGER column with default 0 to git.repositories table |
| backend/src/database/migrations/U1765185575__addReOnboardingCountToGitRepos.sql | Undo migration file for reverting the schema change (currently empty - needs implementation) |
| services/apps/git_integration/src/crowdgit/models/repository.py | Adds re_onboarding_count field to Repository model and maps database field to Python field |
| services/apps/git_integration/src/crowdgit/database/crud.py | Updates SELECT queries to include reOnboardingCount, adds increase_re_onboarding_count function |
| services/apps/git_integration/src/crowdgit/worker/repository_worker.py | Calls increase_re_onboarding_count when re-onboarding is required |
| services/apps/git_integration/src/crowdgit/services/commit/commit_service.py | Propagates re_onboarding_count through activity creation, sets cycle attribute when count > 0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| description="Indicates if the stuck repository is resolved by a re-onboarding", | ||
| ) | ||
| re_onboarding_count: int = Field( | ||
| ..., |
There was a problem hiding this comment.
The re_onboarding_count field is marked as required (...) but should have a default value of 0 to be consistent with the database schema. This will cause issues when creating Repository instances without providing this value. Change to:
re_onboarding_count: int = Field(
default=0,
description="Tracks the number of times this repository has been re-onboarded. Used to identify unreachable commits via activity.attributes.cycle matching pattern onboarding-{reOnboardingCount}",
)| ..., | |
| default=0, |
| return str(result) | ||
|
|
||
|
|
||
| async def increase_re_onboarding_count(repo_id: str): |
There was a problem hiding this comment.
The increase_re_onboarding_count function is missing a docstring. Following the pattern of other functions in this file, it should include a docstring that describes its purpose. For example:
async def increase_re_onboarding_count(repo_id: str):
"""
Increment the re-onboarding count for a repository.
This is called when a repository requires re-onboarding, typically
when commits become unreachable and need to be reprocessed.
"""| async def increase_re_onboarding_count(repo_id: str): | |
| async def increase_re_onboarding_count(repo_id: str): | |
| """ | |
| Increment the re-onboarding count for a repository. | |
| This is called when a repository requires re-onboarding, typically | |
| when commits become unreachable and need to be reprocessed. | |
| """ |
This pull request introduces a new mechanism to track how many times a git repository has been re-onboarded, which helps in identifying unreachable commits by associating activities with specific onboarding cycles. The changes span database schema, models, CRUD operations, commit processing logic, and worker routines to ensure this new field is consistently updated and utilized throughout the system.
Database and Model Updates:
reOnboardingCountcolumn to thegit.repositoriestable and updated related SQL queries and comments for tracking re-onboarding events.Repositorymodel and its mapping logic to include the newre_onboarding_countfield, ensuring it is available in application code. [1] [2]CRUD and Worker Logic:
reOnboardingCountfield, and added anincrease_re_onboarding_countfunction to increment this value whenever a repository is re-onboarded. [1] [2] [3] [4] [5] [6]Commit Processing Enhancements:
re_onboarding_count, setting theactivity.attributes.cyclefield toonboarding-{reOnboardingCount}for re-onboarded commits. This helps in distinguishing activities from different onboarding cycles. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]