chore: migrate-repo-reads-to-public-repositories [CM-900]#3765
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. |
|
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.
is this function still used ? should t we have a centralized one ?
There was a problem hiding this comment.
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.
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.