Harness Open Source (Drone) — Dependencies#
Module info#
- Module:
github.com/harness/gitness - Go version: 1.25.8
- Direct dependencies: ~106
- Indirect dependencies: ~464 (go.sum has 1,141 lines = ~570 unique module entries; ~106 are direct)
Dependency categories#
Core infrastructure#
github.com/rs/zerolog— Structured, zero-allocation logging; the primary logger throughoutapp/github.com/sirupsen/logrus— Secondary logger, present due to Drone runner ecosystem depsgithub.com/go-logr/logr+github.com/go-logr/zerologr— logr bridge shim so zerolog satisfies controller-runtime’s logger interfacegithub.com/kelseyhightower/envconfig— Environment-variable config parsing (config structs tagged withenvconfig:)github.com/joho/godotenv—.envfile loading for local developmentgithub.com/pelletier/go-toml/v2— TOML config format supportgithub.com/google/wire— Compile-time dependency injection; central to the 2,500-file codebase (seecmd/gitness/wire_gen.go)gopkg.in/alecthomas/kingpin.v2— CLI framework (notably not Cobra; inherited from the classic Drone era)github.com/gorhill/cronexpr— Cron expression parsing for pipeline schedulingcloud.google.com/go/profiler— Continuous profiling integration with GCP Cloud Profilergithub.com/posthog/posthog-go— Product analytics / usage telemetrygithub.com/prometheus/client_golang— Prometheus metrics expositiongithub.com/fatih/color+github.com/mattn/go-isatty— Colored CLI output with TTY detection
Networking/HTTP#
github.com/go-chi/chi/v5— Primary HTTP router for all REST API endpointsgithub.com/go-chi/cors— CORS middleware for the REST APIgithub.com/gorilla/mux— Secondary router used by the OCI registry subsystem (registry/)github.com/unrolled/secure— Security header middleware (HSTS, XSS, CSP)github.com/gliderlabs/ssh— Native SSH server for git-over-SSH accessgithub.com/golang-jwt/jwt/v5— JWT issuance and validation for authenticationgolang.org/x/oauth2— OAuth2 flows for SCM provider integrationsgoogle.golang.org/api— Google API client (Drive, GCS, etc.)github.com/sercand/kuberesolver/v5— Kubernetes-aware DNS resolver for gRPC load balancinggithub.com/ProtonMail/go-crypto— OpenPGP/GPG support for verified git commitsgolang.org/x/crypto— TLS, SSH, and bcrypt primitivesgolang.org/x/net— Extended networking (HTTP/2, DNS, etc.)gopkg.in/mail.v2— Email sending (notifications, invites)
Data/Storage#
github.com/jmoiron/sqlx— SQL query scanning with struct tags; the primary DB access layergithub.com/Masterminds/squirrel— SQL query builder for dynamic queriesgithub.com/lib/pq— PostgreSQL driver (libpq-based)github.com/jackc/pgx/v5— Pure-Go PostgreSQL driver (used alongsidelib/pqfor specific pgx features)github.com/jackc/pgerrcode— PostgreSQL error code constants for constraint handlinggithub.com/mattn/go-sqlite3— SQLite driver (CGo) for single-node / development deploymentsgithub.com/golang-migrate/migrate/v4— Schema migration runner (supports both Postgres and SQLite)github.com/maragudk/migrate— Secondary migration library (used inregistry/)github.com/go-redis/redis/v8— Redis client for caching and pub/subgithub.com/go-redsync/redsync/v4— Redis-backed distributed mutex (used inlock/)github.com/hashicorp/golang-lru/v2— In-memory LRU cache (git objects, ACL results)cloud.google.com/go/storage— Google Cloud Storage for blob/artifact storagegithub.com/aws/aws-sdk-go— AWS SDK for S3-compatible artifact storagegithub.com/djherbis/buffer+github.com/djherbis/nio/v3— Async pipe buffers for git pack-stream handlingoras.land/oras-go/v2— OCI Artifact push/pull (ORAS) for the artifact registrygithub.com/opencontainers/go-digest+github.com/opencontainers/image-spec— OCI content addressabilitygithub.com/distribution/distribution/v3— Docker registry v2 protocol implementationgithub.com/docker/distribution— Legacy Docker distribution (transitional; used by runner deps)github.com/guregu/null— Nullable SQL types (null.String, null.Int) for schema mappinggithub.com/klauspost/compress— High-performance compression for OCI layer handlinggithub.com/sassoftware/go-rpmutils— RPM package parsing for the artifact registry
Drone / CI pipeline heritage#
github.com/drone-runners/drone-runner-docker— The Docker pipeline runner (executes steps in containers)github.com/drone/drone-go— Drone API client SDKgithub.com/drone/drone-yaml— Drone pipeline YAML parser and lintergithub.com/drone/funcmap— Template helper functions for pipeline variable substitutiongithub.com/drone/go-convert— Converts between Drone YAML versions and Harness pipeline formatgithub.com/drone/go-generate— Pipeline YAML generation utilitiesgithub.com/drone/go-scm— Multi-provider SCM abstraction (GitHub, GitLab, Gitea, Bitbucket, etc.) — one of the most reused Drone libraries in the ecosystemgithub.com/drone/runner-go— Shared runner framework (polling, step execution, logging)github.com/drone/spec— Drone pipeline spec definitionsgo.starlark.net— Starlark scripting language for pipeline definitions (like Bazel’s BUILD files)github.com/google/go-jsonnet— Jsonnet templating for pipeline configuration
API / Serialization#
github.com/swaggest/openapi-go— OpenAPI 3.x spec generation from Go handlers (Harness uses this for the public API)github.com/swaggest/swgui— Embedded Swagger UIgithub.com/swaggo/http-swagger+github.com/swaggo/swag— Alternative Swagger 2.0 docs (used in some sub-areas)github.com/getkin/kin-openapi— OpenAPI spec validation at runtimegithub.com/oapi-codegen/runtime— Runtime types for oapi-codegen-generated clientsgithub.com/swaggest/jsonschema-go— JSON Schema type generationgithub.com/tidwall/jsonc— JSON with comments (for relaxed config files)gopkg.in/yaml.v3— YAML marshaling (pipeline files, config)github.com/pelletier/go-toml/v2— TOML (config alternative)github.com/yuin/goldmark— Markdown-to-HTML rendering (README display)golang.org/x/text— Unicode / text normalization
Testing#
github.com/stretchr/testify— Universal assertion library (assert,require,mock)github.com/onsi/ginkgo/v2+github.com/onsi/gomega— BDD-style tests (primarily inregistry/)github.com/google/go-cmp— Deep equality comparison for complex struct diffsgithub.com/tsenart/vegeta/v12— HTTP load testing library (performance benchmarks)
Other notable#
github.com/google/uuid+github.com/rs/xid+github.com/matoous/go-nanoid(both v1 and v2) +github.com/dchest/uniuri— Four different ID generation libraries, each adopted by different subsystems at different times; suggests organic growth without ID strategy consolidationgithub.com/Masterminds/semver/v3+github.com/coreos/go-semver— Two semver libraries serving different subsystemsgithub.com/hashicorp/go-multierror+go.uber.org/multierr— Two multi-error aggregation librariesgithub.com/pkg/errors— Legacy error wrapping (pre-Go 1.13 style; kept for drone/* compatibility)github.com/zricethezav/gitleaks/v8— Secret scanning for git push protectiongithub.com/harness/harness-migrate— Data migration from Drone/GitHub/GitLab to Harness Open Sourcegithub.com/bmatcuk/doublestar/v4— Glob pattern matching (.gitignore-style path rules)golang.org/x/sync—errgroup,singleflightfor concurrent operationsgolang.org/x/exp— Experimental generics (slices,maps) before stdlib promotiongolang.org/x/mod— Go module path parsing
Stdlib reliance#
The project makes heavy use of stdlib alongside third-party packages. In the app/ subtree alone:
context— 716 file-level imports (present in nearly every file)fmt— 582 importsnet/http— 364 importstime— 205 importsencoding/json— 184 importsstrings— 129 importserrors— 87 imports (modernerrors.Is/errors.Asstyle)io— 47 importsdatabase/sql— 16 imports (mostly viasqlxon top)
The project uses stdlib’s net/http server, database/sql interfaces, and io.Reader/io.Writer contracts pervasively. Third-party libs layer on top of stdlib rather than replacing it. The dual context+errors pattern (stdlib-first) is dominant.
Shared dependencies#
Dependencies commonly shared with other projects in the 50-project research set:
| Dependency | Shared with |
|---|---|
github.com/go-chi/chi/v5 | Numerous modern Go REST APIs |
github.com/rs/zerolog | Caddy, Gitea, and others |
github.com/stretchr/testify | Near-universal across all 50 projects |
github.com/google/uuid | Near-universal |
github.com/prometheus/client_golang | Kubernetes, Consul, Vault, Nomad, and most infrastructure projects |
github.com/golang-jwt/jwt/v5 | Most authentication-bearing services |
github.com/go-redis/redis/v8 | Projects with caching/pub-sub needs |
golang.org/x/crypto | Ubiquitous in any project with auth or git |
gopkg.in/yaml.v3 | Near-universal in config-heavy projects |
github.com/google/wire | Large projects needing DI (Vault, some Google projects) |
github.com/docker/docker | Projects in the container ecosystem |
github.com/hashicorp/go-multierror | HashiCorp projects (Vault, Consul, Terraform, Nomad) |
go.starlark.net | Bazel ecosystem projects, some CI tools |
github.com/drone/go-scm | Gitea, other CI projects |
Vendoring#
No vendor directory. The project relies on the Go module proxy and local replace directives only. The one exception is:
replace github.com/harness/gitness/registry => ./registryThis replaces the registry sub-module with a local path, enabling the OCI registry to be developed as a semi-independent module while still being compiled into the monolithic binary. This is a workspace-style pattern without a full go.work file.
Notable dependency decisions#
Kingpin over Cobra — The CLI uses
kingpin.v2rather than Cobra, reflecting the project’s Drone lineage. This is unusual in 2024+ Go projects where Cobra dominates. It creates minor friction when users expect--helpflag behavior consistent with Cobra-based tools.Two PostgreSQL drivers in parallel — Both
lib/pq(CGo) andjackc/pgx/v5(pure Go) are direct dependencies.lib/pqis the primarydatabase/sqldriver used bysqlx;pgx/v5is used directly for specific features (LISTEN/NOTIFY, pgx’s bulk copy). This represents an in-progress migration that hasn’t fully landed.Four ID generation libraries —
uuid,xid,go-nanoid(×2), anduniuriall generate unique identifiers but were adopted by different teams at different times. The duplication reflects the cost of platform consolidation across formerly separate subsystems.Drone ecosystem lock-in — Eight
github.com/drone/*packages are direct dependencies. This gives the project access to battle-tested CI primitives but means the pipeline subsystem is tightly coupled to Drone’s ecosystem choices (YAML schema, runner protocol, SCM abstraction model).Two semver and two multi-error libraries —
Masterminds/semverandcoreos/go-semvercoexist, as dohashicorp/go-multierroranduber/multierr. These duplicates arise because different sub-modules (OCI registry vs. core app) were developed independently and brought their own preferences, then merged without rationalization.Starlark as a scripting language — Adding
go.starlark.netas a direct dependency is a deliberate architectural choice to use Starlark (Python-like, deterministic, sandboxed) rather than Go templates or Jsonnet for complex pipeline generation. It signals aspiration toward a programmable CI model similar to Bazel.OpenAPI tooling proliferation — Three distinct Swagger/OpenAPI packages (
swaggest/openapi-go,swaggo/swag,getkin/kin-openapi) are all direct deps, suggesting the API documentation strategy has evolved over time and different parts of the codebase adopted different tools without unification.