Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增 "在 next 列表中添加任务本身" 的字段 #356

Open
weinibuliu opened this issue Sep 21, 2024 · 5 comments
Open

新增 "在 next 列表中添加任务本身" 的字段 #356

weinibuliu opened this issue Sep 21, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@weinibuliu
Copy link
Contributor

weinibuliu commented Sep 21, 2024

新增 include_self 字段以便捷地实现在 next 列表中添加任务本身。
示例:

"TaskA": {
        "include_self": true,
        "next": [
            "TaskB",
            "TaskC"
        ]
}

预期效果为

    "TaskA": {
        "next": [
            "TaskB",
            "TaskC",
            "TaskA"
        ]
}

可以考虑为这个字段支持部分进阶操作,如:
next 列表的开头插入自身:

"TaskA": {
        "include_self": true,
        "include_self_mode": "beginning",
        "next": [
            "TaskB",
            "TaskC"
        ]
}

等价于:
        "next": [
            "TaskA",
            "TaskB",
            "TaskC"
        ]

next 列表中的某个任务之后插入自身:

"TaskA": {
        "include_self": true,
        "include_self_mode": "TaskB",
        "next": [
            "TaskB",
            "TaskC"
        ]
}

等价于:
        "next": [
            "TaskB",
            "TaskA",
            "TaskC"
        ]

不过,感觉进阶操作有些多余的样子(

@dongwlin
Copy link
Member

感觉意义不大,反而会导致next不直观,使得pipeline变得复杂

@weinibuliu
Copy link
Contributor Author

感觉意义不大,反而会导致next不直观,使得pipeline变得复杂

主要设想是结合 全局默认值 这个功能便捷地实现初步的异常处理(比如说 Click 未能被正确执行,导致后续 next 无法正常运行。)尽管现在也可以通过手动添加实现这个功能 但那样的工程量会变得很难直视

@MistEO MistEO added the enhancement New feature or request label Sep 23, 2024
@MistEO
Copy link
Member

MistEO commented Sep 23, 2024

功能还行,感觉字段名不是太好,得再想一个.jpg

@dongwlin
Copy link
Member

功能还行,感觉字段名不是太好,得再想一个.jpg

recursive (?)

  • recursive: bool
    调用自身,在 next 列表的开头插入自身。可选,默认 false 。

  • recursive_before: string
    next 列表中的某个 task 前插入自身。可选,默认不插入 。

  • recursive_after: string
    next 列表中的某个 task 后插入自身。可选,默认不插入 。

@MistEO MistEO changed the title 新增 "include_self" 字段 新增 "在 next 列表中添加任务本身" 的字段 Oct 1, 2024
@weinibuliu
Copy link
Contributor Author

感觉比起新增字段,不如规定一个任务"Self"来代表任务自己,这样就可以灵活的部署在任何自己需要的地方。
但这样子就和手动添加自身几乎没有什么区别了()
毕竟默认值的行为是override而不是append

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants