Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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)

@codecov
Copy link

codecov bot commented Mar 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.32%. Comparing base (378a836) to head (3ac6561).
⚠️ Report is 57 commits behind head on main.

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           
Flag Coverage Δ
api_func_v4 83.71% <100.00%> (-0.03%) ⬇️
cli_func_v4 84.71% <100.00%> (+0.02%) ⬆️
unit 90.22% <100.00%> (+0.03%) ⬆️

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

Files with missing lines Coverage Δ
gitlab/v4/objects/merge_trains.py 100.00% <100.00%> (ø)
gitlab/v4/objects/projects.py 98.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.

@JohnVillalovos JohnVillalovos requested a review from Copilot April 7, 2025 01:50

This comment was marked as outdated.

@JohnVillalovos JohnVillalovos force-pushed the feat/merge_trains_additional branch from 51a93c1 to 7630232 Compare April 17, 2025 16:27
@JohnVillalovos JohnVillalovos force-pushed the feat/merge_trains_additional branch from 7630232 to 3ac6561 Compare June 7, 2025 15:04
@JohnVillalovos JohnVillalovos requested a review from Copilot June 7, 2025 15:05
Copy link

Copilot AI 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.

  • Define ProjectMergeTrainMergeRequest and its manager with GET/POST support
  • Wire the new manager into the ProjectMergeTrain object and expose the import in projects.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.

File Description
gitlab/v4/objects/merge_trains.py Added ProjectMergeTrainMergeRequest and its manager; wired merge_requests on ProjectMergeTrain
gitlab/v4/objects/projects.py Exposed ProjectMergeTrainManager import on Project
tests/unit/objects/test_merge_trains.py Added fixtures and tests for GET/POST operations on merge train merge requests
docs/gl_objects/merge_trains.rst Documented 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

"duration": 70,
}

merge_train_update = mr_content.copy()
Copy link

Copilot AI Jun 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.
Copy link
Member

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

Copilot AI Jun 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

@JohnVillalovos JohnVillalovos left a comment

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")
Copy link
Member

Choose a reason for hiding this comment

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

"duration": 70,
}

merge_train_update = mr_content.copy()
Copy link
Member

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.

@github-actions
Copy link

This Pull Request (PR) was marked stale because it has been open 90 days with no activity. Please remove the stale label or comment on this PR. Otherwise, it will be closed in 15 days.

@github-actions github-actions bot added the stale label Oct 17, 2025
@github-actions
Copy link

github-actions bot commented Nov 2, 2025

This PR was closed because it has been marked stale for 15 days with no activity. If this PR is still valid, please re-open.

@github-actions github-actions bot closed this Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for new merge train APIs

2 participants