MCPcopy
hub / github.com/harness/harness

github.com/harness/harness @v3.3.0 sqlite

repository ↗ · DeepWiki ↗ · release v3.3.0 ↗
18,143 symbols 65,213 edges 3,741 files 4,691 documented · 26%
README

Harness

Harness Open Source is an open source development platform packed with the power of code hosting, automated DevOps pipelines, hosted development environments (Gitspaces), and artifact registries.

Overview

Harness Open source is an open source development platform packed with the power of code hosting, automated DevOps pipelines, Gitspaces, and artifact registries.

Running Harness locally

The latest publicly released docker image can be found on harness/harness.

To install Harness yourself, simply run the command below. Once the container is up, you can visit http://localhost:3000 in your browser.

docker run -d \
  -p 3000:3000 \
  -p 3022:3022 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /tmp/harness:/data \
  --name harness \
  --restart always \
  harness/harness

The Harness image uses a volume to store the database and repositories. It is highly recommended to use a bind mount or named volume as otherwise all data will be lost once the container is stopped.

See developer.harness.io to learn how to get the most out of Harness.

Where is Drone?

Harness Open Source represents a massive investment in the next generation of Drone. Where Drone focused solely on continuous integration, Harness adds source code hosting, developer environments (gitspaces), and artifact registries; providing teams with an end-to-end, open source DevOps platform.

The goal is for Harness to eventually be at full parity with Drone in terms of pipeline capabilities, allowing users to seamlessly migrate from Drone to Harness.

But, we expect this to take some time, which is why we took a snapshot of Drone as a feature branch drone (README) so it can continue development.

As for Harness, the development is taking place on the main branch.

For more information on Harness, please visit developer.harness.io.

For more information on Drone, please visit drone.io.

Harness Open Source Development

Pre-Requisites

Install the latest stable version of Node and Go version 1.20 or higher, and then install the below Go programs. Ensure the GOPATH bin directory is added to your PATH.

Install protobuf - Check if you've already installed protobuf protoc --version - If your version is different than v3.21.11, run brew unlink protobuf - Get v3.21.11 curl -s https://raw.githubusercontent.com/Homebrew/homebrew-core/9de8de7a533609ebfded833480c1f7c05a3448cb/Formula/protobuf.rb > /tmp/protobuf.rb - Install it brew install /tmp/protobuf.rb - Check out your version protoc --version

Install protoc-gen-go and protoc-gen-go-rpc:

  • Install protoc-gen-go v1.28.1 go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 (Note that this will install a binary in $GOBIN so make sure $GOBIN is in your $PATH)

  • Install protoc-gen-go-grpc v1.2.0 go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0

$ make dep
$ make tools

Build

First step is to build the user interface artifacts:

$ pushd web
$ yarn install
$ yarn build
$ popd

After that, you can build the Harness binary:

$ make build

Run

This project supports all operating systems and architectures supported by Go. This means you can build and run the system on your machine; docker containers are not required for local development and testing.

To start the server at localhost:3000, simply run the following command:

./gitness server .local.env

Auto-Generate Harness API Client used by UI using Swagger

Please make sure to update the autogenerated client code used by the UI when adding new rest APIs.

To regenerate the code, please execute the following steps: - Regenerate swagger with latest Harness binary ./gitness swagger > web/src/services/code/swagger.yaml - navigate to the web folder and run yarn services

The latest API changes should now be reflected in web/src/services/code/index.tsx

Run Registry Conformance Tests

make conformance-test

For running conformance tests with existing running service, use:

make hot-conformance-test

User Interface

This project includes a full user interface for interacting with the system. When you run the application, you can access the user interface by navigating to http://localhost:3000 in your browser.

REST API

This project includes a swagger specification. When you run the application, you can access the swagger specification by navigating to http://localhost:3000/swagger in your browser (for raw yaml see http://localhost:3000/openapi.yaml). For registry endpoints, currently swagger is located on different endpoint http://localhost:3000/registry/swagger/ (for raw json see http://localhost:3000/registry/swagger.json). These will be later moved to the main swagger endpoint.

For testing, it's simplest to just use the cli to create a token (this requires Harness server to run):

