Skip to content

fix: adds missing status check methods for merge requests #3128

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SachinKSingh28
Copy link
Contributor

@SachinKSingh28 SachinKSingh28 commented Feb 8, 2025

Implements promised changes in #3103

  • Add documentation for project merge request status check manager.
  • Add method for setting the status check for an MR.

@SachinKSingh28 SachinKSingh28 force-pushed the fix/add-missing-status-check-methods branch 2 times, most recently from af3f374 to 6bd04ca Compare February 8, 2025 23:20
Copy link

codecov bot commented Feb 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3128   +/-   ##
=======================================
  Coverage   97.32%   97.32%           
=======================================
  Files          98       98           
  Lines        6057     6067   +10     
=======================================
+ Hits         5895     5905   +10     
  Misses        162      162           
Flag Coverage Δ
api_func_v4 83.81% <100.00%> (+0.07%) ⬆️
cli_func_v4 84.70% <94.44%> (+<0.01%) ⬆️
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/merge_requests.py 90.32% <100.00%> (+0.06%) ⬆️
gitlab/v4/objects/status_checks.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SachinKSingh28 SachinKSingh28 force-pushed the fix/add-missing-status-check-methods branch from 6bd04ca to d0abf43 Compare February 9, 2025 00:09
@SachinKSingh28
Copy link
Contributor Author

@nejch It doesn't seem like we have a Gitlab API to get a single external status check for a project, only list method is supported. is there a cleaner way this can be approached/implemented? I was actually thinking about raising with Gitlab.

@SachinKSingh28 SachinKSingh28 force-pushed the fix/add-missing-status-check-methods branch from d0abf43 to 0a66ae5 Compare February 9, 2025 00:16
@SachinKSingh28 SachinKSingh28 force-pushed the fix/add-missing-status-check-methods branch from 0a66ae5 to 6eee494 Compare February 13, 2025 13:17
@SachinKSingh28 SachinKSingh28 force-pushed the fix/add-missing-status-check-methods branch from 5c5a336 to cd81aea Compare February 14, 2025 16:06
@SachinKSingh28 SachinKSingh28 marked this pull request as ready for review February 14, 2025 16:30
@SachinKSingh28 SachinKSingh28 force-pushed the fix/add-missing-status-check-methods branch from cd81aea to 9430f4d Compare February 14, 2025 16:30
@JohnVillalovos JohnVillalovos force-pushed the fix/add-missing-status-check-methods branch from 9430f4d to b8a42d5 Compare June 7, 2025 15:10
@JohnVillalovos JohnVillalovos requested a review from Copilot June 7, 2025 15:11
Copy link

@Copilot 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

This PR implements the missing status check methods for merge requests as promised in issue #3103.

  • Adds fixtures and tests for listing and updating merge request external status checks
  • Introduces new classes for handling merge request status check responses in the API client
  • Updates documentation to reflect the new API and naming conventions

Reviewed Changes

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

Show a summary per file
File Description
tests/unit/objects/test_status_checks.py Added fixtures and tests for external status checks functionality
tests/functional/api/test_merge_requests.py Introduced functional test for setting merge request external status
gitlab/v4/objects/status_checks.py Added new manager and response classes for status check updates
gitlab/v4/objects/merge_requests.py Updated merge request object to include new status check managers
docs/gl_objects/status_checks.rst Revised documentation to reflect new external status check methods
Comments suppressed due to low confidence (1)

gitlab/v4/objects/status_checks.py:66

  • [nitpick] The docstring for the update method in ProjectMergeRequestStatusCheckResponseManager should describe updating a merge request status check response rather than referring to a Label.
"""Update a Label on the server."""

"sha": merge_request.sha,
}
)
response["status"] == "passed"
Copy link
Preview

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.

The status update check is currently a no-op; use an assertion (e.g., assert response["status"] == "passed") to properly validate the response.

Suggested change
response["status"] == "passed"
assert response["status"] == "passed"

Copilot uses AI. Check for mistakes.


Delete an external status check::

status_check.delete(status_check_id)
external_status_check.delete(externa_status_check_id)
Copy link
Preview

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.

There is a typo in the variable name 'externa_status_check_id'; it should be 'external_status_check_id'.

Suggested change
external_status_check.delete(externa_status_check_id)
external_status_check.delete(external_status_check_id)

Copilot uses AI. Check for mistakes.

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.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy