Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: iids not working as a list in projects.issues.list()#1413

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 1 commit intopython-gitlab:masterfromJohnVillalovos:jlvillal/1407
Apr 27, 2021
Merged

fix: iids not working as a list in projects.issues.list()#1413

nejch merged 1 commit intopython-gitlab:masterfromJohnVillalovos:jlvillal/1407
Apr 27, 2021

Conversation

JohnVillalovos
Copy link
Member

@JohnVillalovosJohnVillalovos commentedApr 25, 2021
edited
Loading

Set the 'iids' values as type ListAttribute so it will pass the list
as a comma-separated string, instead of a list.

Closes:#1407

@codecov-commenter
Copy link

codecov-commenter commentedApr 25, 2021
edited
Loading

Codecov Report

Merging#1413 (265bc13) intomaster (dde01c7) willnot change coverage.
The diff coverage is100.00%.

Impacted file tree graph

@@           Coverage Diff           @@##           master    #1413   +/-   ##=======================================  Coverage   80.24%   80.24%           =======================================  Files          73       73             Lines        4064     4064           =======================================  Hits         3261     3261             Misses        803      803
FlagCoverage Δ
unit80.24% <100.00%> (ø)

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

Impacted FilesCoverage Δ
gitlab/v4/objects/issues.py80.88% <100.00%> (ø)

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updatedde01c7...265bc13. Read thecomment docs.

@JohnVillalovos
Copy link
MemberAuthor

This doesn't work at the moment. ListAttribute assumes the input is a string.

@JohnVillalovosJohnVillalovos marked this pull request as ready for reviewApril 25, 2021 22:48
@JohnVillalovos
Copy link
MemberAuthor

JohnVillalovos commentedApr 25, 2021
edited
Loading

This depends on#1415 getting merged or this whole patch chain could be merged and#1415 could be closed.

@JohnVillalovos
Copy link
MemberAuthor

JohnVillalovos commentedApr 25, 2021
edited
Loading

I tested this and reproduced the issue and then with my change it worked correctly.

Likely I should probably update this patch to cover all the other instances ofiids

I think all of these API endpoints would need to be updated. This is searching the GitLab source code for users of CommaSeparatedToIntegerArray.

~/source/gitlab/ $ rg --sort path 'coerce_with.*CommaSeparatedToIntegerArray'doc/development/api_styleguide.md120:optional :user_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The user ids for this rule'ee/lib/api/geo_nodes.rb51:        optional :selective_sync_namespace_ids, as: :namespace_ids, type: Array[Integer], coerce_with: Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The IDs of groups that should be synced, if `selective_sync_type` == `namespaces`'208:          optional :selective_sync_namespace_ids, as: :namespace_ids, type: Array[Integer], coerce_with: Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The IDs of groups that should be synced, if `selective_sync_type` == `namespaces`'ee/lib/api/helpers/project_approval_rules_helpers.rb12:        optional :users, as: :user_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The user ids for this rule'13:        optional :groups, as: :group_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The group ids for this rule'14:        optional :protected_branch_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The protected branch ids for this rule'21:        optional :users, as: :user_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The user ids for this rule'22:        optional :groups, as: :group_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The group ids for this rule'23:        optional :protected_branch_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The protected branch ids for this rule'ee/lib/api/merge_request_approval_rules.rb35:          optional :user_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The user ids for this rule'36:          optional :group_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The group ids for this rule'57:            optional :user_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The user ids for this rule'58:            optional :group_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The group ids for this rule'ee/lib/api/project_approvals.rb65:        requires :approver_ids, type: Array[Integer], coerce_with: Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'Array of User IDs to set as approvers.'66:        requires :approver_group_ids, type: Array[Integer], coerce_with: Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'Array of Group IDs to set as approvers.'ee/lib/ee/api/helpers/settings_helpers.rb29:              optional :elasticsearch_namespace_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The namespace ids to index with Elasticsearch.'30:              optional :elasticsearch_project_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The project ids to index with Elasticsearch.'ee/lib/ee/api/merge_request_approvals.rb87:              requires :approver_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce,89:              requires :approver_group_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce,lib/api/groups.rb21:        optional :skip_groups, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'Array of group ids to exclude from list'lib/api/issues.rb17:        optional :iids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The IID array of issues'69:        optional :assignee_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The array of user IDs to assign issue'lib/api/members.rb23:          optional :user_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'Array of user ids to look up for membership'42:          optional :user_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'Array of user ids to look up for membership'lib/api/merge_requests.rb162:          optional :assignee_ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The array of user IDs to assign issue'182:        optional :iids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The IID array of merge requests'lib/api/milestone_responses.rb18:          optional :iids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'The IIDs of the milestones'lib/api/projects.rb549:        optional :skip_users, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: 'Filter out users with the specified IDs'lib/api/suggestions.rb28:        requires :ids, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce, desc: "An array of suggestion ID's"spec/lib/api/helpers/common_helpers_spec.rb20:        optional :array_of_ints, type: Array[Integer], coerce_with: ::API::Validations::Types::CommaSeparatedToIntegerArray.coerce

@JohnVillalovos
Copy link
MemberAuthor

JohnVillalovos commentedApr 27, 2021
edited
Loading

@nejch I added a functional test that shows this works. I tried the functional test first without the fix and it failed.

Failed functional test without fix:https://github.com/python-gitlab/python-gitlab/runs/2449139416?check_suite_focus=true

Set the 'iids' values as type ListAttribute so it will pass the listas a comma-separated string, instead of a list.Add a functional test.Closes:#1407
@nejch
Copy link
Member

@nejch I added a functional test that shows this works. I tried the functional test first without the fix and it failed.

Failed functional test without fix:https://github.com/python-gitlab/python-gitlab/runs/2449139416?check_suite_focus=true

Awesome! i just trust functional tests so much more because they catch these real issues and behavior. Thanks :)

@nejchnejchenabled auto-mergeApril 27, 2021 15:24
@nejchnejch merged commita6b6cd4 intopython-gitlab:masterApr 27, 2021
@JohnVillalovosJohnVillalovos deleted the jlvillal/1407 branchApril 27, 2021 16:03
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nejchnejchnejch approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Trying to Fetch multiple ProjectIssues in a single batch call returns only the last ProjectIssue specified in the list
3 participants
@JohnVillalovos@codecov-commenter@nejch

[8]ページ先頭

©2009-2025 Movatter.jp