diff --git a/.vscode/launch.json b/.vscode/launch.json index c08542f19..35a9bc7af 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,6 +5,7 @@ "version": "0.2.0", "configurations": [ { + //TODO update this when we are ready to cutover "name": "Gitness", "type": "go", "request": "launch", diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eff09ba09..572a7ec27 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,12 +1,12 @@ -# Contributing to Gitness +# Contributing to Harness -Thank you for your interest in contributing to the Gitness project. Gitnes uses GitHub to manage reviews of pull requests. +Thank you for your interest in open source contributions to Harness. Harness uses GitHub to manage open source reviews of pull requests. * If you are a new contributor see: [Steps to Contribute](#steps-to-contribute) * If you have a minor fix or improvement, feel free to create a pull request. Please provide necessary details in the pull request description and use a meaningful title. -* If you plan to do something more involved, first discuss your ideas by [raising an issue](https://github.com/harness/gitness/issues). This will avoid unnecessary work and surely give you and us a good deal of inspiration. +* If you plan to do something more involved, first discuss your ideas by [raising an issue](https://github.com/harness/harness/issues). This will avoid unnecessary work and surely give you and us a good deal of inspiration. * Relevant coding style guidelines are @@ -19,11 +19,11 @@ Thank you for your interest in contributing to the Gitness project. Gitnes uses Should you wish to work on an issue, please claim it first by commenting on the GitHub issue that you want to work on. This is to prevent duplicated efforts from contributors on the same issue. -Please check the [`good-first-issue`](https://github.com/harness/gitness/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label to find issues that are good for getting started. If you have questions about one of the issues, with or without the tag, please comment on them and one of the maintainers will clarify it. For a quicker response, contact us over [slack](https://docs.gitness.com/support#slack) or join our [weekly office hours](https://docs.gitness.com/support#weekly-office-hours). +Please check the [`good-first-issue`](https://github.com/harness/harness/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label to find issues that are good for getting started. If you have questions about one of the issues, with or without the tag, please comment on them and one of the maintainers will clarify it. For a quicker response, contact us over [slack](https://developer.harness.io/docs/open-source/support#slack). ### Local Development -Please review [Gitness development](https://github.com/harness/gitness/tree/main?tab=readme-ov-file#gitness-development) to build and test your code locally. +Please review [Harness development](https://github.com/harness/harness/tree/main?tab=readme-ov-file#harness-development) to build and test your code locally. ### Pre-commit Hook @@ -31,7 +31,7 @@ We have a pre-commit hook to ensure code quality before committing changes. This ### Lint Check -Our CI Linter pipeline conducts automated checks for code quality, with [separate lint checks for Go and TypeScript](https://github.com/harness/gitness/blob/main/.github/workflows/ci-lint.yml). These checks help ensure adherence to coding standards and identify potential issues early in the development process. Thank you for contributing to our code quality efforts! +Our CI Linter pipeline conducts automated checks for code quality, with [separate lint checks for Go and TypeScript](https://github.com/harness/harness/blob/main/.github/workflows/ci-lint.yml). These checks help ensure adherence to coding standards and identify potential issues early in the development process. Thank you for contributing to our code quality efforts! ## Pull Request Checklist @@ -45,7 +45,7 @@ Our CI Linter pipeline conducts automated checks for code quality, with [separat ## Dependency management -The Gitness project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages. +Harness uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages. To add or update a new dependency, use the `go get` command: diff --git a/Dockerfile b/Dockerfile index 9880307c4..7aa4fc693 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ COPY ./web . RUN yarn && yarn build && yarn cache clean # ---------------------------------------------------------# -# Build gitness image # +# Build Harness image # # ---------------------------------------------------------# FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.18 as builder diff --git a/Makefile b/Makefile index 11ff327df..f46d7f23d 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ init: ## Install git hooks to perform pre-commit checks git config core.hooksPath .githooks git config commit.template .gitmessage -dep: $(deps) ## Install the deps required to generate code and build gitness +dep: $(deps) ## Install the deps required to generate code and build Harness @echo "Installing dependencies" @go mod download @@ -34,12 +34,12 @@ tools: $(tools) ## Install tools required for the build ############################################################################### # -# Gitness Build and testing rules +# Harness Build and testing rules # ############################################################################### -build: generate ## Build the all-in-one gitness binary - @echo "Building Gitness Server" +build: generate ## Build the all-in-one Harness binary + @echo "Building Harness Server" go build -o ./gitness ./cmd/gitness test: generate ## Run the go tests diff --git a/README.md b/README.md index 1cba18608..dd3dde2fc 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,45 @@ -# Gitness -Gitness is an open source development platform packed with the power of code hosting and automated DevOps pipelines. +# Harness +Harness is an open source development platform packed with the power of code hosting, automated DevOps pipelines, Gitspaces, and artifact registries. ## Overview -Gitness is an open source development platform packed with the power of code hosting and automated continuous integration pipelines. +Harness is an open source development platform packed with the power of code hosting, automated DevOps pipelines, Gitspaces, and artifact registries. -## Running Gitness locally -> The latest publicly released docker image can be found on [harness/gitness](https://hub.docker.com/r/harness/gitness). -To install Gitness yourself, simply run the command below. Once the container is up, you can visit http://localhost:3000 in your browser. +## Running Harness locally +> The latest publicly released docker image can be found on [harness/harness](https://hub.docker.com/r/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. ```bash docker run -d \ -p 3000:3000 \ + -p 22:22 \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v /tmp/gitness:/data \ - --name gitness \ + -v /tmp/harness:/data \ + --name harness \ --restart always \ - harness/gitness + harness/harness ``` -> The Gitness 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. +> 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 [docs.gitness.com](https://docs.gitness.com) to learn how to get the most out of Gitness. +// TODO: @Dewan - let me know the correct doc URL +See [developer.harness.com](https://developer.harness.io/docs/open-source) to learn how to get the most out of Harness. ## Where is Drone? -Gitness represents a massive investment in the next generation of Drone. Where Drone focused on continuous integration, Gitness adds source code hosting, bringing code management and pipelines closer together. +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 regestries; providing teams with an end-to-end, open source DevOps platform. -The goal is for Gitness to eventually be at full parity with Drone in terms of pipeline capabilities, allowing users to seemlessly migrate from Drone to Gitness. +The goal is for Harness to eventually be at full parity with Drone in terms of pipeline capabilities, allowing users to seemlessly 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](https://github.com/harness/gitness/tree/drone) ([README](https://github.com/harness/gitness/blob/drone/.github/readme.md)) so it can continue development. +But, we expect this to take some time, which is why we took a snapshot of Drone as a feature branch [drone](https://github.com/harness/harness/tree/drone) ([README](https://github.com/harness/harness/blob/drone/.github/readme.md)) so it can continue development. -As for Gitness, the development is taking place on the [main](https://github.com/harness/gitness/tree/main) branch. +As for Harness, the development is taking place on the [main](https://github.com/harness/harness/tree/main) branch. -For more information on Gitness, please visit [gitness.com](https://gitness.com/). +For more information on Harness, please visit [developer.harness.com](https://developer.harness.com/). For more information on Drone, please visit [drone.io](https://www.drone.io/). -## Gitness Development +## 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](https://go.dev/doc/gopath_code#GOPATH) is added to your PATH. @@ -71,7 +74,7 @@ $ yarn build $ popd ``` -After that, you can build the gitness binary: +After that, you can build the Harness binary: ```bash $ make build @@ -87,11 +90,11 @@ To start the server at `localhost:3000`, simply run the following command: ./gitness server .local.env ``` -### Auto-Generate Gitness API Client used by UI using Swagger +### 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 gitness binary `./gitness swagger > web/src/services/code/swagger.yaml` +- 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` @@ -115,7 +118,7 @@ This project includes a swagger specification. When you run the application, you 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 gitness server to run): +For testing, it's simplest to just use the cli to create a token (this requires Harness server to run): ```bash # LOGIN (user: admin, pw: changeit) $ ./gitness login @@ -143,8 +146,8 @@ $ ./gitness --help ## Contributing -Refer to [CONTRIBUTING.md](https://github.com/harness/gitness/blob/main/CONTRIBUTING.md) +Refer to [CONTRIBUTING.md](https://github.com/harness/harness/blob/main/CONTRIBUTING.md) ## License -Apache License 2.0, see [LICENSE](https://github.com/harness/gitness/blob/main/LICENSE). \ No newline at end of file +Apache License 2.0, see [LICENSE](https://github.com/harness/harness/blob/main/LICENSE). \ No newline at end of file diff --git a/app/api/controller/githook/client.go b/app/api/controller/githook/client.go index 07879f996..1d573fc12 100644 --- a/app/api/controller/githook/client.go +++ b/app/api/controller/githook/client.go @@ -74,7 +74,7 @@ func (c *ControllerClient) PreReceive( out, err := c.githookCtrl.PreReceive( ctx, - c.git, // gitness doesn't require any custom git connector. + c.git, // Harness doesn't require any custom git connector. nil, // TODO: update once githooks are auth protected types.GithookPreReceiveInput{ GithookInputBase: c.baseInput, @@ -96,7 +96,7 @@ func (c *ControllerClient) Update( out, err := c.githookCtrl.Update( ctx, - c.git, // gitness doesn't require any custom git connector. + c.git, // Harness doesn't require any custom git connector. nil, // TODO: update once githooks are auth protected types.GithookUpdateInput{ GithookInputBase: c.baseInput, @@ -118,7 +118,7 @@ func (c *ControllerClient) PostReceive( out, err := c.githookCtrl.PostReceive( ctx, - c.git, // gitness doesn't require any custom git connector. + c.git, // Harness doesn't require any custom git connector. nil, // TODO: update once githooks are auth protected types.GithookPostReceiveInput{ GithookInputBase: c.baseInput, diff --git a/app/api/controller/githook/controller.go b/app/api/controller/githook/controller.go index e15da51f0..ee7b38e7d 100644 --- a/app/api/controller/githook/controller.go +++ b/app/api/controller/githook/controller.go @@ -99,7 +99,7 @@ func (c *Controller) getRepoCheckAccess(ctx context.Context, return nil, fmt.Errorf("failed to find repo with id %d: %w", repoID, err) } - // TODO: execute permission check. block anything but gitness service? + // TODO: execute permission check. block anything but Harness service? return repo, nil } diff --git a/app/api/controller/util.go b/app/api/controller/util.go index 0299798b7..df34f892e 100644 --- a/app/api/controller/util.go +++ b/app/api/controller/util.go @@ -69,7 +69,7 @@ func CreateRPCExternalWriteParams( } // CreateRPCInternalWriteParams creates base write parameters for git internal write operations. -// Internal write operations are git pushes that originate from the Gitness server. +// Internal write operations are git pushes that originate from the Harness server. func CreateRPCInternalWriteParams( ctx context.Context, urlProvider url.Provider, diff --git a/app/api/handler/githook/post_receive.go b/app/api/handler/githook/post_receive.go index e43996191..1eb408c71 100644 --- a/app/api/handler/githook/post_receive.go +++ b/app/api/handler/githook/post_receive.go @@ -40,8 +40,7 @@ func HandlePostReceive( render.BadRequestf(ctx, w, "Invalid Request Body: %s.", err) return } - - // gitness doesn't require any custom git connector. + // Harness doesn't require any custom git connector. out, err := githookCtrl.PostReceive(ctx, git, session, in) if err != nil { render.TranslatedUserError(ctx, w, err) diff --git a/app/api/handler/githook/pre_receive.go b/app/api/handler/githook/pre_receive.go index 8d48946c3..7a0baed29 100644 --- a/app/api/handler/githook/pre_receive.go +++ b/app/api/handler/githook/pre_receive.go @@ -41,7 +41,7 @@ func HandlePreReceive( return } - // gitness doesn't require any custom git connector. + // Harness doesn't require any custom git connector. out, err := githookCtrl.PreReceive(ctx, git, session, in) if err != nil { render.TranslatedUserError(ctx, w, err) diff --git a/app/api/handler/githook/update.go b/app/api/handler/githook/update.go index e92230f05..2609657f0 100644 --- a/app/api/handler/githook/update.go +++ b/app/api/handler/githook/update.go @@ -41,7 +41,7 @@ func HandleUpdate( return } - // gitness doesn't require any custom git connector. + // Harness doesn't require any custom git connector. out, err := githookCtrl.Update(ctx, git, session, in) if err != nil { render.TranslatedUserError(ctx, w, err) diff --git a/app/bootstrap/bootstrap.go b/app/bootstrap/bootstrap.go index 061f6e543..6398b372b 100644 --- a/app/bootstrap/bootstrap.go +++ b/app/bootstrap/bootstrap.go @@ -28,8 +28,8 @@ import ( "github.com/rs/zerolog/log" ) -// systemServicePrincipal is the principal representing gitness. -// It is used for all operations executed by gitness itself. +// systemServicePrincipal is the principal representing Harness. +// It is used for all operations executed by Harness itself. var systemServicePrincipal *types.Principal var ErrAdminEmailRequired = errors.New("config.Principal.Admin.Email is required") @@ -42,7 +42,7 @@ func NewSystemServiceSession() *auth.Session { } // pipelineServicePrincipal is the principal that is used during -// pipeline executions for calling gitness APIs. +// pipeline executions for calling Harness APIs. var pipelineServicePrincipal *types.Principal func NewPipelineServiceSession() *auth.Session { @@ -53,7 +53,7 @@ func NewPipelineServiceSession() *auth.Session { } // gitspaceServicePrincipal is the principal that is used during -// gitspace token injection for calling gitness APIs. +// gitspace token injection for calling Harness APIs. var gitspaceServicePrincipal *types.Principal func NewGitspaceServiceSession() *auth.Session { @@ -147,7 +147,7 @@ func createAdminUser( return usr, nil } -// SystemService sets up the gitness service principal that is used for +// SystemService sets up the Harness service principal that is used for // resources that are automatically created by the system. func SystemService( ctx context.Context, @@ -181,7 +181,7 @@ func SystemService( } // PipelineService sets up the pipeline service principal that is used during -// pipeline executions for calling gitness APIs. +// pipeline executions for calling Harness APIs. func PipelineService( ctx context.Context, config *types.Config, @@ -211,7 +211,7 @@ func PipelineService( } // GitspaceService sets up the gitspace service principal that is used during -// gitspace credential injection for calling gitness APIs. +// gitspace credential injection for calling Harness APIs. func GitspaceService( ctx context.Context, config *types.Config, diff --git a/app/githook/client_rest.go b/app/githook/client_rest.go index b5dbad043..c10e49ca1 100644 --- a/app/githook/client_rest.go +++ b/app/githook/client_rest.go @@ -41,7 +41,7 @@ const ( HTTPRequestPathUpdate = "update" ) -// RestClientFactory creates clients that make rest api calls to gitness to execute githooks. +// RestClientFactory creates clients that make rest api calls to Harness to execute githooks. type RestClientFactory struct{} func (f *RestClientFactory) NewClient(envVars map[string]string) (hook.Client, error) { @@ -62,7 +62,7 @@ func (f *RestClientFactory) NewClient(envVars map[string]string) (hook.Client, e return NewRestClient(payload), nil } -// RestClient is the hook.Client used to call the githooks api of gitness api server. +// RestClient is the hook.Client used to call the githooks api of Harness api server. type RestClient struct { httpClient *http.Client baseURL string @@ -81,7 +81,7 @@ func NewRestClient( } } -// PreReceive calls the pre-receive githook api of the gitness api server. +// PreReceive calls the pre-receive githook api of the Harness api server. func (c *RestClient) PreReceive( ctx context.Context, in hook.PreReceiveInput, @@ -92,7 +92,7 @@ func (c *RestClient) PreReceive( }) } -// Update calls the update githook api of the gitness api server. +// Update calls the update githook api of the Harness api server. func (c *RestClient) Update( ctx context.Context, in hook.UpdateInput, @@ -103,7 +103,7 @@ func (c *RestClient) Update( }) } -// PostReceive calls the post-receive githook api of the gitness api server. +// PostReceive calls the post-receive githook api of the Harness api server. func (c *RestClient) PostReceive( ctx context.Context, in hook.PostReceiveInput, diff --git a/app/githook/env.go b/app/githook/env.go index 3ea9fc45b..956cbb741 100644 --- a/app/githook/env.go +++ b/app/githook/env.go @@ -33,7 +33,7 @@ var ( // GenerateEnvironmentVariables generates the required environment variables for a payload // constructed from the provided parameters. -// The parameter `internal` should be true if the call is coming from the Gitness +// The parameter `internal` should be true if the call is coming from the Harness // and therefore protection from rules shouldn't be verified. func GenerateEnvironmentVariables( ctx context.Context, diff --git a/app/githook/types.go b/app/githook/types.go index e10777c6c..8ea55381e 100644 --- a/app/githook/types.go +++ b/app/githook/types.go @@ -27,7 +27,7 @@ type Payload struct { PrincipalID int64 RequestID string Disabled bool - Internal bool // Internal calls originate from Gitness, and external calls are direct git pushes. + Internal bool // Internal calls originate from Harness, and external calls are direct git pushes. } func (p Payload) Validate() error { diff --git a/app/gitspace/logutil/stateful_logger.go b/app/gitspace/logutil/stateful_logger.go index 8324e79b7..4ad018993 100644 --- a/app/gitspace/logutil/stateful_logger.go +++ b/app/gitspace/logutil/stateful_logger.go @@ -48,7 +48,7 @@ func NewStatefulLogger(logz livelog.LogStream) *StatefulLogger { // GetLogStream returns an instance of LogStreamInstance tied to the given id. func (s *StatefulLogger) CreateLogStream(ctx context.Context, id int64) (*LogStreamInstance, error) { // TODO: As livelog.LogStreamInstance uses only a single id as key, conflicts are likely if pipelines and gitspaces - // are used in the same instance of Gitness. We need to update the underlying implementation to use another unique + // are used in the same instance of Harness. We need to update the underlying implementation to use another unique // key. To avoid that, we offset the ID by offset (1000000000). offsetID := offset + id diff --git a/app/jwt/jwt.go b/app/jwt/jwt.go index 9aaeee722..7c8a086f1 100644 --- a/app/jwt/jwt.go +++ b/app/jwt/jwt.go @@ -25,6 +25,7 @@ import ( ) const ( + //TODO: Update when ready to change repo and build issuer = "Gitness" ) @@ -35,7 +36,7 @@ const ( OciSource Source = "oci" ) -// Claims defines gitness jwt claims. +// Claims defines Harness jwt claims. type Claims struct { jwt.StandardClaims diff --git a/app/pipeline/commit/gitness.go b/app/pipeline/commit/gitness.go index db7de2c50..e1438b158 100644 --- a/app/pipeline/commit/gitness.go +++ b/app/pipeline/commit/gitness.go @@ -30,7 +30,7 @@ func newService(git git.Interface) Service { return &service{git: git} } -// FindRef finds information about a commit in gitness for the git ref. +// FindRef finds information about a commit in Harness for the git ref. // This is using the branch only as the ref at the moment, can be changed // when needed to take any ref (like sha, tag). func (f *service) FindRef( @@ -53,7 +53,7 @@ func (f *service) FindRef( return controller.MapCommit(branchOutput.Branch.Commit) } -// FindCommit finds information about a commit in gitness for the git SHA. +// FindCommit finds information about a commit in Harness for the git SHA. func (f *service) FindCommit( ctx context.Context, repo *types.Repository, diff --git a/app/pipeline/commit/service.go b/app/pipeline/commit/service.go index 9aa5570a5..8531e0187 100644 --- a/app/pipeline/commit/service.go +++ b/app/pipeline/commit/service.go @@ -22,7 +22,7 @@ import ( type ( // Service provides access to commit information via - // the SCM provider. Today, this is gitness but it can + // the SCM provider. Today, this is Harness but it can // be extendible to any SCM provider. Service interface { // ref is the ref to fetch the commit from, eg refs/heads/master diff --git a/app/pipeline/converter/jsonnet/jsonnet.go b/app/pipeline/converter/jsonnet/jsonnet.go index 4b8655278..325753921 100644 --- a/app/pipeline/converter/jsonnet/jsonnet.go +++ b/app/pipeline/converter/jsonnet/jsonnet.go @@ -161,7 +161,7 @@ func Parse( // mapBuild populates build variables available to jsonnet templates. // Since we want to maintain compatibility with drone, the older format -// needs to be maintained (even if the variables do not exist in gitness). +// needs to be maintained (even if the variables do not exist in Harness). func mapBuild(v *types.Execution, vm *jsonnet.VM) { vm.ExtVar(build+"event", string(v.Event)) vm.ExtVar(build+"action", string(v.Action)) @@ -188,7 +188,7 @@ func mapBuild(v *types.Execution, vm *jsonnet.VM) { // mapBuild populates repo level variables available to jsonnet templates. // Since we want to maintain compatibility with drone 2.x, the older format -// needs to be maintained (even if the variables do not exist in gitness). +// needs to be maintained (even if the variables do not exist in Harness). func mapRepo(v *types.Repository, p *types.Pipeline, vm *jsonnet.VM, publicRepo bool) { namespace := v.Path idx := strings.LastIndex(v.Path, "/") diff --git a/app/pipeline/file/service.go b/app/pipeline/file/service.go index 00df8913b..0b9d3e242 100644 --- a/app/pipeline/file/service.go +++ b/app/pipeline/file/service.go @@ -28,9 +28,9 @@ type ( } // Service provides access to contents of files in - // the SCM provider. Today, this is gitness but it should + // the SCM provider. Today, this is Harness but it should // be extendible to any SCM provider. - // The plan is for all remote repos to be pointers inside gitness + // The plan is for all remote repos to be pointers inside Harness // so a repo entry would always exist. If this changes, the interface // can be updated. Service interface { diff --git a/app/pipeline/runner/runner.go b/app/pipeline/runner/runner.go index 59defc213..e3b71fed5 100644 --- a/app/pipeline/runner/runner.go +++ b/app/pipeline/runner/runner.go @@ -51,7 +51,7 @@ var Privileged = []string{ } // dockerOpts returns back the options to be overridden from docker options set -// in the environment. If values are specified in gitness, they get preference. +// in the environment. If values are specified in Harness, they get preference. func dockerOpts(config *types.Config) []dockerclient.Opt { var overrides []dockerclient.Opt @@ -71,7 +71,7 @@ func NewExecutionRunner( resolver *resolver.Manager, ) (*runtime2.Runner, error) { // For linux/windows, containers need to have extra hosts set in order to interact with - // gitness. For docker desktop for mac, this is built in and not needed. + // Harness. For docker desktop for mac, this is built in and not needed. extraHosts := []string{} if goruntime.GOOS != "darwin" { extraHosts = []string{"host.docker.internal:host-gateway"} diff --git a/app/server/server.go b/app/server/server.go index 848573378..c17c8506d 100644 --- a/app/server/server.go +++ b/app/server/server.go @@ -19,7 +19,7 @@ import ( "github.com/harness/gitness/http" ) -// Server is the http server for gitness. +// Server is the http server for Harness. type Server struct { *http.Server } diff --git a/app/services/aiagent/aiagent.go b/app/services/aiagent/aiagent.go index d04605054..6ebda285b 100644 --- a/app/services/aiagent/aiagent.go +++ b/app/services/aiagent/aiagent.go @@ -95,7 +95,7 @@ type PipelineYaml struct { Yaml string `yaml:"yaml"` } -// CapabilitiesLoop TODO: this should be replaced with an async model for Harness Enterprise, but remain for gitness. +// CapabilitiesLoop TODO: this should be replaced with an async model for Harness Enterprise, but remain for Harness. func (s *HarnessIntelligence) CapabilitiesLoop( ctx context.Context, req *genai.ChatRequest) (*genai.ChatRequest, error) { returnToUser := false diff --git a/app/services/webhook/types.go b/app/services/webhook/types.go index 3327dcbaf..36c491746 100644 --- a/app/services/webhook/types.go +++ b/app/services/webhook/types.go @@ -281,7 +281,7 @@ func identityInfoFrom(identity git.Identity) IdentityInfo { } } -// ReferenceInfo describes a unique reference in gitness. +// ReferenceInfo describes a unique reference in Harness. // It contains both the reference name as well as the repo the reference belongs to. type ReferenceInfo struct { Name string `json:"name"` diff --git a/app/store/database/gitspace_config.go b/app/store/database/gitspace_config.go index 34b88aafb..39e494756 100644 --- a/app/store/database/gitspace_config.go +++ b/app/store/database/gitspace_config.go @@ -72,7 +72,7 @@ type gitspaceConfig struct { CodeRepoURL string `db:"gconf_code_repo_url"` DevcontainerPath null.String `db:"gconf_devcontainer_path"` Branch string `db:"gconf_branch"` - // TODO: migrate to principal int64 id to use principal cache and consistent with gitness code. + // TODO: migrate to principal int64 id to use principal cache and consistent with Harness code. UserUID string `db:"gconf_user_uid"` SpaceID int64 `db:"gconf_space_id"` Created int64 `db:"gconf_created"` diff --git a/app/store/database/gitspace_instance.go b/app/store/database/gitspace_instance.go index 14f4f3a7d..aeb1f1d3c 100644 --- a/app/store/database/gitspace_instance.go +++ b/app/store/database/gitspace_instance.go @@ -59,7 +59,7 @@ type gitspaceInstance struct { GitSpaceConfigID int64 `db:"gits_gitspace_config_id"` URL null.String `db:"gits_url"` State enum.GitspaceInstanceStateType `db:"gits_state"` - // TODO: migrate to principal int64 id to use principal cache and consistent with gitness code. + // TODO: migrate to principal int64 id to use principal cache and consistent with Harness code. UserUID string `db:"gits_user_uid"` ResourceUsage null.String `db:"gits_resource_usage"` SpaceID int64 `db:"gits_space_id"` diff --git a/app/url/provider.go b/app/url/provider.go index cd43f078b..81248f9ac 100644 --- a/app/url/provider.go +++ b/app/url/provider.go @@ -43,7 +43,7 @@ type Provider interface { GetInternalAPIURL(ctx context.Context) string // GenerateContainerGITCloneURL generates a URL that can be used by CI container builds to - // interact with gitness and clone a repo. + // interact with Harness and clone a repo. GenerateContainerGITCloneURL(ctx context.Context, repoPath string) string // GenerateGITCloneURL generates the public git clone URL for the provided repo path. @@ -79,13 +79,13 @@ type Provider interface { RegistryURL() string } -// Provider provides the URLs of the gitness system. +// Provider provides the URLs of the Harness system. type provider struct { // internalURL stores the URL via which the service is reachable at internally // (no need for internal services to go via public route). internalURL *url.URL - // containerURL stores the URL that can be used to communicate with gitness from inside a + // containerURL stores the URL that can be used to communicate with Harness from inside a // build container. containerURL *url.URL diff --git a/charts/gitness/Chart.yaml b/charts/gitness/Chart.yaml index 75fed5503..69565171e 100644 --- a/charts/gitness/Chart.yaml +++ b/charts/gitness/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 -name: gitness -description: A Helm chart for gitness +name: harness-open-source +description: A Helm chart for Harness Open Source # A chart can be either an 'application' or a 'library' chart. # diff --git a/cli/operations/server/config.go b/cli/operations/server/config.go index f1408aa70..7ac8baf71 100644 --- a/cli/operations/server/config.go +++ b/cli/operations/server/config.go @@ -351,7 +351,7 @@ func ProvideTriggerConfig(config *types.Config) trigger.Config { } } -// ProvideLockConfig generates the `lock` package config from the gitness config. +// ProvideLockConfig generates the `lock` package config from the Harness config. func ProvideLockConfig(config *types.Config) lock.Config { return lock.Config{ App: config.Lock.AppNamespace, @@ -414,7 +414,7 @@ func ProvideDockerConfig(config *types.Config) (*infraprovider.DockerConfig, err if config.Docker.MachineHostName == "" { gitnessBaseURL, err := url.Parse(config.URL.Base) if err != nil { - return nil, fmt.Errorf("unable to parse Gitness base URL %s: %w", gitnessBaseURL, err) + return nil, fmt.Errorf("unable to parse Harness base URL %s: %w", gitnessBaseURL, err) } config.Docker.MachineHostName = gitnessBaseURL.Hostname() } diff --git a/infraprovider/docker_provider.go b/infraprovider/docker_provider.go index 4f9856123..d702b6579 100644 --- a/infraprovider/docker_provider.go +++ b/infraprovider/docker_provider.go @@ -48,7 +48,7 @@ func NewDockerProvider( } } -// Provision assumes a docker engine is already running on the gitness host machine and re-uses that as infra. +// Provision assumes a docker engine is already running on the Harness host machine and re-uses that as infra. // It does not start docker engine. It creates a docker volume using the given gitspace config identifier. func (d DockerProvider) Provision( ctx context.Context, diff --git a/types/check.go b/types/check.go index ed4f717e1..190e555e1 100644 --- a/types/check.go +++ b/types/check.go @@ -92,7 +92,7 @@ type CheckPayloadText struct { } // CheckPayloadInternal is for internal use for more seamless integration for -// gitness CI status checks. +// Harness CI status checks. type CheckPayloadInternal struct { Number int64 `json:"execution_number"` RepoID int64 `json:"repo_id"` diff --git a/types/config.go b/types/config.go index edc680691..2cffac410 100644 --- a/types/config.go +++ b/types/config.go @@ -28,7 +28,7 @@ import ( // Config stores the system configuration. type Config struct { - // InstanceID specifis the ID of the gitness instance. + // InstanceID specifis the ID of the Harness instance. // NOTE: If the value is not provided the hostname of the machine is used. InstanceID string `envconfig:"GITNESS_INSTANCE_ID"` @@ -70,7 +70,7 @@ type Config struct { GitSSH string `envconfig:"GITNESS_URL_GIT_SSH"` // API defines the external URL via which the rest API is reachable. - // NOTE: for routing to work properly, the request path reaching gitness has to end with `/api` + // NOTE: for routing to work properly, the request path reaching Harness has to end with `/api` // (this could be after proxy path rewrite). // Value is derived from Base unless explicitly specified (e.g. http://localhost:3000/api). API string `envconfig:"GITNESS_URL_API"` @@ -84,7 +84,7 @@ type Config struct { Internal string `envconfig:"GITNESS_URL_INTERNAL"` // Container is the endpoint that can be used by running container builds to communicate - // with gitness (for example while performing a clone on a local repo). + // with Harness (for example while performing a clone on a local repo). // host.docker.internal allows a running container to talk to services exposed on the host // (either running directly or via a port exposed in a docker container). // Value is derived from HTTP.Server unless explicitly specified (e.g. http://host.docker.internal:3000). @@ -169,7 +169,7 @@ type Config struct { // should be attached to. // This can be needed when we don't want to use host.docker.internal (eg when a service mesh // or proxy is being used) and instead want all the containers to run on the same network as - // the gitness container so that they can interact via the container name. + // the Harness container so that they can interact via the container name. // In that case, GITNESS_URL_CONTAINER should also be changed // (eg to http://:). ContainerNetworks []string `envconfig:"GITNESS_CI_CONTAINER_NETWORKS"` diff --git a/web/src/cde-gitness/strings/strings.en.yaml b/web/src/cde-gitness/strings/strings.en.yaml index ea32bd2f4..0451d51fd 100644 --- a/web/src/cde-gitness/strings/strings.en.yaml +++ b/web/src/cde-gitness/strings/strings.en.yaml @@ -70,13 +70,13 @@ listing: ownerAndCreated: Owner & Created On create: repositoryDetails: Repository Details - gitnessRepositories: Gitness Repositories + gitnessRepositories: Harness Repositories thirdPartyGitRepositories: Other Public Git Repositories branchPlaceholder: Enter the Branch name selectBranchPlaceholder: Select branch searchRepositoryPlaceholder: Search for a repository searchBranchPlaceholder: Search for a branch - repoNotFound: 'Create a repo {{repo}} in Gitness' + repoNotFound: 'Create a repo {{repo}}' gitspaceCreateSuccess: Gitspace created successfully gitspaceCreateFailed: Gitspace creation failed subtext: Start Coding, no setup required. Dedicated cloud development environments with your favorite editor. diff --git a/web/src/components/HarnessLogo/HarnessLogo.module.scss b/web/src/components/HarnessLogo/HarnessLogo.module.scss new file mode 100644 index 000000000..96ed012f3 --- /dev/null +++ b/web/src/components/HarnessLogo/HarnessLogo.module.scss @@ -0,0 +1,36 @@ +/* + * Copyright 2023 Harness, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.main { + margin: var(--spacing-large) var(--spacing-large) 0 !important; + padding-bottom: 6px !important; + + > a { + display: block; + } + + .layout { + display: inline-flex !important; + align-items: center !important; + } + + .text { + font-size: 20px; + font-style: normal; + font-weight: 600; + color: var(--black); + } +} diff --git a/web/src/components/HarnessLogo/HarnessLogo.module.scss.d.ts b/web/src/components/HarnessLogo/HarnessLogo.module.scss.d.ts new file mode 100644 index 000000000..6f2e90f08 --- /dev/null +++ b/web/src/components/HarnessLogo/HarnessLogo.module.scss.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright 2023 Harness, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* eslint-disable */ +// This is an auto-generated file +export declare const layout: string +export declare const main: string +export declare const text: string diff --git a/web/src/components/HarnessLogo/HarnessLogo.tsx b/web/src/components/HarnessLogo/HarnessLogo.tsx new file mode 100644 index 000000000..f1e735430 --- /dev/null +++ b/web/src/components/HarnessLogo/HarnessLogo.tsx @@ -0,0 +1,36 @@ +/* + * Copyright 2024 Harness, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React from 'react' +import { Container, Layout } from '@harnessio/uicore' +import { Link } from 'react-router-dom' +import { useAppContext } from 'AppContext' +import harness from './harness.svg?url' +import css from './HarnessLogo.module.scss' + +export const HarnessLogo: React.FC = () => { + const { routes } = useAppContext() + + return ( + + + + + + + + ) +} diff --git a/web/src/components/HarnessLogo/harness.svg b/web/src/components/HarnessLogo/harness.svg new file mode 100644 index 000000000..526cf25dc --- /dev/null +++ b/web/src/components/HarnessLogo/harness.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/web/src/i18n/strings.en.yaml b/web/src/i18n/strings.en.yaml index 957a32894..254e29811 100644 --- a/web/src/i18n/strings.en.yaml +++ b/web/src/i18n/strings.en.yaml @@ -878,12 +878,12 @@ importRepo: passwordReq: Password is required importRepos: title: Import Repositories - content: Import multiple repositories from GitLab Group, GitHub Org or Bitbucket Project to this project in Gitness. + content: Import multiple repositories from GitLab Group, GitHub Org or Bitbucket Project to this project. importSpace: title: Import Project createASpace: Create a project authorization: Authorization - content: Import a GitLab Group, GitHub Org or Bitbucket Project to a new Project in Gitness. Entities at the top level will be imported to the project. + content: Import a GitLab Group, GitHub Org or Bitbucket Project to a new Project. Entities at the top level will be imported to the project. next: Next step details: Details of target to import organizationName: Organization Name @@ -948,7 +948,7 @@ exportSpace: exportRepo: Upgrading {repoCount} {repoCount|1:repository,repositories} spaceUpdate: Project Updated generate: Generate -generateHelptext: Let Gitness build your Pipeline for you. +generateHelptext: Let Harness build your Pipeline for you. enterAddress: Enter Address enterGitlabPlaceholder: https://gitlab.com/ enterGithubPlaceholder: https://api.github.com/ diff --git a/web/src/images/gitLogo.png b/web/src/images/gitLogo.png index 3af17d971..ccd50467a 100644 Binary files a/web/src/images/gitLogo.png and b/web/src/images/gitLogo.png differ diff --git a/web/src/images/gitnessIcon.png b/web/src/images/gitnessIcon.png new file mode 100644 index 000000000..3af17d971 Binary files /dev/null and b/web/src/images/gitnessIcon.png differ diff --git a/web/src/images/signup-gitness.png b/web/src/images/signup-gitness.png new file mode 100644 index 000000000..c620a09e8 Binary files /dev/null and b/web/src/images/signup-gitness.png differ diff --git a/web/src/images/signup.png b/web/src/images/signup.png index c620a09e8..1761c096d 100644 Binary files a/web/src/images/signup.png and b/web/src/images/signup.png differ diff --git a/web/src/index.html b/web/src/index.html index 3d4d33cb1..7c249c36f 100644 --- a/web/src/index.html +++ b/web/src/index.html @@ -7,7 +7,7 @@ - Gitness + Harness Open Source diff --git a/web/src/index_public.html b/web/src/index_public.html index 2de9b1936..6768caf9a 100644 --- a/web/src/index_public.html +++ b/web/src/index_public.html @@ -7,7 +7,7 @@ - Gitness + Harness Open Source diff --git a/web/src/layouts/layout.tsx b/web/src/layouts/layout.tsx index a79586016..7eb2734ca 100644 --- a/web/src/layouts/layout.tsx +++ b/web/src/layouts/layout.tsx @@ -23,7 +23,7 @@ import { useAppContext } from 'AppContext' import { useStrings } from 'framework/strings' import { useDocumentTitle } from 'hooks/useDocumentTitle' import { NavMenuItem } from './menu/NavMenuItem' -import { GitnessLogo } from '../components/GitnessLogo/GitnessLogo' +import { HarnessLogo } from '../components/HarnessLogo/HarnessLogo' import { DefaultMenu } from './menu/DefaultMenu' import css from './layout.module.scss' @@ -43,7 +43,7 @@ export const LayoutWithSideNav: React.FC = ({ title, chi - + {menu}