-
Notifications
You must be signed in to change notification settings - Fork 727
chore: migrate-repo-reads-to-public-repositories [CM-900] #3765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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. |
2 similar comments
|
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. |
|
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. |
|
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
|
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. |
|
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. |
| return results | ||
| } | ||
|
|
||
| static async hasMappedRepos(segmentId: string, options: IRepositoryOptions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this function still used ? should t we have a centralized one ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch it's a dead code, I already added a centralized one
| return results | ||
| } | ||
|
|
||
| static async hasMappedRepos(segmentId: string, options: IRepositoryOptions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same of above, should we keep this specific function ?
|
LGTM ✅ |
This pull request refactors and consolidates repository mapping logic across several backend services and data access layers, improving consistency and maintainability. The main changes include replacing platform-specific functions with generic ones, updating queries to use the unified
public.repositoriestable, and standardizing how mapped repositories are checked and retrieved for segments.Refactoring and consolidation of repository mapping logic:
getGithubMappedRepos,getGitlabMappedRepos, etc.) with generic functions (getMappedRepos,getRepoUrlsMappedToOtherSegments,hasMappedRepos,getMappedWithSegmentName) inservices/libs/data-access-layer/src/segments/index.ts, simplifying code and reducing duplication. [1] [2]public.repositoriestable for all platforms, improving query consistency and future scalability. [1] [2]Backend service updates for new mapping logic:
SegmentRepository,CollectionService,IntegrationService,CommonIntegrationService) to use the new generic mapping functions, removing legacy methods and updating logic to support multiple platforms (GitHub, GitHub Nango, GitLab). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Removal of legacy methods:
hasMappedRepos,mappedWith,getGithubMappedRepos,getGitlabMappedRepos, etc.) from repositories and services, fully transitioning to the new generic approach. [1] [2] [3]Platform support improvements:
PlatformType.GITHUB_NANGO) in repository mapping checks and queries, ensuring broader compatibility. [1] [2] [3]Codebase consistency and maintainability:
These changes collectively modernize and streamline how repository mappings are handled for segments, setting a foundation for easier future enhancements and platform support.
Note
Modernizes repo-mapping by standardizing reads/writes on the unified
public.repositoriestable and replacing platform-specific code with generic utilities.segments:getMappedRepos,getRepoUrlsMappedToOtherSegments,hasMappedRepos,getMappedWithSegmentName; queries now targetpublic.repositoriesSegmentRepository,CollectionService,IntegrationService, and common services to use new helpers (adds support forPlatformType.GITHUB_NANGO); integrates into widgets/progress and mapped-repo displaysgetGithubRepos,getGitlabRepos,hasMappedRepos,mappedWith, repositorygetMappingon GitHub/GitLab repos repositories)Written by Cursor Bugbot for commit d71977e. This will update automatically on new commits. Configure here.