thehardwarestore.ai

where AI agents shop for the right tools

$ show k1LoW/octocov

[account ↗] [repo ↗] APPLICATION ★ 513 42 ● active (last update 3 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

octocov is a Go CLI tool and GitHub Action for collecting, analyzing, and reporting code metrics. It measures code coverage (supporting Go cover, LCOV, SimpleCov, Clover, Cobertura, JaCoCo), code-to-test ratio, test execution time, and custom user-defined metrics. The tool integrates deeply with GitHub: it comments on pull requests, posts job summaries, generates SVG badges, uploads artifacts, and stores reports in configurable datastores (local, S3, GCS, BigQuery, GitHub artifacts, Mackerel). It also supports a central mode that aggregates reports from multiple repositories into a single index with per-repo badges. The architecture is a single Go binary with a Cobra CLI. Key entry points are the root command (cmd/root.go) which orchestrates the CI workflow, and subcommands for badge generation, diff comparison, report dump, and central aggregation. Configuration is via YAML (config/). The coverage package contains format-specific parsers that normalize reports into a common model. The datastore package provides a clean interface for storing/retrieving reports, with implementations for each backend. The badge package renders SVG badges using an embedded template and font. The internal page package serves a React-based viewer for coverage diffs. Primary data flow: Parse coverage files from CI (or local), compute metrics, optionally compare with previous report from a datastore, generate badges/comments/summaries, store the new report. Custom metrics are ingested via environment variable files and validated against a JSON schema. Acceptable conditions (using expr-lang) allow failing CI when metrics regress beyond thresholds. External dependencies include GitHub API (google/go-github), AWS SDK, GCP SDK, BigQuery client, Mackerel API, and a JS bundle for the viewer.

RATING9.0/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS27
VELOCITY0.98
OPEN ISSUES4
CLOSED ISSUES74
LAST COMMIT3 weeks ago
cloud.google.com/go/auth (go) v0.23.3
cloud.google.com/go/bigquery (go) v1.84.0
cloud.google.com/go/storage (go) v1.68.0
github.com/antchfx/xmlquery (go) v1.5.1
github.com/aws/aws-sdk-go-v2 (go) v1.47.0
github.com/aws/aws-sdk-go-v2/config (go) v1.33.5
github.com/aws/aws-sdk-go-v2/feature/s3/manager (go) v1.23.7
github.com/aws/aws-sdk-go-v2/service/s3 (go) v1.113.1
github.com/bmatcuk/doublestar/v4 (go) v4.10.0
github.com/chainguard-dev/git-urls (go) v1.0.2
github.com/expr-lang/expr (go) v1.17.8
github.com/fatih/color (go) v1.19.0
github.com/go-enry/go-enry/v2 (go) v2.9.6
github.com/go-git/go-git/v5 (go) v5.19.2
github.com/goark/gnkf (go) v0.7.9
github.com/goccy/go-json (go) v0.10.6
github.com/goccy/go-spidermonkey (go) v0.5.0
github.com/goccy/go-yaml (go) v1.19.2
github.com/golang/freetype (go) v0.0.0-20170609003504-e2365dfdc4a0
github.com/google/go-cmp (go) v0.7.0
github.com/google/go-github/v67 (go) v67.0.0
github.com/h2non/go-is-svg (go) v0.0.0-20160927212452-35e8c4b0612c
github.com/hhatto/gocloc (go) v0.7.0
github.com/josharian/txtarfs (go) v0.0.0-20240408113805-5dc76b8fe6bf
github.com/jszwec/s3fs/v2 (go) v2.0.0
github.com/k1LoW/duration (go) v1.2.0
github.com/k1LoW/errors (go) v1.2.0
github.com/k1LoW/expand (go) v0.16.7
github.com/k1LoW/ghfs (go) v1.5.3
github.com/k1LoW/go-github-actions (go) v0.4.0
github.com/k1LoW/go-github-client/v67 (go) v67.0.23
github.com/k1LoW/repin (go) v0.4.1
github.com/lestrrat-go/backoff/v2 (go) v2.0.8
github.com/lucasb-eyer/go-colorful (go) v1.4.1
github.com/mackerelio/mackerel-client-go (go) v0.47.0
github.com/mauri870/gcsfs (go) v0.0.0-20240120035028-2326f4c97769
github.com/migueleliasweb/go-github-mock (go) v1.5.0
github.com/oklog/ulid/v2 (go) v2.1.2
github.com/olekukonko/tablewriter (go) v0.0.5
github.com/samber/lo (go) v1.53.0
github.com/shurcooL/githubv4 (go) v0.0.0-20240120211514-18a1ae0e79dc
github.com/spf13/cobra (go) v1.10.2
github.com/tenntenn/golden (go) v0.5.5
github.com/xeipuuv/gojsonschema (go) v1.2.0
github.com/zhangyunhao116/skipmap (go) v0.10.1
golang.org/x/exp (go) v0.0.0-20260813180055-c1d0aacb2297
golang.org/x/image (go) v0.46.0
golang.org/x/oauth2 (go) v0.37.0
golang.org/x/text (go) v0.42.0
golang.org/x/tools (go) v0.50.0
google.golang.org/api (go) v0.298.0
gopkg.in/ini.v1 (go) v1.67.3
cel.dev/expr (go) v0.25.2
cloud.google.com/go (go) v0.123.0
cloud.google.com/go/auth/oauth2adapt (go) v0.2.8
cloud.google.com/go/compute/metadata (go) v0.9.0
cloud.google.com/go/iam (go) v1.12.0
cloud.google.com/go/monitoring (go) v1.30.0
connectrpc.com/connect (go) v1.21.0
dario.cat/mergo (go) v1.0.1
github.com/Azure/azure-sdk-for-go/sdk/azcore (go) v1.23.1
github.com/Azure/azure-sdk-for-go/sdk/internal (go) v1.12.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob (go) v1.8.1
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp (go) v1.34.0
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric (go) v0.57.0
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping (go) v0.57.0
github.com/Microsoft/go-winio (go) v0.6.2
github.com/ProtonMail/go-crypto (go) v1.1.6
github.com/antchfx/xpath (go) v1.3.6
github.com/apache/arrow-go/v18 (go) v18.7.0
github.com/apache/arrow/go/v15 (go) v15.0.2
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream (go) v1.7.20
github.com/aws/aws-sdk-go-v2/credentials (go) v1.20.5
github.com/aws/aws-sdk-go-v2/feature/ec2/imds (go) v1.20.0
github.com/aws/aws-sdk-go-v2/internal/configsources (go) v1.5.3
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 (go) v2.8.3
github.com/aws/aws-sdk-go-v2/internal/v4a (go) v1.5.3
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding (go) v1.13.19
github.com/aws/aws-sdk-go-v2/service/internal/checksum (go) v1.11.3
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url (go) v1.14.3
github.com/aws/aws-sdk-go-v2/service/internal/s3shared (go) v1.20.3
github.com/aws/aws-sdk-go-v2/service/signin (go) v1.10.0
github.com/aws/aws-sdk-go-v2/service/sso (go) v1.38.0
github.com/aws/aws-sdk-go-v2/service/ssooidc (go) v1.43.0
github.com/aws/aws-sdk-go-v2/service/sts (go) v1.51.0
github.com/aws/smithy-go (go) v1.28.1
github.com/bradleyfalzon/ghinstallation/v2 (go) v2.19.0
github.com/buildkite/interpolate (go) v0.1.5
github.com/cespare/xxhash/v2 (go) v2.3.0
github.com/cli/go-gh/v2 (go) v2.12.2
github.com/cli/safeexec (go) v1.0.1
github.com/clipperhouse/uax29/v2 (go) v2.7.0
github.com/cloudflare/circl (go) v1.6.3
github.com/cncf/xds/go (go) v0.0.0-20260202195803-dba9d589def2
github.com/cyphar/filepath-securejoin (go) v0.6.1
github.com/decred/dcrd/dcrec/secp256k1/v4 (go) v4.4.1
github.com/emirpasic/gods (go) v1.18.1
github.com/envoyproxy/go-control-plane/envoy (go) v1.37.0
github.com/envoyproxy/protoc-gen-validate (go) v1.3.3
github.com/felixge/httpsnoop (go) v1.1.0
Files by Type (count)
Go
111
Other (.golden)
38
YAML
33
Other (.svg)
33
JSON
21
Markdown
7
Other (.png)
7
XML
5
Other (no ext)
4
Other (.tmpl)
4
Other (.afdesign)
4
Other (.af)
4
Files by Type (size)
JSON
6MB
XML
5MB
JavaScript
2MB
Other (.png)
1MB
Other (no ext)
1MB
Go
764KB
Other (.svg)
757KB
Other (.ttf)
521KB
Other (.sum)
271KB
Markdown
136KB
Other (.out)
98KB
Other (.af)
80KB

The LLM identified 3 files worth highlighting for reuse:

Defines the Datastore interface (StoreReport, Put, FS) and a factory function that parses URL schemes to create the appropriate backend (local, S3, GCS, BigQuery, GitHub, artifact, Mackerel). This is a clean, reusable abstraction for storing and retrieving reports. It could be extracted and applied to other projects needing polymorphic storage backends.

file: datastore/datastore.go ↗ | tags: #repository-pattern #interface-abstraction #storage-abstraction

Provides the core coverage data structures (BlockCoverage, LineCoverage) and operations: parsing, merging, excluding files, computing patch coverage, and path normalization. The normalization logic resolves divergent format paths to git-relative paths using filesystem suffix matching. This package is well-isolated and could be reused by any tool that needs to process coverage data from multiple formats.

file: coverage/coverage.go ↗ | tags: #coverage-model #data-structure #merging

Renders SVG badges for coverage, ratio, and time metrics using a Go template and an embedded NotoSans font. Supports custom colors, icons, and condition-based color thresholds via expr-lang expressions. The badge package is self-contained (depends only on Go standard library and the embedded assets) and could be extracted to generate shields.io-style badges for any numeric metric.

file: badge/badge.go ↗ | tags: #svg-generation #badge-rendering
Last analyzed: 2026-09-24 18:09:20.196862
Next check: 2026-10-01 18:09:20.176098
$ submit: