Skip to content
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

feat(mr-search): Target specific project from MR URL instead of searching all projects #48

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

M0nkeySan
Copy link
Collaborator

Why

When searching for a merge request using its URL, we were unnecessarily querying all accessible projects,
even though the URL already contains the exact project path. This led to:

  • Multiple unnecessary API calls (one per project)
  • Potential timeouts on the Slack command due to high latency
  • Wasted GitLab API rate limiting quota

Improvements

  • Extract the project path directly from the merge request URL
  • Make a single API call to the specific project
  • Eliminate the need to iterate through all projects

Example:
For URL: https://gitlab.com/group/project/-/merge_requests/123

  • Before: Query MR #123 in every accessible project (~N API calls)
  • After: Query MR #123 only in 'group/project' (1 API call)

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.35%. Comparing base (678107d) to head (09c5d36).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #48      +/-   ##
==========================================
+ Coverage   78.26%   78.35%   +0.09%     
==========================================
  Files          94       94              
  Lines        1909     1917       +8     
  Branches      345      341       -4     
==========================================
+ Hits         1494     1502       +8     
- Misses        387      406      +19     
+ Partials       28        9      -19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@M0nkeySan M0nkeySan changed the title feat(add-review): Target specific project from MR URL instead of searching all projects feat(mr-search): Target specific project from MR URL instead of searching all projects Oct 31, 2024
@greg0ire greg0ire added the enhancement New feature or request label Oct 31, 2024
@greg0ire greg0ire merged commit 5d7e3f4 into ManoManoTech:main Oct 31, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants