zedpm

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 2 Imported by: 0

README

ZedPM

ZedPM aims to be a general purposes project management tool aimed at helping developers maintain their various and sundry Golang projects with minimal effort and thinking, and no Makefiles for common tasks, but with massive amounts of raw power.

Dr. McKay: ...And we'll need the Zed-P-M.
Gen. O'Neill: What?
Dr. Jackson: The ZPM. He's...he's Canadian.
Gen. O'Neill: (at McKay) I'm sorry.
Dr. McKay: The Zero Point Module, General. The ancient power source you recovered from Proclarush Toanas and that's now powering the outpost defenses. I've since determined it generates its enormous power from vacuum energy derived from a self-contained region of subspace time.
Gen. O'Neill: That was a waste of a perfectly good explanation.

Stargate Atlantis, Season 1, Episode 1, "Rising, Part 1"

Solving Common Problems

This tool aims at solving common problems in a way that lets developers run self-documenting commands that do the right thing. Since any two developers will likely disagree on the correct way to do these things and, depending on aspects of a project like what kind of deliverables it produces, how it used, the target audience, and so on, TheRightWay™ varies from project to project. However, the goals you want to achieve are largely the same:

  • Every project needs to be checked for correctness: syntax needs to be checked, anti-patterns need to be detected, and semantics need to be verified.
  • Many projects need to generate some section of their code.
  • Any serious project needs a release process. Libraries need to be tagged so that godoc sites can index them. Client-side applications need to generate binaries that can be downloaded and installed. Server-side applications need to push container images. And so on.
  • Creating projects requires a common set of boilerplate that is tedious to setup every time. Typically a project needs to have git setup, go mod init run, a Changes file, a README, a license, maybe some common boilerplate code based on the kind of application or library, etc. It'd be nice if there was a tool that could at least get you past crawling and to the walking phase whenever starting a new prototype or project.

This tool aims at doing all of these things.

Goals, Tasks, and Plugins, Oh my!

The tool operates by executing goals. Each goal is made up of a number of tasks. These tasks are provided by plugins. The plugins are chosen and configured by you. For complex projects, plugins can also be configured to perform the same goal with multiple configurations by having configured targets.

Common Goals

Here are listed the common goals that are built-in to zedpm. Any plugin may define additional goals, if desired.

Init (not yet implemented)

The init goal will initialize a new project and fill it with standard boilerplate and initialize files and configurations.

Generate (not yet implemented)

The generate goal is will take source code in one form and generate it in another. This is useful for building gRPC stubs, web sites built using node-based tooling (or whatever), embedding files and resources, generating ORM code, etc.

Build (not yet implemented)

The build goal will check the syntax of the source code and ensure that it will run. It will not guarantee that the code runs correctly and will not generate source code from other source code.

Lint

Linting runs programs that perform correctness checks against your code and other files. This can run a static analyzer to verify that your code does not implement certain anti-patterns that are prone to cause bugs.

Test

Testing runs some set of test suites against the project to verify that the code is working correctly.

Request (not yet implemented)

Request (a.k.a., pull-request or merge-request) is the act of declaring that some set of changes is ready to be considered for merger into some other target branch (usually main or master) of the project.

Install (not yet implemented)

The install goal will build local artifacts and install them. This is intended to be a helper to allow binaries and other artifacts to be installed as part of the development process.

Release

Releasing is the process of tagging a set of changes and setting up the release process.

Deploy (not yet implemented)

Deploy will construct and deliver artifacts to a destination, such as Docker Hub or another container repository.

Info

Info retrieves information about the project and can be used to either query the state of the application or provide zedpm plugin derived information to other tooling.

Built-in Plugins

The zedpm project has the following built-in plugins:

zedpm-plugin-changelog

This provides tasks for linting the correctness of a changelog, for extracting the changes related to a given release version, and for preparing and fixing the changelog for release.

This is currently done according to an opinionated format that is subject to change in the future.

zedpm-plugin-git

This provides tasks for creating a release branch and tagging the release according to a semantic version.

zedpm-plugin-github

This provides tasks for creating pull requests during release, awaiting for CI/CD tests to complete successfully, merging the pull request, and creating the release.

zedpm-plugin-go

This provides tools for accessing aspects of the go command for various zedpm commands.

zedpm-plugin-goals

This provides the definition for the zedpm built-in goals and related support code and tasks.

Inspiration

At this time, I think it would be wrong for me not to mention that this project was inspired by other tools. I spent most of the past 20 years working in the Perl programming language. When I came to Golang, one thing became immediately apparent: while the go command itself does slightly more and useful things than the perl command, it is vastly inadequate for performing the full range of common dev tasks. The Perl community built rich project management tools aimed at enabling developers to quickly and easily build new prototypes, check the code for correctness, and release that code for others to use.

