Documentation
¶
Overview ¶
Package cli implements the dexaflow command-line interface.
Index ¶
Constants ¶
const MaxWorkspaceDepth = 5
MaxWorkspaceDepth caps the recursion DiscoverProjects performs from the workspace root. <ws>/a/b/c/d/dag.py is the deepest allowed (depth 5); any project nested deeper is silently skipped. See docs/dag-authoring.md#discovery-rules for the rationale (workspace navigability + protection against pathological layouts).
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute() int
Execute runs the root command and returns a process exit code: 0 on success, the code an error carries (a followed run's result, see exitRunFailed), or 1 for any other error.
func NewRootCommand ¶
NewRootCommand builds the root dexaflow command with its global flags and subcommands.
Types ¶
type Project ¶
type Project struct {
// Path is the absolute path to the project directory containing dag.py.
Path string
// DagID resolves to the yaml's dag_id when present, else the subdir
// basename.
DagID string
// ConfigPath is the absolute path to dexaflow.yaml when one exists, or
// empty when DiscoverProjects synthesized auto-defaults. The lite watcher
// logs this on every compile so "which config did it pick up?" is
// greppable.
ConfigPath string
// HasYAML reports whether a dexaflow.yaml was present in the project dir.
HasYAML bool
// Config is the resolved, default-filled config for the project. Always
// non-nil; when HasYAML is false the struct holds the schema defaults
// plus DagID set to the subdir basename.
Config *domain.LeoflowConfig
}
Project is a single DAG project discovered in the workspace by DiscoverProjects. The fields are populated from dexaflow.yaml (when present) or synthesized from the subdirectory's basename otherwise.
func DiscoverProjects ¶
DiscoverProjects walks workspace and returns every directory containing a dag.py file (the project marker). Each project's config is the dexaflow.yaml in the same dir — loaded via loadProjectConfig so schema defaults apply — or, when no yaml exists, a synthesized LeoflowConfig with DagID set to the subdir basename and every other field at its schema default.
The walk caps at MaxWorkspaceDepth from the workspace root and skips both defaultExcludeDirs and any directory whose name begins with a dot. The workspace root itself counts as depth 0 — a root-level dag.py + dexaflow.yaml is still recognized as a project for backward compatibility with the single-DAG layout (recommended new layout is one project per subdir; see docs/dag-authoring.md).
If two discovered projects resolve to the same dag_id (whether from yaml or from the subdir-basename fallback), the function returns an error naming the id and every colliding path — per simple-reliable-then-grow the lite loop refuses to compile any of them rather than silently letting the latest tick clobber the previous one.
type WorkspaceSpec ¶
type WorkspaceSpec struct {
// Path is the absolute path of the workspace directory.
Path string
// Projects is every DAG project discovered under Path. Empty when the
// workspace is empty (caller is expected to scaffold a starter then).
Projects []Project
// RootCfg is a synthesized LeoflowConfig representing the workspace as a
// whole: the highest declared python_version and otherwise schema defaults.
// It carries no dependencies: Lite provisions one venv per DAG from each
// project's own `dependencies:` (ensureWorkspaceDagVenvs), so multi-DAG
// aware code paths iterate Projects instead.
RootCfg *domain.LeoflowConfig
// contains filtered or unexported fields
}
WorkspaceSpec is the resolved view of a Lite workspace: the list of DAG projects discovered under it plus a synthesized "root" config that single- cfg consumers (venv setup, image-build defaults) can still rely on without knowing about multi-DAG. The Path is the absolute workspace directory.
func ResolveWorkspace ¶
func ResolveWorkspace(dir string) (*WorkspaceSpec, error)
ResolveWorkspace scans the workspace directory and returns its full WorkspaceSpec. It is the single entry point lite uses to convert a directory into "the set of DAGs I am responsible for"; both the watcher and the compile loop call it on every reload.
Behavior:
- Walks subdirs via DiscoverProjects (max-depth 5, skips exclude_paths defaults + hidden dirs, fails loud on duplicate dag_id).
- Validates that every project's dependencies are pip specifiers, naming the project and the bad entry. Two projects pinning the same package to different versions is NOT an error: each DAG gets its own venv under ~/.dexaflow/dev/venvs/<dag_id>/ and its tasks run with that interpreter (#346, #1458), so the pins never meet (#1679).
- Synthesizes RootCfg with the highest PythonVersion (per-component numeric compare, so "3.10" > "3.9").
- Returns a non-nil RootCfg even when Projects is empty, so the caller can scaffold against schema defaults without an extra nil-check.
Discovery errors (e.g. duplicate dag_id) are propagated verbatim so the caller can surface every colliding path to the user.
func (*WorkspaceSpec) WatchedPaths ¶
func (w *WorkspaceSpec) WatchedPaths() []string
WatchedPaths returns the file paths the mtime-polling watcher should track: every project's dexaflow.yaml (when present) and dag.py. A save in any of them must trigger a reload, since lite recompiles+reregisters every project on each reload.
Source Files
¶
- admin.go
- admin_dags.go
- admin_drain.go
- admin_health.go
- admin_runs.go
- admin_users.go
- api_tokens.go
- backup.go
- backup_cmd.go
- build_digest.go
- build_imageref.go
- build_info.go
- build_inputs.go
- build_platform.go
- ci.go
- ci_oidc.go
- ci_token.go
- client_headers.go
- compile.go
- compile_build.go
- compile_ignored_fields.go
- compile_operators.go
- compile_python_deprecation.go
- config_file_secrets.go
- config_lock.go
- connections.go
- dag_version.go
- dags.go
- datastore.go
- db.go
- dbt_manifest.go
- deploy.go
- deploy_already.go
- deploy_changed.go
- deploy_cluster_defaults.go
- deploy_cluster_execution.go
- deploy_confirm.go
- deploy_connections.go
- deploy_execution.go
- deploy_follow.go
- deploy_links.go
- deploy_next.go
- deploy_output.go
- deploy_plan.go
- deploy_preflight.go
- deploy_source_mode.go
- deploy_task_pods.go
- deploy_watch.go
- dev.go
- dev_dag_removal.go
- dev_dag_venv.go
- dev_reconcile.go
- dev_setup.go
- discover.go
- docgen.go
- dockerfile_user.go
- dockerignore_match.go
- doctor.go
- doctor_pro.go
- dsn.go
- forget.go
- helpers.go
- init.go
- lite_key_boot.go
- lite_key_config.go
- lite_key_state.go
- lite_seed_connections.go
- login.go
- login_device.go
- login_sso.go
- managed_postgres.go
- migrate_key.go
- migrate_key_cmd.go
- migrate_key_steps.go
- promote.go
- push.go
- pysrc.go
- registry_auth.go
- registry_login.go
- reset_password.go
- restore_cmd.go
- rollback.go
- root.go
- runs.go
- runs_follow.go
- runs_logwriter.go
- setup.go
- split.go
- status.go
- status_report.go
- stubs.go
- sync.go
- sync_report.go
- target.go
- target_resolve.go
- token.go
- token_refresh.go
- token_server_hint.go
- uninstall.go
- uv.go
- validate.go
- variables.go
- version.go
- version_conflict_hint.go
- watch.go
- wheels.go
- workspace.go
- workspace_build.go
- workspace_cmd.go
- workspace_defaults.go
- workspace_file.go
- workspace_owner_unix.go
- write_atomic.go