dagucloud / dagucloud/dagu

Optional environment inheritance for sub-DAGs

Open
#1,812 0 comments 2 reactions 0 assignees View on GitHub
wishlist
Dominant language
Go
Stars
4k
Forks
337
Avg merge
19h 26m
Merged PRs (30d)
133

Description

## Problem

Sub-DAGs do not inherit any environment variables from their parent. Every shared value (`TODAY`, `SINCE`, `GH_USER`, etc.) must be explicitly passed as a param. For workflows with many shared variables, this creates verbose and fragile parameter lists that must be kept in sync between parent and child.

## Expected Behavior

An opt-in mechanism to inherit parent environment variables in sub-DAGs, either all or a specified subset.

## Example

```yaml
# Selective inheritance
- id: fan_out
call: child-dag
inherit_env: [TODAY, SINCE, GH_USER]
parallel: ${ORGS}

# Or inherit all
- id: fan_out
call: child-dag
inherit_env: true
parallel: ${ORGS}
```

## Motivation

Complex workflows often share configuration across parent and child DAGs (dates, usernames, API tokens, paths). Explicitly passing each one as a param is tedious and error-prone — adding a new shared variable requires updating both the parent's `params:` and the child's `params:` definition. This is the documented pitfall "Sub-DAGs do not inherit parent env vars" but could be solved with an opt-in mechanism that preserves the current safe default.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the sub-DAG call path described in the issue and how parent environment variables and params are handled. Define the behavior for inherit_env as a variable list or true while preserving the current default, then add tests covering selective inheritance, all-variable inheritance, and omitted inheritance.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.