Skip to content

chore: create new ArrayAttribute class #1866

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
Jan 31, 2022
Merged

chore: create new ArrayAttribute class #1866

merged 1 commit into from
Jan 31, 2022

Conversation

JohnVillalovos
Copy link
Member

Create a new ArrayAttribute class. This is to indicate types which are
sent to the GitLab server as arrays
https://docs.gitlab.com/ee/api/#array

At this stage it is identical to the CommaSeparatedListAttribute class
but will be used later to support the array types sent to GitLab.

This is the second step in a series of steps of our goal to add full
support for the GitLab API data types[1]:

  • array
  • hash
  • array of hashes

Step one was: commit 5127b15

[1] https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types

Related: #1698

Create a new ArrayAttribute class. This is to indicate types which are
sent to the GitLab server as arrays
https://docs.gitlab.com/ee/api/#array

At this stage it is identical to the CommaSeparatedListAttribute class
but will be used later to support the array types sent to GitLab.

This is the second step in a series of steps of our goal to add full
support for the GitLab API data types[1]:
  * array
  * hash
  * array of hashes

Step one was: commit 5127b15

[1] https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types

Related: #1698
@JohnVillalovos JohnVillalovos requested a review from nejch January 30, 2022 18:46
@codecov-commenter
Copy link

Codecov Report

Merging #1866 (a57334f) into main (7a13b9b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1866   +/-   ##
=======================================
  Coverage   92.35%   92.35%           
=======================================
  Files          77       77           
  Lines        4854     4856    +2     
=======================================
+ Hits         4483     4485    +2     
  Misses        371      371           
Flag Coverage Δ
cli_func_v4 81.40% <100.00%> (+<0.01%) ⬆️
py_func_v4 80.29% <100.00%> (+<0.01%) ⬆️
unit 83.31% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
gitlab/v4/objects/merge_requests.py 84.78% <ø> (ø)
gitlab/v4/objects/settings.py 95.45% <ø> (ø)
gitlab/types.py 96.66% <100.00%> (+0.23%) ⬆️
gitlab/v4/objects/groups.py 88.65% <100.00%> (ø)
gitlab/v4/objects/issues.py 89.02% <100.00%> (ø)
gitlab/v4/objects/members.py 94.73% <100.00%> (ø)
gitlab/v4/objects/milestones.py 100.00% <100.00%> (ø)
gitlab/v4/objects/projects.py 88.09% <100.00%> (ø)
gitlab/v4/objects/users.py 95.90% <100.00%> (ø)

"iids": types.CommaSeparatedListAttribute,
"labels": types.CommaSeparatedListAttribute,
}
_types = {"iids": types.ArrayAttribute, "labels": types.CommaSeparatedListAttribute}
Copy link
Member

Choose a reason for hiding this comment

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

lol, this is infuriating:
https://docs.gitlab.com/ee/api/issues.html#list-issues

GET /issues?iids[]=42&iids[]=43
GET /issues?labels=foo,bar

😁 thanks for going through all the endpoints. I hope the API docs are accurate.

@nejch nejch merged commit 7646360 into main Jan 31, 2022
@nejch nejch deleted the jlvillal/arrays_2 branch January 31, 2022 23:04
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.

3 participants