Skip to content

Change default task mode to 'before' for better dependency handling #2551

Description

@domenkozar

Issue

When running a task that has dependencies (via before/after configurations), the dependent tasks don't run by default unless explicitly using --mode before.

Example

Given this configuration:

tasks = {
  "admin:build" = {
    exec = ''
      npm install
      npm run build
    '';
    cwd = "${config.git.root}/services/admin";
    before = [ "admin:deploy" ];
  };
  "admin:deploy" = {
    exec = ''
      some_deploy_command
    '';
    after = [ "admin:build" ];
  };
};

When running devenv tasks run admin:deploy, the build task doesn't run, breaking the deployment.

Workaround: Use devenv tasks run admin:deploy --mode before

Proposed Solution

Change the default task execution mode from the current default to --mode before so that task dependencies are respected by default. This would be more intuitive for users defining task dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions