From 565d5488b779de19a720d7a904c6fc14c394a4b9 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Mon, 1 Mar 2021 13:41:29 -0800 Subject: fix: add a check to ensure the MRO is correct Add a check to ensure the MRO (Method Resolution Order) is correct for classes in gitlab.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. --- gitlab/v4/objects/commits.py | 2 +- gitlab/v4/objects/deployments.py | 2 +- gitlab/v4/objects/jobs.py | 2 +- gitlab/v4/objects/pipelines.py | 2 +- gitlab/v4/objects/releases.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'gitlab/v4/objects') diff --git a/gitlab/v4/objects/commits.py b/gitlab/v4/objects/commits.py index 037a90d..6176a08 100644 --- a/gitlab/v4/objects/commits.py +++ b/gitlab/v4/objects/commits.py @@ -159,7 +159,7 @@ class ProjectCommitCommentManager(ListMixin, CreateMixin, RESTManager): ) -class ProjectCommitStatus(RESTObject, RefreshMixin): +class ProjectCommitStatus(RefreshMixin, RESTObject): pass diff --git a/gitlab/v4/objects/deployments.py b/gitlab/v4/objects/deployments.py index 395bc24..64d779f 100644 --- a/gitlab/v4/objects/deployments.py +++ b/gitlab/v4/objects/deployments.py @@ -8,7 +8,7 @@ __all__ = [ ] -class ProjectDeployment(RESTObject, SaveMixin): +class ProjectDeployment(SaveMixin, RESTObject): pass diff --git a/gitlab/v4/objects/jobs.py b/gitlab/v4/objects/jobs.py index 6513d75..e6e04e1 100644 --- a/gitlab/v4/objects/jobs.py +++ b/gitlab/v4/objects/jobs.py @@ -10,7 +10,7 @@ __all__ = [ ] -class ProjectJob(RESTObject, RefreshMixin): +class ProjectJob(RefreshMixin, RESTObject): @cli.register_custom_action("ProjectJob") @exc.on_http_error(exc.GitlabJobCancelError) def cancel(self, **kwargs): diff --git a/gitlab/v4/objects/pipelines.py b/gitlab/v4/objects/pipelines.py index bafab9b..724c5e8 100644 --- a/gitlab/v4/objects/pipelines.py +++ b/gitlab/v4/objects/pipelines.py @@ -30,7 +30,7 @@ __all__ = [ ] -class ProjectPipeline(RESTObject, RefreshMixin, ObjectDeleteMixin): +class ProjectPipeline(RefreshMixin, ObjectDeleteMixin, RESTObject): _managers = ( ("jobs", "ProjectPipelineJobManager"), ("bridges", "ProjectPipelineBridgeManager"), diff --git a/gitlab/v4/objects/releases.py b/gitlab/v4/objects/releases.py index ea74adb..9c94187 100644 --- a/gitlab/v4/objects/releases.py +++ b/gitlab/v4/objects/releases.py @@ -24,7 +24,7 @@ class ProjectReleaseManager(NoUpdateMixin, RESTManager): ) -class ProjectReleaseLink(RESTObject, ObjectDeleteMixin, SaveMixin): +class ProjectReleaseLink(ObjectDeleteMixin, SaveMixin, RESTObject): pass -- cgit v1.2.1