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/merge trains additional #2547#3149

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

Open
isaac-philip wants to merge7 commits intopython-gitlab:main
base:main
Choose a base branch
Loading
fromisaac-philip:feat/merge_trains_additional

Conversation

isaac-philip
Copy link

Merge Trains Api additional support added :

  1. Status of Merge Request on Merge Train
  2. Add Merge Request to Merge Train

closes#2547

(can work to update the MR with docs till its reviewed/ required, thanks)

@codecovCodecov
Copy link

codecovbot commentedMar 9, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.32%. Comparing base(378a836) to head(3ac6561).

Additional details and impacted files
@@           Coverage Diff           @@##             main    #3149   +/-   ##=======================================  Coverage   97.32%   97.32%           =======================================  Files          98       98             Lines        6057     6066    +9     =======================================+ Hits         5895     5904    +9  Misses        162      162
FlagCoverage Δ
api_func_v483.71% <100.00%> (-0.03%)⬇️
cli_func_v484.71% <100.00%> (+0.02%)⬆️
unit90.22% <100.00%> (+0.03%)⬆️

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

Files with missing linesCoverage Δ
gitlab/v4/objects/merge_trains.py100.00% <100.00%> (ø)
gitlab/v4/objects/projects.py98.92% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@isaac-philip
Copy link
Author

@nejch kindly take a look at this PR.

also if anybody else I should loop in here do share, thanks.

@isaac-philip
Copy link
Author

@JohnVillalovos please let us know for any changes needed before merge, thanks.

Copilot

This comment was marked as outdated.

@JohnVillalovosJohnVillalovosforce-pushed thefeat/merge_trains_additional branch from51a93c1 to7630232CompareApril 17, 2025 16:27
…dd mrSigned-off-by: Isaac Philip <4974658+isaac-philip@users.noreply.github.com>
…dd mr - test data modificationsSigned-off-by: Isaac Philip <4974658+isaac-philip@users.noreply.github.com>
…dd mr - minor changesSigned-off-by: Isaac Philip <4974658+isaac-philip@users.noreply.github.com>
…dd mr - lint formatted by blackSigned-off-by: Isaac Philip <4974658+isaac-philip@users.noreply.github.com>
…dd mr - docs addedSigned-off-by: Isaac Philip <4974658+isaac-philip@users.noreply.github.com>
@JohnVillalovosJohnVillalovosforce-pushed thefeat/merge_trains_additional branch from7630232 to3ac6561CompareJune 7, 2025 15:04
Copy link

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for two new Merge Train API operations: querying the status of a merge request on a merge train and adding a merge request to a merge train.

  • DefineProjectMergeTrainMergeRequest and its manager with GET/POST support
  • Wire the new manager into theProjectMergeTrain object and expose the import inprojects.py
  • Add unit tests and update documentation for the new endpoints

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

FileDescription
gitlab/v4/objects/merge_trains.pyAddedProjectMergeTrainMergeRequest and its manager; wiredmerge_requests onProjectMergeTrain
gitlab/v4/objects/projects.pyExposedProjectMergeTrainManager import onProject
tests/unit/objects/test_merge_trains.pyAdded fixtures and tests for GET/POST operations on merge train merge requests
docs/gl_objects/merge_trains.rstDocumented the new classes and examples for merge train merge requests
Comments suppressed due to low confidence (2)

tests/unit/objects/test_merge_trains.py:99

  • [nitpick] The test name uses plural 'merge_trains' while the related test below is named 'test_merge_train_add_merge_request'. Consider renaming for consistency.
def test_merge_trains_status_merge_request(

gitlab/v4/objects/projects.py:67

  • This import is not referenced directly in this file and will trigger a lint unused-import error. Reintroduce '# noqa: F401' to suppress the false-positive lint warning.
from .merge_trains import ProjectMergeTrainManager

@@ -46,6 +46,10 @@
"duration": 70,
}

merge_train_update = mr_content.copy()
Copy link
Preview

CopilotAIJun 7, 2025

Choose a reason for hiding this comment

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

Using dict.copy() here performs a shallow copy, so nested structures (like the 'pipeline' dict) remain shared with mr_content and may be mutated unexpectedly. Consider using copy.deepcopy() to isolate test data changes.

Copilot uses AI. Check for mistakes.

Choose a reason for hiding this comment

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

Probably a good idea. Since line 51 would modify the underlying dict.

Comment on lines +12 to +13
+ :class:`gilab.v4.objects.ProjectMergeTrainMergeRequest`
+ :class:`gilab.v4.objects.ProjectMergeTrainMergeRequestManager`
Copy link
Preview

CopilotAIJun 7, 2025

Choose a reason for hiding this comment

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

Typo in the module path: 'gilab' should be spelled 'gitlab'.

Suggested change
+:class:`gilab.v4.objects.ProjectMergeTrainMergeRequest`
+:class:`gilab.v4.objects.ProjectMergeTrainMergeRequestManager`
+:class:`gitlab.v4.objects.ProjectMergeTrainMergeRequest`
+:class:`gitlab.v4.objects.ProjectMergeTrainMergeRequestManager`

Copilot uses AI. Check for mistakes.

Copy link
Member

@JohnVillalovosJohnVillalovos 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@isaac-philip

Just a few minor changes requested.

Also it could be squashed down to one commit most likely. That can be done when it is merged or you can do it when you update. Either works.

_update_method: UpdateMethod = UpdateMethod.POST

_update_attrs = RequiredOptional(
optional=("sha", "squash", "when_pipeline_succeeds")

Choose a reason for hiding this comment

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

@@ -46,6 +46,10 @@
"duration": 70,
}

merge_train_update = mr_content.copy()

Choose a reason for hiding this comment

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

Probably a good idea. Since line 51 would modify the underlying dict.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@JohnVillalovosJohnVillalovosJohnVillalovos requested changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Support for new merge train APIs
2 participants
@isaac-philip@JohnVillalovos

[8]ページ先頭

©2009-2025 Movatter.jp