Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
#66: Fix regression with Pipeline that incorrectly joined strings as …
Browse files Browse the repository at this point in the history
…lists which resulted in [':', 't', 'e', 's', 't'] instead of [':test']
  • Loading branch information
blackandred committed Aug 28, 2021
1 parent 7cea961 commit a2a17a4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/core/rkd/core/api/syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def _resolve_pipeline_parts(parts: List[Union[str, PipelinePartInterface]]) -> L
if isinstance(part, PipelinePartInterface):
resolved += part.to_pipeline_part()
else:
resolved += part
resolved.append(part)

return resolved

Expand Down
10 changes: 5 additions & 5 deletions src/core/rkd/core/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from traceback import print_exc
from uuid import uuid4
from . import env
from .api.syntax import TaskDeclaration, parse_path_into_subproject_prefix, ExtendedTaskDeclaration
from .api.syntax import TaskDeclaration, parse_path_into_subproject_prefix, ExtendedTaskDeclaration, Pipeline
from .api.syntax import TaskAliasDeclaration
from .api.syntax import GroupDeclaration
from .api.contract import ContextInterface
Expand Down Expand Up @@ -51,7 +51,7 @@ class ApplicationContext(ContextInterface):
"""

_imported_tasks: Dict[str, TaskDeclaration]
_task_aliases: Dict[str, TaskAliasDeclaration]
_task_aliases: Dict[str, Pipeline]
_compiled: Dict[str, Union[TaskDeclaration, GroupDeclaration]]
_created_at: datetime
_directory: str
Expand All @@ -63,7 +63,7 @@ class ApplicationContext(ContextInterface):
id: str

def __init__(self, tasks: List[TaskDeclaration],
aliases: List[TaskAliasDeclaration],
aliases: List[Pipeline],
directory: str,
subprojects: List[str],
workdir: str,
Expand Down Expand Up @@ -152,7 +152,7 @@ def _add_task(self, task: TaskDeclaration, parent_ctx: Optional['ApplicationCont

self._imported_tasks[task.to_full_name()] = task

def _add_pipeline(self, pipeline: TaskAliasDeclaration, parent_ctx: Optional['ApplicationContext'] = None) -> None:
def _add_pipeline(self, pipeline: Pipeline, parent_ctx: Optional['ApplicationContext'] = None) -> None:
if not parent_ctx:
parent_ctx = self

Expand All @@ -161,7 +161,7 @@ def _add_pipeline(self, pipeline: TaskAliasDeclaration, parent_ctx: Optional['Ap

self._task_aliases[pipeline.get_name()] = pipeline

def _resolve_pipeline(self, name: str, pipeline: TaskAliasDeclaration) -> GroupDeclaration:
def _resolve_pipeline(self, name: str, pipeline: Pipeline) -> GroupDeclaration:
"""
Parse commandline args to fetch list of tasks to join into a group
Expand Down
6 changes: 3 additions & 3 deletions src/core/tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from rkd.core.api.inputoutput import NullSystemIO, IO, SystemIO
from rkd.core.dto import StaticFileContextParsingResult
from rkd.core.exception import ContextException
from rkd.core.api.syntax import TaskDeclaration
from rkd.core.api.syntax import TaskDeclaration, Pipeline
from rkd.core.api.syntax import TaskAliasDeclaration
from rkd.core.api.syntax import GroupDeclaration
from rkd.core.api.testing import BasicTestingCase
Expand Down Expand Up @@ -190,8 +190,8 @@ def test_context_resolves_recursively_task_aliases(self):
ctx = ApplicationContext([
TaskDeclaration(TaskForTesting(), name=':test')
], [
TaskAliasDeclaration(':deeper', [':test', ':test']),
TaskAliasDeclaration(':deep', [':test', ':deeper'])
Pipeline(':deeper', [':test', ':test']),
Pipeline(':deep', [':test', ':deeper'])
], directory='',
subprojects=[],
workdir='',
Expand Down

0 comments on commit a2a17a4

Please sign in to comment.