Johannes Batzill 1115a5083b Add Paths support and error improvements (#11)
This change is adding the concept of Paths.
A repository and space always have a Primary Path which always is represents the ancestry to the root space.
All access history / resource visibility / child listings / UI traversal / etc. is done via that path.

Additionally, repos and spaces can have Alias Paths, which as the name states are aliases. via the primary path.
They sole impact is that a space or repo can be reached via different paths from the UI / rest apis / git apis.
This fulfills two major purposes:
- Customers can rename or move projects and spaces without breaking any existing references from CI pipeliens / code bases / local repos / ...
- Customer can create shorter aliases for important repos when in harness embeded mode! (acc/org/proj/repo can be shortened to acc/repo, or acc/repo'

Apart from the path changes, this PR adds:

Improved User facing errors
Improved internal error handling and wrapping
update / rename operation for repo and space
path list / delete / create operation for repo and space
2022-09-08 21:39:15 -07:00
2022-08-09 12:37:37 -07:00
2022-09-05 13:47:00 -07:00
2022-08-29 10:12:07 -07:00
2022-08-29 10:12:07 -07:00
2022-08-09 12:37:37 -07:00
2022-08-09 12:37:37 -07:00
2022-08-29 14:28:46 -07:00
2022-08-29 10:12:07 -07:00
2022-08-09 12:37:37 -07:00
2022-08-09 12:37:37 -07:00
2022-08-29 10:12:07 -07:00
2022-08-29 10:12:07 -07:00
2022-08-29 10:12:07 -07:00
2022-08-09 12:37:37 -07:00

Pre-Requisites

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

$ go install github.com/golang/mock/mockgen@latest
$ go install github.com/google/wire/cmd/wire@latest

Build

Build the user interface:

$ pushd web
$ npm install
$ npm run build
$ popd

Build the server and command line tools:

$ go generate ./...
$ go build -o release/gitness

Test

Execute the unit tests:

$ go generate ./...
$ go test -v -cover ./...

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.

Start the server at localhost:3000

$ release/gitness server

User Interface

This project includes a simple 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.

Swagger

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.

Command Line

This project includes simple command line tools for interacting with the system. Please remember that you must start the server before you can execute commands.

Register a new user:

$ release/gitness register

Login to the application:

$ release/gitness login

Logout from the application:

$ release/gitness logout

View your account details:

$ release/gitness account

Generate a peronsal access token:

$ release/gitness token

Create a pipeline:

$ release/gitness pipeline create <name>

List pipelines:

$ release/gitness pipeline ls

Debug and output http responses from the server:

$ DEBUG=true release/gitness pipeline ls

View all commands:

$ release/gitness --help
Description