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: add a check to ensure the MRO is correct#1352

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 2 commits intopython-gitlab:masterfromJohnVillalovos:jlvillal/fix_mro
Apr 27, 2021
Merged

fix: add a check to ensure the MRO is correct#1352

nejch merged 2 commits intopython-gitlab:masterfromJohnVillalovos:jlvillal/fix_mro
Apr 27, 2021

Conversation

@JohnVillalovos
Copy link
Member

@JohnVillalovosJohnVillalovos commentedMar 1, 2021
edited
Loading

This should be merged after:
#1344
DONE

Add a check to ensure the MRO (Method Resolution Order) is correct for classes in
gitlab.v4.objects.

An example of an incorrect definition:    class ProjectPipeline(RESTObject, RefreshMixin, ObjectDeleteMixin):                          ^^^^^^^^^^ This should be at the end.Correct way would be:    class ProjectPipeline(RefreshMixin, ObjectDeleteMixin, RESTObject):                                      Correctly at the end ^^^^^^^^^^

Also fix classes which have the issue.

@max-wittig
Copy link
Member

Thanks for the MR. Could you elaborate why this matters? I know what you can override methods based on the order, but other than that, I'm unsure. Would be interesting to know@JohnVillalovos

@JohnVillalovos
Copy link
MemberAuthor

Thanks for the MR. Could you elaborate why this matters? I know what you can override methods based on the order, but other than that, I'm unsure. Would be interesting to know@JohnVillalovos

Sure. Let me write up a better explanation and post it. It will have to be after my work-day is over here in Oregon.

@JohnVillalovos
Copy link
MemberAuthor

Thanks for the MR. Could you elaborate why this matters? I know what you can override methods based on the order, but other than that, I'm unsure. Would be interesting to know@JohnVillalovos

Sure. Let me write up a better explanation and post it. It will have to be after my work-day is over here in Oregon.

I have put comments in the test file that explain it better.

This PR is assuming that#1344 will be merged. As that is what triggered this issue.

@codecov-io
Copy link

codecov-io commentedMar 3, 2021
edited
Loading

Codecov Report

Merging#1352 (a7a0487) intomaster (96d2805) willnot change coverage.
The diff coverage is100.00%.

Impacted file tree graph

@@           Coverage Diff           @@##           master    #1352   +/-   ##=======================================  Coverage   80.21%   80.21%           =======================================  Files          73       73             Lines        3801     3801           =======================================  Hits         3049     3049             Misses        752      752
FlagCoverage Δ
unit80.21% <100.00%> (ø)

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

Impacted FilesCoverage Δ
gitlab/v4/objects/commits.py78.26% <100.00%> (ø)
gitlab/v4/objects/deployments.py100.00% <100.00%> (ø)
gitlab/v4/objects/jobs.py63.79% <100.00%> (ø)
gitlab/v4/objects/pipelines.py88.00% <100.00%> (ø)
gitlab/v4/objects/releases.py100.00% <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 update96d2805...a7a0487. Read thecomment docs.

@JohnVillalovos
Copy link
MemberAuthor

@max-wittig Hopefully I have answered your question.

@JohnVillalovos
Copy link
MemberAuthor

Any more questions or comments about this?

Copy link
Member

@nejchnejch left a comment

Choose a reason for hiding this comment

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

Thanks@JohnVillalovos! Just a few quick comments.

@JohnVillalovos
Copy link
MemberAuthor

@nejch Thanks for the feedback. I'll try to get some time to work on this in the next few days.

@JohnVillalovos
Copy link
MemberAuthor

@nejch Updated. I removed the debug code and moved the comments into the docstring.

Add a check to ensure the MRO (Method Resolution Order) is correct for classes ingitlab.v4.objects when doing type-checking.An example of an incorrect definition:    class ProjectPipeline(RESTObject, RefreshMixin, ObjectDeleteMixin):                          ^^^^^^^^^^ This should be at the end.Correct way would be:    class ProjectPipeline(RefreshMixin, ObjectDeleteMixin, RESTObject):                                      Correctly at the end ^^^^^^^^^^Also fix classes which have the issue.
@nejchnejchenabled auto-mergeApril 27, 2021 05:11
@nejchnejch merged commit909aa9a intopython-gitlab:masterApr 27, 2021
@JohnVillalovosJohnVillalovos deleted the jlvillal/fix_mro 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.

4 participants

@JohnVillalovos@max-wittig@codecov-io@nejch

[8]ページ先頭

©2009-2025 Movatter.jp