Skip to content

fix: support int for parent_id in import_group - #2507

Merged
nejch merged 2 commits into
mainfrom
jlvillal/parent_int
Mar 12, 2023
Merged

fix: support int for parent_id in import_group#2507
nejch merged 2 commits into
mainfrom
jlvillal/parent_int

Conversation

@JohnVillalovos

Copy link
Copy Markdown
Member

This will also fix other use cases where an integer is passed in to
MultipartEncoder.

Added unit tests to show it works.

Closes: #2506

@JohnVillalovos
JohnVillalovos requested a review from nejch March 4, 2023 22:34
@codecov-commenter

codecov-commenter commented Mar 4, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2507 (a41539c) into main (d387d91) will increase coverage by 8.58%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2507      +/-   ##
==========================================
+ Coverage   87.59%   96.17%   +8.58%     
==========================================
  Files          87       87              
  Lines        5665     5676      +11     
==========================================
+ Hits         4962     5459     +497     
+ Misses        703      217     -486     
Flag Coverage Δ
api_func_v4 82.48% <85.00%> (?)
cli_func_v4 82.96% <75.00%> (?)
unit 87.63% <100.00%> (+0.04%) ⬆️

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

Impacted Files Coverage Δ
gitlab/_backends/requests_backend.py 98.36% <100.00%> (+2.36%) ⬆️
gitlab/client.py 98.79% <100.00%> (+4.83%) ⬆️
gitlab/v4/objects/groups.py 90.81% <100.00%> (+7.02%) ⬆️

... and 43 files with indirect coverage changes

@nejch 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.

Thanks @JohnVillalovos, just a quick initial question on the fix, the rest seems to me an unrelated refactor so I'll look at it a bit later as I'm a bit tired right now 😅

Comment thread gitlab/_backends/requests_backend.py Outdated
@JohnVillalovos
JohnVillalovos requested a review from nejch March 5, 2023 02:24
@nejch

nejch commented Mar 10, 2023

Copy link
Copy Markdown
Member

Sorry for the delay here, I just realized the testing conflicts a bit with those added in https://github.com/python-gitlab/python-gitlab/pull/2488/files#diff-fc2667e8a1b0a974c8447eee8fca931262283245469f31693874cad25651c8f1, I'll get back to this on the weekend :)

@nejch 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.

Thanks @JohnVillalovos, I had some thoughts on the testing structure but will do a follow-up as we have a big mix now from older tests anyway.

I found the tuple of three values confusing. So instead use a
dataclass to return the three values. It is still confusing but a
little bit less so.

Also add some unit tests
This will also fix other use cases where an integer is passed in to
MultipartEncoder.

Added unit tests to show it works.

Closes: #2506
@nejch
nejch force-pushed the jlvillal/parent_int branch from 192475a to a41539c Compare March 12, 2023 09:22
@nejch
nejch merged commit 90f96ac into main Mar 12, 2023
@nejch
nejch deleted the jlvillal/parent_int branch March 12, 2023 10:11
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.

Group import fails when parent_id is passed as int

3 participants