FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: add sync method to force remote mirror updates by JohnVillalovos · Pull Request #3232 · python-gitlab/python-gitlab · GitHub

Repository navigation

feat: add sync method to force remote mirror updates - #3232

Merged
nejch merged 1 commit into
mainfrom
jlvillal/3223
Aug 5, 2025
Merged

nejch merged 1 commit into
mainfrom
jlvillal/3223

Conversation

Copy link
Copy Markdown
Member

Add ProjectRemoteMirror.sync() method to trigger immediate push mirror updates.

Closes: #3223

Copilot AI review requested due to automatic review settings July 14, 2025 06:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull Request Overview

Adds a new sync method to ProjectRemoteMirror to force an immediate remote mirror update via HTTP POST, along with corresponding test coverage and documentation.

  • Implements ProjectRemoteMirror.sync() in the API client
  • Extends unit tests to verify the sync endpoint call
  • Updates the Sphinx docs to show how to invoke mirror.sync()

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/unit/objects/test_remote_mirrors.py Added a responses.POST stub and test_sync_project_remote_mirror
gitlab/v4/objects/projects.py Defined ProjectRemoteMirror.sync() with HTTP POST and decorators
docs/gl_objects/remote_mirrors.rst Documented mirror.sync() usage
Comments suppressed due to low confidence (2)

gitlab/v4/objects/projects.py:1238

  • [nitpick] The return type annotation is a union of dict[str, Any] and requests.Response, but since http_post always returns a Response object, consider narrowing the annotation to requests.Response for clarity.
    def sync(self, **kwargs: Any) -> dict[str, Any] | requests.Response:

docs/gl_objects/remote_mirrors.rst:40

  • [nitpick] Expand this example to show the returned Response object (e.g., checking response.status_code) and mention any accepted kwargs or possible exceptions so users know how to handle the result of mirror.sync().
Force push mirror update::

codecov Bot commented Jul 14, 2025 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.32%. Comparing base (bf7a60a) to head (824881d).
⚠️ Report is 37 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3232   +/-   ##
=======================================
  Coverage   97.32%   97.32%           
=======================================
  Files          98       98           
  Lines        6058     6062    +4     
=======================================
+ Hits         5896     5900    +4     
  Misses        162      162           
Flag Coverage Δ
api_func_v4 83.66% <60.00%> (-0.08%) ⬇️
cli_func_v4 84.67% <60.00%> (-0.03%) ⬇️
unit 90.20% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
gitlab/v4/objects/projects.py 98.93% <100.00%> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

nejch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Perfect, thanks @JohnVillalovos!

Add ProjectRemoteMirror.sync() method to trigger immediate push mirror
updates.

Closes: #3223
nejch enabled auto-merge (rebase) August 5, 2025 10:56
nejch merged commit f3c6678 into main Aug 5, 2025
nejch deleted the jlvillal/3223 branch August 5, 2025 11:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support: Force push mirror update API

3 participants


Back | FazBrowse Home | New Git URL