Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: introduce related_issues to merge requests#2996

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 11 commits intopython-gitlab:mainfromxakepnz:main
Sep 24, 2024

Conversation

@xakepnz
Copy link
Contributor

Changes

  • This PR introducesrelated_issues for themerge_requests object, returning a list of all related issues.

Context

GitLab releasedrelated_issues (official docs), an endpoint which collects all issues that relate to the current MR. This can be from:

  • commit messages on the MR that contain issue links
  • issue links commented in the MR
  • issue links in the title of the MR
  • issues created from discussions in the MR

See the change introduced:https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155422

PoC:

curl --header"PRIVATE-TOKEN: <your_access_token>" \  --url"https://127.0.0.1:3000/api/v4/projects/7/merge_requests/1/related_issues"

Documentation and testing

Both docs & tests updated

Please consider whether this PR needs documentation and tests.This is not required, but highly appreciated:

Copy link
Member

@nejchnejch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks a lot for your contribution@xakepnz!

I just left a few initial comments to get tests green hopefully. Let me know if anything's unclear.

@xakepnzxakepnz marked this pull request as draftSeptember 23, 2024 10:54
@codecov
Copy link

codecovbot commentedSep 23, 2024
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.61%. Comparing base(a2ab54c) to head(412d92d).
Report is 1 commits behind head on main.

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
FlagCoverage Δ
api_func_v482.58% <42.85%> (+0.06%)⬆️
cli_func_v482.89% <42.85%> (-0.05%)⬇️
unit88.74% <100.00%> (+0.01%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

Files with missing linesCoverage Δ
gitlab/v4/objects/merge_requests.py89.67% <100.00%> (+0.48%)⬆️

@xakepnz
Copy link
ContributorAuthor

Thanks a lot for your contribution@xakepnz!

I just left a few initial comments to get tests green hopefully. Let me know if anything's unclear.

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/related_issues

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.

xakepnzand others added8 commitsSeptember 24, 2024 00:37
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
@xakepnzxakepnz marked this pull request as ready for reviewSeptember 23, 2024 12:52
@xakepnzxakepnz requested a review fromnejchSeptember 23, 2024 12:52
@xakepnz
Copy link
ContributorAuthor

Hey@nejch should be all set now thanks!

need-sleep

nejch and antoineauger reacted with laugh emoji

Copy link
Member

@nejchnejch left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks again for your contribution@xakepnz, LGTM now!

These days I'd probably prefer a manager with.list() which would also solve yournext(iter(..)) issues, but it's a bit of overhead in the code and I see we already have the same approach forcommits,closes_issues etc.

I'll squash the commits just so we have a clean history here.

@nejchnejch merged commit174d992 intopython-gitlab:mainSep 24, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nejchnejchnejch approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@xakepnz@nejch

[8]ページ先頭

©2009-2025 Movatter.jp