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

Skip to content

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
@codecov
Copy link

codecov bot commented Feb 8, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3128      +/-   ##
==========================================
+ Coverage   97.32%   97.38%   +0.06%     
==========================================
  Files          98       98              
  Lines        6057     6205     +148     
==========================================
+ Hits         5895     6043     +148     
  Misses        162      162              
Flag Coverage Δ
api_func_v4 84.14% <100.00%> (+0.40%) ⬆️
cli_func_v4 84.97% <94.44%> (+0.28%) ⬆️
unit 90.41% <100.00%> (+0.21%) ⬆️

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%> (ø)

... and 5 files with indirect coverage changes

🚀 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 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

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

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.
@github-actions
Copy link

github-actions bot commented Sep 9, 2025

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 Sep 9, 2025
@github-actions
Copy link

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 Sep 25, 2025
@nejch nejch reopened this Sep 25, 2025
@github-actions github-actions bot removed the stale label Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants