This page contains a rough collection of notes for people wanting to build Funnel from source and/or edit the code.
-
Install Go 1.21+. Check the version with
go version. -
Ensure GOPATH is set. See the docs for help. Also, you probably want to add
$GOPATH/binto yourPATH. -
Clone funnel and build
$ git clone https://github.com/ohsu-comp-bio/funnel.git $ cd funnel $ make -
Funnel is now downloaded and installed. Try
funnel version. -
You can edit the code and run
make installto recompile.
A Funnel development environment includes:
- Go 1.21+ for the majority of the code.
- Task Execution Schemas for task APIs.
- Protobuf + gRPC for RPC communication.
- gRPC Gateway for HTTP communication.
- Angular and SASS for the web dashboard.
- GNU Make for development tasks.
- Docker for executing task containers (tested with v1.12, v1.13).
- dep for Go dependency vendoring.
- Make for development/build commands.
- NodeJS and NPM for web dashboard development.
Most development tasks are run through make commands, including build, release, testing, website docs, lint, tidy, webdash dev, and more. See the Makefile for an up-to-date list of commands.
The Go static-analysis CI job runs errcheck for production code and tests,
including errors assigned to _. Handle errors that can affect results or
propagate them to the caller. Test setup and assertions must also check errors.
An intentional exception must be local and name the linter, with a concrete reason. For example, a read-only file close after a completed read may use:
_ = input.Close() //nolint:errcheck // Closing this read-only input cannot invalidate the bytes already read.CI rejects unexplained or nonspecific suppressions. Do not add package-wide exclusions, generic ignore-error helpers, or log-and-continue code merely to silence the check. A failed write, upload, parse, or state update normally needs handling. Expected rollback after commit and best-effort cleanup require an explicit decision at the call site.
Run make deadcode for the same check used by CI. It runs a pinned analyzer for
Linux/amd64 with tests included. It analyzes test entry points without executing
tests. Generated functions are excluded by the analyzer's default settings.
The existing findings are recorded in .github/deadcode-baseline.txt. New
findings fail CI for review. Unreachable code may represent unfinished wiring,
external API contracts, or obsolete functionality. The check never deletes code.
Wire up intended behavior or remove confirmed obsolete code. If a finding is
intentional, explain it in the pull request before adding it to the baseline.
Run make deadcode-update to refresh the baseline and review the diff. CI also
rejects stale entries when findings disappear, so the baseline can shrink.
Run all tests: make test
Run the worker tests: go test ./internal/worker/...
Run the worker tests with "Cancel" in the name: go test ./internal/worker -run Cancel
You get the idea. See the go test docs for more.
The testify and mockery tools are used to generate and use mock interfaces in test code, for example, to mock the Google Cloud APIs.
Releases are published by the Publish Funnel release workflow.
It runs when a v*.*.* tag is pushed, and also supports Run workflow or gh workflow run.
The workflow checks out the requested tag, rather than publishing the selected branch.
-
Merge the reviewed PR stack into
developand confirm its CI passes. -
Review
CHANGELOG.mdand the upgrade guide. Include import migrations, configuration migrations, and the requirement to rebuild net/rpc plugins with the host. No Makefile version edit is needed: release versions come from tags. -
Choose an unused version. Check both Git tags and GitHub releases: an existing tag without a release still names older code. Do not move it to new code. In this repository
v0.12.0already exists. -
Before tagging, run
make snapshotor manually dispatch the Release packaging workflow on the candidate branch. Packaging is not a pull-request check. This builds archives and checksums without publishing. Extract the native archive into a temporary directory and checkfunnel version,funnel --help, and basic task execution. Check thatdocs/upgrading.mdis included. Snapshot versions include a development suffix. -
Create an RC tag on the reviewed commit, for example
git tag -a vNEXT-rc.1 -m 'Release candidate', replacingNEXTwith the chosen numeric version. Pushing the tag triggers publication immediately. RC tags become GitHub prereleases. -
To validate an existing tag without publishing, select Run workflow, enter its tag, and leave dry_run enabled. The archives are retained as workflow artifacts. From the CLI:
gh workflow run release.yaml --repo calypr/funnel --ref develop \ -f tag=vNEXT-rc.1 -F dry_run=true
The workflow must first be available on the repository's default branch for GitHub to offer manual dispatch. For a local tag that has not been pushed, use the local snapshot check instead.
-
Test the RC using
bash install.sh vNEXT-rc.1 /tmp/funnel-rc-binfrom a temporary working directory. Check the reported version and run a representative task with your deployment configuration. -
Tag the validated commit with the final version and push that tag. The release is published automatically, not saved as a draft. If retrying publication for an existing tag manually, set dry_run to false. Inspect existing assets first; do not overwrite a published version with different code.
The separate container workflow publishes multi-architecture images to
quay.io/ohsu-comp-bio/funnel on pushes. Stable version tags update latest;
RC tags do not. Verify the image workflow as well as the binary release workflow.
Manual binary publication does not rerun the container workflow.
make release also publishes from a clean tagged checkout using GITHUB_TOKEN.
Prefer the GitHub workflow for publication. Release notes come from the reviewed Unreleased section of CHANGELOG.md.
Both local and CI packaging use the
GoReleaser version pinned in the Makefile and its explicit executable path.