feat: introduce related_issues to merge requests#2996
feat: introduce related_issues to merge requests#2996nejch merged 11 commits intopython-gitlab:mainfrom
Conversation
Ensure black lint check passes following PEP-8
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2996 +/- ##
=======================================
Coverage 96.61% 96.61%
=======================================
Files 95 95
Lines 6080 6087 +7
=======================================
+ Hits 5874 5881 +7
Misses 206 206
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Hey @nejch, thanks for the quick replies! - I ended up reverting my test before seeing your suggestions. So i've re-added it and i'm still working on Mocking the calls to You're correct, the response from GitLab API is a list of dicts containing a lot more than just the issue id's. I'll keep working on this to try and pass CI tests. |
Add related_issues mock endpoint call and resp test
Update title attr and ensure GET request is mocked
Ensure related_issues URL calls match expected mocks
Ensure related_issues mock request matches the same project & MR mock request
RESTObjectList iters an expected ProjectIssue obj
|
Hey @nejch should be all set now thanks! |
There was a problem hiding this comment.
Thanks again for your contribution @xakepnz, LGTM now!
These days I'd probably prefer a manager with .list() which would also solve your next(iter(..)) issues, but it's a bit of overhead in the code and I see we already have the same approach for commits, closes_issues etc.
I'll squash the commits just so we have a clean history here.

Changes
related_issuesfor themerge_requestsobject, returning a list of all related issues.Context
GitLab released
related_issues(official docs), an endpoint which collects all issues that relate to the current MR. This can be from:See the change introduced: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155422
PoC:
Documentation and testing
Both docs & tests updated
Please consider whether this PR needs documentation and tests. This is not required, but highly appreciated: