Skip to content

feat: expose ctx.task.name and ctx.task.group in TaskContext#946

Closed
thesayyn wants to merge 1 commit intomainfrom
feat/ctx-task-info
Closed

feat: expose ctx.task.name and ctx.task.group in TaskContext#946
thesayyn wants to merge 1 commit intomainfrom
feat/ctx-task-info

Conversation

@thesayyn
Copy link
Member

Summary

  • Adds a new TaskInfo Starlark type (engine/task_info.rs) with name: string and group: list[string] attributes
  • Exposes it as ctx.task on both the mutable TaskContext and its frozen counterpart FrozenTaskContext
  • Populates TaskInfo from ConfiguredTask.get_name() / get_group() at task execution time in both execute_task() and execute_task_with_args()
  • Registers TaskInfo in the global type registry so it appears in Starlark type introspection

Usage

def impl(ctx: TaskContext):
    print(ctx.task.name)   # e.g. "deploy"
    print(ctx.task.group)  # e.g. ["dangerous", "release"]

my_task = task(
    name = "deploy",
    group = ["dangerous", "release"],
    implementation = impl,
)

Test plan

  • cargo build -p axl-runtime compiles clean
  • test_task_info added to .aspect/axl.axl asserts ctx.task.name == "axl" and ctx.task.group == ["tests"] against the live task declaration

🤖 Generated with Claude Code

@thesayyn thesayyn closed this Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant