-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR renames OSIM module to Workflows. In order to achieve that this PR is separated in 4 commits that respectively has the purpose of: - Change the folder name modifying imports, settings and comments/documentations; - Change classes, exceptions and models names and attributes to comply with new naming; - Change constants names related to the module; - Change the API path from `/osim/*` to `/workflows/*`. Closes OSIDB-1395
- Loading branch information
Showing
43 changed files
with
482 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[bandit] | ||
exclude: osidb/tests, collectors/bzimport/tests, collectors/jiraffe/tests, apps/osim/tests, src, .git, .tox, | ||
exclude: osidb/tests, collectors/bzimport/tests, collectors/jiraffe/tests, apps/workflows/tests, src, .git, .tox, | ||
skips: B101,B102,B301 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
""" | ||
Former OSIM API endpoints marked as deprecated | ||
""" | ||
|
||
import logging | ||
|
||
from drf_spectacular.utils import extend_schema | ||
|
||
from apps.workflows import api | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
@extend_schema(deprecated=True) | ||
class index(api.index): | ||
"""deprecated osim index API endpoint""" | ||
|
||
|
||
@extend_schema(deprecated=True) | ||
class healthy(api.healthy): | ||
"""deprecated osim unauthenticated health check API endpoint""" | ||
|
||
|
||
@extend_schema(deprecated=True) | ||
class adjust(api.adjust): | ||
"""deprecated osim adjustion API endpoint""" | ||
|
||
|
||
@extend_schema(deprecated=True) | ||
class promote(api.promote): | ||
"""deprecated osim promote API endpoint""" | ||
|
||
|
||
@extend_schema(deprecated=True) | ||
class reject(api.reject): | ||
"""deprecated osim reject API endpoint""" | ||
|
||
|
||
@extend_schema(deprecated=True) | ||
class classification(api.classification): | ||
"""deprecated osim classification API endpoint""" | ||
|
||
|
||
@extend_schema(deprecated=True) | ||
class workflows(api.workflows): | ||
"""deprecated osim info API endpoint""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
Workflows Manager | ||
""" | ||
|
||
from django.apps import AppConfig | ||
|
||
|
||
class Workflows(AppConfig): | ||
"""django name""" | ||
|
||
name = "apps.workflows" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
""" | ||
Workflows constants | ||
""" | ||
|
||
WORKFLOWS_API_VERSION: str = "v1" | ||
WORKFLOW_DIR = "apps/workflows/workflows" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
""" | ||
Workflows exceptions | ||
""" | ||
|
||
|
||
class WorkflowsException(Exception): | ||
"""base exception class for Workflows specific exceptions""" | ||
|
||
|
||
class APIError(WorkflowsException): | ||
"""exception class for API errors""" | ||
|
||
|
||
class LastStateException(WorkflowsException): | ||
"""exception for trying to promote further when in the last possible state""" | ||
|
||
|
||
class MissingRequirementsException(WorkflowsException): | ||
"""exception for trying to change state without requirements""" | ||
|
||
|
||
class MissingStateException(WorkflowsException): | ||
"""exception for handling a non-registered state""" | ||
|
||
|
||
class MissingWorkflowException(WorkflowsException): | ||
"""exception for handling a non-registered workflow""" | ||
|
||
|
||
class WorkflowDefinitionError(WorkflowsException): | ||
"""exception class for workflow definitions errors""" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
OSIM workflow model definitions | ||
Workflows model definitions | ||
""" | ||
|
||
from .checks import CheckParser | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.