Skip to content

Proposal: Adopt use of Taskfile as a replacement for Makefile in active projects #126

@joelanford

Description

@joelanford

I propose that we replace our Makefiles with Taskfiles to orchestrate builds and CI.

I propose this here because I think we should build a consensus across the organization so that we maintain consistency across projects. In my opinion, it is more important to have a consistent tool across projects so that contributors don't have to learn the nuances of each individual repository.

A few taskfile benefits I've noticed:

  • YAML-based schema, with a much smaller/simpler syntax than Makefile
  • notion of internal vs external tasks, tasks can use other tasks but those subtasks can be hidden from the task CLI
  • first-class, built-in support for grouped tasks (e.g. build:<buildTaskName>, test:<testTaskName>)
  • built-in documentation (both short one-liner and long-form paragraphs)
  • defer keyword that lets you execute commands/tasks before a task run ends.
  • developers can put their own custom tasks in Taskfile.yaml (and we could .gitignore it). The task cli picks those up automatically.

The most powerful aspect of Makefile is turning input files into output files efficiently, but we don't make use of that feature. Instead we mark all (or at least almost all) of our targets at PHONY and we use Go tooling (e.g. module and build artifact caching) to have efficient build times.

Here's an example PR of this in action in the operator-controller repo: operator-framework/operator-controller#137

Please upvote with 👍 or downvote with 👎 to state your position. And feel free to leave comments/questions/suggestions in the issue comments!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions