MCPcopy Index your code
hub / github.com/covergates/covergates

github.com/covergates/covergates @v0.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.1 ↗ · + Follow
1,106 symbols 3,234 edges 193 files 549 documented · 50%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

logo Covergates - Portal Gates to Coverage Reports

badge CI Go Report Card PkgGoDev License: GPL v3 CLA assistant

card

Purpose

Covergates is to make the easiest way to setup a self-hosted coverage report service. It's an alternative to services, such as:

The reason why this project is because managing coverage reports for private repositories should not be hard! It is able to link with your self-hosted Git service. Use it to improve coding review and quality management flow for your internal projects. Want to try? Visit covergates.com before you starting.

Using

To get started, please download prebuilt binary covergates-version-platform-architecture.zip and try:

unzip covergates-<version>-<platform>-<architecture>.zip
./covergates-server

Visit http://localhost:8080 for your covergates service.

To upload report, run covergate cli:

export API_URL=http://localhost:8080/api/v1
covergates upload -report <report id> -type go coverage.out

Configure

covergates-server uses environment variables to change configurations. Below is the list of variables for basic configuration:

  • GATES_SERVER_ADDR Default http://localhost:8080
  • GATES_SERVER_BASE Default /
  • GATES_DB_DRIVER Default sqlite3. Other options are postgres and cloudrun
  • GATES_DB_HOST Required host for postgres and cloudrun
  • GATES_DB_PORT Required port for postgres and cloudrun
  • GATES_DB_USER Required user forpostgres and cloudrun
  • GATES_DB_NAME Required database name for postgres and cloudrun
  • GATES_DB_PASSWORD Required password for postgres and cloudrun
  • GATES_GITEA_SERVER Default https://try.gitea.io/, gitea server address
  • GATES_GITEA_CLIENT_ID Required for Gitea OAuth login
  • GATES_GITEA_CLIENT_SECRET Required for Gitea OAuth login
  • GATES_GITHUB_SERVER Default https://github.com
  • GATES_GITHUB_API_SERVER Default https://api.github.com
  • GATES_GITHUB_CLIENT_ID Required for GitHub OAuth login
  • GATES_GITHUB_CLIENT_SECRET Required for GitHub OAuth login

Supported SCM and Language

SCM Supported
GitHub :heavy_check_mark:
Gitea :heavy_check_mark:
GitLab :wrench:, ongoing
Gogs :x:
Bitbucket :x:
Language Supported Tutorial
Go :heavy_check_mark: go-example
Perl :heavy_check_mark: :wrench:, ongoing
Python :heavy_check_mark: :wrench:, ongoing
Ruby (SimpleCov: RSpec) :heavy_check_mark: :heavy_minus_sign:
lcov (C, C++, Javascript) :heavy_check_mark: :heavy_minus_sign:
Java (Jacoco) :wrench:, ongoing :heavy_minus_sign:

Covergates is at an early development stage. Other languages and SCM support is ongoing! If you would like to assist with development, please refer to Contributing Section.

Development

The build is split into backend, cli and frontend. To build backend, run:

go build -o covergates-server ./cmd/server

To build CLI, run:

export SERVER_API_URL=http://localhost:8080/api/v1
go build -o covergates -ldflags="-X main.CoverGatesAPI=$SERVER_API_URL" ./cmd/cli

You may change SERVER_API_URL to your self-hosted covergates-server address.

If your are behind firewall or proxy, you may also download source package with vendor modules from covergates.version.src.zip . To build with vendor modules, run:

go build -o covergates-server -mod vendor ./cmd/server

To build frontend, it requires:

  1. Node.js v12
  2. togo

Read web/README.md for more details.

Contributing

It would be highly appreciated if you could contribute to the project. There are many ways in which you can participate in the project:

  1. Contributing directly to the code base

    The expected workflow is GitHub flow. Read CONTRIBUTING.md before getting start.

  2. Submit feature requests and bugs

    Especially for the new language support. It would be great if you could provide coverage report examples and how to produce coverage for other languages.

  3. Testing, both unit testing and e2e testing are welcome.

Further Information

For more information and tutorial about self-hosted Covergates server, please refer to our documentation

Milestones

Refer to TODO.md for details.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for the full license text.

Screenshots

report

files

setting

pull request

Extension points exported contracts — how you extend this code

UserService (Interface)
UserService defines operations with SCM [6 implementers]
core/scm.go
TypeCoverageService (Interface)
TypeCoverageService defines a coverage service for a language [9 implementers]
service/coverage/coverage.go
Chart (Interface)
Chart renders image to writer [4 implementers]
core/chart.go
OAuthService (Interface)
OAuthService provide OAuth2 protocol [3 implementers]
core/oauth.go
GitRepository (Interface)
go:generate mockgen -package mock -destination ../mock/git_mock.go . GitRepository,Git,GitCommit GitRepository which is [3 …
core/git.go
DatabaseService (Interface)
go:generate mockgen -package mock -destination ../mock/store_mock.go . DatabaseService DatabaseService provides database [3 …
core/store.go
RepoService (Interface)
RepoService provides repository opperations [3 implementers]
core/repo.go
HookService (Interface)
go:generate mockgen -package mock -destination ../mock/hook_mock.go . HookService HookService manages and resolves webho [3 …
core/hook.go

Core symbols most depended-on inside this repo

Error
called by 83
models/error.go
Find
called by 74
core/repo.go
Session
called by 46
core/store.go
Client
called by 26
core/scm.go
Create
called by 22
core/repo.go
FullName
called by 19
core/repo.go
Open
called by 19
core/report.go
withUser
called by 17
modules/scm/scm.go

Shape

Method 505
Function 368
Struct 153
Interface 47
TypeAlias 18
Class 9
Enum 6

Languages

Go91%
TypeScript9%

Modules by API surface

mock/scm_mock.go84 symbols
core/scm.go46 symbols
mock/repo_mock.go34 symbols
mock/report_mock.go30 symbols
mock/git_mock.go28 symbols
modules/charts/icons/icons_gen.go26 symbols
mock/oauth_mock.go26 symbols
core/report.go25 symbols
models/report.go22 symbols
models/repo.go20 symbols
models/report_test.go18 symbols
mock/user_mock.go18 symbols

For agents

$ claude mcp add covergates \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact