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

Ability to use a separate tasks file for dev environment #87

Open
valxntine opened this issue Jun 15, 2023 · 5 comments
Open

Ability to use a separate tasks file for dev environment #87

valxntine opened this issue Jun 15, 2023 · 5 comments

Comments

@valxntine
Copy link

Having tasks auto-documented by using xc is a strong selling point for the tool, however for projects/repo's with a huge amount of existing tasks, it's daunting to transition if you'd end up with a README that's 4 pages long.

There's currently the -f flag to point to a specific file to be used for running tasks, however I think a QoL addition would be to add a --dev flag that automatically looks at a specific dev tasks file (TASKS.dev.md for example).

Using a flag means it's obvious what's happening and we avoid conflicts with task names, such as if a team has a task dev and a subcommand was added for dev tasks (xc dev task1) there would be conflicts between the task and the subcommand and this could break some existing workflows.

@joerdav
Copy link
Owner

joerdav commented Jun 16, 2023

I'm a fan of this idea, I just want to make sure all the options have been thought about!

The things I'm thinking about when I'm looking at features for xc are:

  • Would the running of the task be convenient? (In this case yes, an additional flag isn't too bad)

  • Is it a pain to construct it? Nope, it's the same as other xc tasks but in a different file.

  • Is it digestable by a human that doesn't have xc installed? Potentially this is where this feature could make an effect. The tasks are no longer referenced from the README.md which is where this documentation would tend to live.

@joerdav
Copy link
Owner

joerdav commented Jun 16, 2023

Thinking about that third point, I wonder if a concept of sub commands could be a thing?

README.md

# Tasks
## dev
Subtasks: TASKS.dev.md
## task-1
```
echo "hello world"
```

TASKS.dev.md

# Tasks
## run
```
go run .
```

xc dev run

@joerdav
Copy link
Owner

joerdav commented Jun 22, 2023

Or maybe some top level attributes?:

README.md

# Tasks
Subtasks: dev = TASKS.dev.md
## task-1
```
echo "hello world"
```

TASKS.dev.md

# Tasks
## run
```
go run .
```

@joerdav
Copy link
Owner

joerdav commented Jun 22, 2023

Either way, I think this brings into question how multiple tasks files would interact.

Can you create a task dependancy between tasks? Can a sub task depend on a top level task? Etc etc

@waldyrious
Copy link
Contributor

IMO the subcommands formulation is easier to make sense of than a top-level attribute, and more scalable than a CLI option.

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

No branches or pull requests

3 participants