Skip to content

Make repr() of project approval rules consistent with merge request approval rules #3011

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

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

holysoles
Copy link
Contributor

Changes

The representation attribute for ProjectMergeRequestApprovalRule is name (see here), which makes sense based on the API documentation. However, the API for ProjectApprovalRule is nearly the same, but we don't set the representation attribute to name for that class (see here).

This MR sets _repr_attr for the ProjectApprovalRule class , as well as adds a unit test for ensure we can list a project's approval rules, and call repr() on it.

Documentation and testing

Please consider whether this PR needs documentation and tests. This is not required, but highly appreciated:

@holysoles holysoles changed the title fix(api): make repr() of project approval rules consistent with merge… Make repr() of project approval rules consistent with merge request approval rules Oct 9, 2024
Copy link

codecov bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.62%. Comparing base (9734ad4) to head (1605b2b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3011   +/-   ##
=======================================
  Coverage   96.62%   96.62%           
=======================================
  Files          95       95           
  Lines        6100     6101    +1     
=======================================
+ Hits         5894     5895    +1     
  Misses        206      206           
Flag Coverage Δ
api_func_v4 82.67% <100.00%> (+<0.01%) ⬆️
cli_func_v4 82.92% <100.00%> (+<0.01%) ⬆️
unit 88.75% <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_request_approvals.py 98.55% <100.00%> (+0.02%) ⬆️

Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

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

Thanks a lot @holysoles looks great! Just a quick question.

@nejch nejch merged commit 1a68f1c into python-gitlab:main Oct 11, 2024
17 checks passed
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.

2 participants