# LOGIN (user: admin, pw: changeit)
$ ./gitness login

# GENERATE PAT (1 YEAR VALIDITY)
$ ./gitness user pat "my-pat-uid" 2592000

The command outputs a valid PAT that has been granted full access as the user. The token can then be send as part of the Authorization header with Postman or curl:

$ curl http://localhost:3000/api/v1/user \
-H "Authorization: Bearer $TOKEN"

CLI

This project includes VERY basic command line tools for development and running the service. Please remember that you must start the server before you can execute commands.

For a full list of supported operations, please see

$ ./gitness --help

Contributing

Refer to CONTRIBUTING.md

License

Apache License 2.0, see LICENSE.

Extension points exported contracts — how you extend this code

ServiceInterface (Interface)
ServiceInterface interface for webhook operations. [6 implementers]
registry/services/webhook/interface.go
PackageArtifactInfo (Interface)
PackageArtifactInfo is an interface that must be implemented by all package-specific artifact info types. It ensures tha [9 …
registry/app/pkg/artifact_info.go
PullReqActivityPayload (Interface)
PullReqActivityPayload is an interface used to identify PR activity payload types. The approach is inspired by what prot [14 …
types/pullreq_activity_payload.go
LogStore (Interface)
LogStore provides an interface for the persistent log store backend. [27 implementers]
app/store/logs.go
Canceler (Interface)
Canceler cancels a build. [8 implementers]
app/pipeline/canceler/canceler.go
StreamProducer (Interface)
StreamProducer is an abstraction of a producer from the streams package. [7 implementers]
events/stream.go
Reader (Interface)
Reader specifies the minimum functionality a reader should expose. NOTE: we don't want to enforce any event registration [16 …
events/reader.go
ExtendedCache (Interface)
ExtendedCache is an extension of the simple cache abstraction that adds mapping functionality. [5 implementers]
cache/cache.go

Core symbols most depended-on inside this repo

Errorf
called by 4083
app/services/metric/posthog.go
getString
called by 3045
web/src/framework/strings/String.tsx
Error
called by 1192
app/gitspace/types/types.go
Msgf
called by 920
registry/app/dist_temp/dcontext/logger.go
getConfig
called by 850
web/src/services/config.ts
Get
called by 848
registry/app/storage/blobs.go
TranslatedUserError
called by 680
app/api/render/render_error.go
Err
called by 644
git/parser/scanner.go

Shape

Method 6,837
Function 6,071
Struct 2,571
Interface 2,060
TypeAlias 317
Enum 163
Class 76
FuncType 48

Languages

Go73%
TypeScript27%

Modules by API surface

registry/app/api/openapi/contracts/artifact/services.gen.go969 symbols
web/src/services/code/index.tsx928 symbols
web/src/cde-gitness/services/index.tsx660 symbols
app/store/database.go414 symbols
registry/app/api/openapi/contracts/artifact/types.gen.go270 symbols
registry/app/store/database.go215 symbols
web/src/services/cde/index.tsx126 symbols
registry/app/api/controller/mocks/registry_repository.go82 symbols
web/src/utils/Utils.ts76 symbols
registry/app/driver/testsuites/testsuites.go74 symbols
registry/app/remote/clients/registry/client.go63 symbols
web/src/utils/GitUtils.ts58 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

cloud.google.com/gov0.115.0 · 1×
cloud.google.com/go/authv0.7.2 · 1×
cloud.google.com/go/auth/oauth2adaptv0.2.3 · 1×
cloud.google.com/go/compute/metadatav0.5.0 · 1×
cloud.google.com/go/profilerv0.3.1 · 1×
cloud.google.com/go/storagev1.43.0 · 1×
dario.cat/mergov1.0.1 · 1×
github.com/99designs/httpsignatures-gov0.0.0-2017073104315 · 1×
github.com/BobuSumisu/aho-corasickv1.0.3 · 1×
github.com/DataDog/zstdv1.5.5 · 1×
github.com/KyleBanks/depthv1.2.1 · 1×

Datastores touched

gitnessDatabase · 1 repos

For agents

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

⬇ download graph artifact