Tools like ExtUtils::MakeMaker, Module::Build, and Dist::Zilla provided much of the inspiration for this tool. ExtUtils::MakeMaker is a very old tool that allows you to quickly generate an entire Makefile customized for your project based upon configuration contained in a simple Perl program. Module::Build extended this to alleviate the need for the Makefile when such was unnecessary. And Dist::Zilla provided additional tools for managing module dependencies, releasing and deploying software, and generating boilerplate, such as ensuring that all source files have the latest license attached or that each have complete and correctly formatted documentation.

These tools went a long way to ensuring that Perl developers did not waste a lot of time remembering commands, mucking about with esoteric Makefile syntax, and generally wasting their time on the more tedious aspects of developing a library or application.

Copyright 2023 Andrew Sterling Hanenkamp.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package cmd contains the command-line tooling.
Package cmd contains the command-line tooling.
Package config defines the structure of zedpm configuration and defines the functions for leading that configuration.
Package config defines the structure of zedpm configuration and defines the functions for leading that configuration.
Package format defines string formatting utilities.
Package format defines string formatting utilities.
pkg
changes
Package changes contains tools for working with change logs written in a particular format.
Package changes contains tools for working with change logs written in a particular format.
git
Package git provides shared tooling that other plugins can use to interact with the git repository consistently with other git plugins.
Package git provides shared tooling that other plugins can use to interact with the git repository consistently with other git plugins.
github
Package github provides shared tooling to allow zedpm plugins to interact with Github in a consistent way.
Package github provides shared tooling to allow zedpm plugins to interact with Github in a consistent way.
goals
Package goals provides tools for working with plugin goals and defining the built-in goals.
Package goals provides tools for working with plugin goals and defining the built-in goals.
log
storage
Package storage is a utility package that allows zedpm to conveniently slice and dice shared properties between plugins.
Package storage is a utility package that allows zedpm to conveniently slice and dice shared properties between plugins.
Package plugin is the container for all things plugins.
Package plugin is the container for all things plugins.
api
Package api defines the gRPC interface plugins use over the wire.
Package api defines the gRPC interface plugins use over the wire.
grpc/client
Package client implements the gRPC client used by the zedpm master process to communicate with all the plugins.
Package client implements the gRPC client used by the zedpm master process to communicate with all the plugins.
grpc/service
Package service implements the gRPC service for plugins so plugins can just implement the plugin.Interface and related interfaces.
Package service implements the gRPC service for plugins so plugins can just implement the plugin.Interface and related interfaces.
log
master
Package master implements the components for executing goals and sub-tasks across multiple plugins concurrently with proper interleaving and error handling.
Package master implements the components for executing goals and sub-tasks across multiple plugins concurrently with proper interleaving and error handling.
metal
Package metal provides the entry point for implementing the plugin system in a process.
Package metal provides the entry point for implementing the plugin system in a process.
translate
Package translate provides object translation to translate API objects into local plugin objects and vice versa.
Package translate provides object translation to translate API objects into local plugin objects and vice versa.
Package main runs the zedpm-plugin-changelog plugin.
Package main runs the zedpm-plugin-changelog plugin.
changelogImpl
Package changelogImpl provides the plugin implementation for the zedpm-plugin-changelog plugin.
Package changelogImpl provides the plugin implementation for the zedpm-plugin-changelog plugin.
Package main is the program for running the zedpm-plugin-changelog plugin.
Package main is the program for running the zedpm-plugin-changelog plugin.
gitImpl
Package gitImpl provides the implementation of the zedpm-plugin-git plugin.
Package gitImpl provides the implementation of the zedpm-plugin-git plugin.
Package main is the command that runs the zedpm-plugin-github plugin.
Package main is the command that runs the zedpm-plugin-github plugin.
githubImpl
Package githubImpl implements the zedpm-plugin-github plugin.
Package githubImpl implements the zedpm-plugin-github plugin.
goImpl
Package goImpl provides the implementaiton of the zedpm-plugin-go.
Package goImpl provides the implementaiton of the zedpm-plugin-go.
Package main is the command that runs the zedpm-plugin-goals plugin.
Package main is the command that runs the zedpm-plugin-goals plugin.
goalsImpl
Package goalsImpl implements the zedpm-plugin-goals plugin.
Package goalsImpl implements the zedpm-plugin-goals plugin.
Package ui manages the terminal and logs output for zedpm.
Package ui manages the terminal and logs output for zedpm.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL