Conceptualizing Ideas for a Task V4 #694
Replies: 6 comments 14 replies
-
If you are making a hard fork, I recommend renaming your project (while still crediting its roots in Task of course). There should only be one Task, and that is the real Task which is maintained in this repository. A major version bump is not sufficient to differentiate your hard fork because the real Task may well bump to 4.x at some point as well. Please contribute back any work you do in your project which is aligned with the direction of the Task project. Do it early and often because once your code base has diverged significantly it will become more difficult. |
Beta Was this translation helpful? Give feedback.
-
Hi @ghostsquad, First of all, make sure you also enjoy your vacations and rest. Coding is secondary, life is priority. 🙂 That said, some thoughts:
There's a good number of opened PRs that could be reviewed already. Once you open yours, I'll try to give it some attention. 🙂 |
Beta Was this translation helpful? Give feedback.
-
I'll start dropping some hints & notes here.. the code is still very much a WIP. I've started this first with just defining structs, names, verbs, and go doc comments to describe the desired functionality I'm aiming for (ReadMe driven development). Implementations will come later. all of the new stuff currently exists under https://github.com/ghostsquad/task/tree/feat/v4/sdk Here would be a good place to start looking around. ** EDIT: 2022-04-06 - refactored to ✍️ Feedback is welcome! 😡 😐 😄 🧐 🤔 |
Beta Was this translation helpful? Give feedback.
-
I've been thinking about v4 roadmap for a while now as well, but been a bit too busy to write it down. I'll put my ideas into a separate post here for better threading. First, I think we and/or @andreynering needs to define the goal of the project if it's going to diverge from the existing one:
Adding features will probably make the tool more complex and harder to use, so I'm always careful of introducing new features. Specially if we want to keep that vision for task. If we do, I see v4 as a way to clean up some UX issues. One of the biggest problems seems to be the confusion and usability of variables and environment variables: how they are evaluated, when loaded, used in preconditions, inherited between included files etc. This is probably an area I'd rethink completely from scratch for something like v4. Second area which users (and I personally) seem to struggle with is task re-usability and modularity. There are known workarounds for most issues, but they are often cumbersome or require a lot of boilerplate code. As an example, a pattern I'm now using almost everywhere is to define reusable tasks without descriptions and higher level tasks calling those "internal" tasks for end users. Something like deploy:
preconditions:
- sh: test -n "{{ .env }}"
msg: "missing env variable"
cmds:
- sh script/deploy.sh {{ .env }}
dev:deploy:
desc: "deploy to dev"
cmds:
- task: deploy
vars:
env: dev But this gets very verbose and repetitive quite fast. It also pollutes the task list for the user (each deploy task is listed separately for each environment). Third area, somewhat related to the previous one, is passing generated/computed/calculated data or values around. There are no elegant solutions for it atm and it's often error prone, partially due to mvdan/sh implementation details. I've solved it using temporary files in That brings me to the last area which is the CLI part. Using task as a general purpose CLI builder would be pretty cool imo. So having a simple way to define tasks as
would allow users to build custom CLI's. Technically you can do that today, but the amount of boilerplate required makes it less attractive. To conclude, I think for v4 we should first define what are the main problems we'd like to solve there. Whether the solutions will be inspired by Github Actions, solved by lazy evaluation or more templating is secondary imho. |
Beta Was this translation helpful? Give feedback.
-
Oh.. I just found out that mentions of this discussion (from other issues) don't add links to those other issues here. 😭 |
Beta Was this translation helpful? Give feedback.
-
I've been looking at some really clean looking Makefiles recently. I think that's another reason I want to rename fields in v4. Just to cut down on the verbosity, without changing explicitness. Example: |
Beta Was this translation helpful? Give feedback.
-
I've been watching the discussions and issues rolling in. Taking a hard look at the current documentation and functionality, and I've decided that the best contribution I can make to Task is a re-envisioning. I'd like to keep task looking familiar, but some of these ideas will be backwards incompatible, thus, why I'm saying "v4".
I'm not quite ready to actually showcase anything yet. But I have a vacation from work coming up, nice 9 day vacation, which I intend on using to make progress on this. But I can say that I'm taking inspiration/functionality from several other tools which I'm familiar with:
uses
, andcontainer
fields/syntax.I would like to share more very soon. If you have any questions, let me know.
Beta Was this translation helpful? Give feedback.
All reactions