Skip to content

enhancement: Add a Makefile for the build, test, lint and release commands #16

Closed

Description

@nabil1440

Blocker: no. This is not a defect. The team adds it on top of the blocker stack, because the server-monitoring work uses these commands each day.

Defect

  • The repository has no single entry point for developer commands.
  • To build, a developer runs go build and must add the version -ldflags manually. Only build.sh has these flags.
  • build.sh always builds all release platforms. It has no other tasks.
  • The checks are separate commands: go vet, go test -race, golangci-lint and govulncheck. The documentation does not list them.
  • CI does not run the checks, because the team skipped enhancement(ci): add checks for pull requests and replace the archived release actions #7. Thus each developer must remember all checks before each merge.
  • A golangci-lint binary from a package manager can use an older Go version than the module. Test: Homebrew golangci-lint 2.12.2 (built with Go 1.26) on this module after bug: Build with a supported Go version and make static binaries #6. Result: the Go language version (go1.26) used to build golangci-lint is lower than the targeted Go version (1.27.1).
  • The migration-agent repository uses make build, make test, make lint and make release. This repository uses different commands for the same tasks.

Cost

  • Developers type long commands. A developer can build a binary without the version by mistake.
  • A developer can merge a change without a check, because no single command runs all checks.
  • A lint tool from a package manager can stop when the Go version of the module changes.
  • Developers who work on the two repositories must learn two sets of commands.

Benefit of the fix

  • One command does each task: make build, make test, make lint, make vuln, make check and make release.
  • make check is the local gate before each merge. Each developer runs the same checks.
  • The Makefile sets the versions of golangci-lint and govulncheck and builds them with the Go version of the module. Thus the tools always agree with the module.
  • The commands agree with the migration-agent repository.

Fix

  1. Add a Makefile with these targets:
    • build: build bin/fly for the local platform. Stamp the version, the commit and the date from git.
    • test: go test ./... -race -count=1.
    • lint: golangci-lint run, with a fixed version, through go run.
    • vuln: govulncheck ./..., with a fixed version, through go run.
    • fmt: gofmt -w ..
    • check: a gofmt check, go vet, lint, test and vuln.
    • release: static linux/amd64 and linux/arm64 binaries, their archives and checksums.txt in build/. VERSION replaces the version from git.
    • clean: remove bin/ and build/.
  2. Change build.sh to a small wrapper that runs make release. The release workflow calls build.sh, and the team skipped enhancement(ci): add checks for pull requests and replace the archived release actions #7.
  3. Document the targets in the README.

Caution

CAUTION: DO NOT CHANGE THE NAMES OR THE CONTENTS OF THE RELEASE ASSETS. IF YOU CHANGE THEM, THE INSTALLED CLIS CANNOT RUN fly update.

  • make release must make the same archives as build.sh: fly-linux-<arch>.tar.gz, with the binary fly-linux-<arch> in it.

Differences from migration-agent

Completion checks

  • make build makes bin/fly, and bin/fly version shows the git version.
  • make check passes on the full stack.
  • make release makes the same archive names and contents as build.sh before this change.
  • The static-binary checks from bug: Build with a supported Go version and make static binaries #6 pass for make release.
  • make release VERSION=v9.9.9 stamps v9.9.9.
  • ./build.sh still makes the release archives.

Activity

  1. added a commit that references this issue on Sep 22, 2026
    f5969fc
  2. changed the title [-]Add a Makefile for the build, test, lint and release commands[/-] [+]enhancement: Add a Makefile for the build, test, lint and release commands[/+] on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions