Commit Graph

2527 Commits (devcontainer-setup)

Author SHA1 Message Date
Johannes Batzill c0258b34ef Add search capability to repo and space listing (for child spaces) (#44)
This change is adding search capability to the following apis:
- child repositories
- child spaces
*NOTE* The search space is limited to direct child repos/spaces.
2022-10-24 18:57:55 -07:00
Johannes Batzill 5337c46a4f Add Query and Sorting Capability to ListBranches API (#42)
This change adds the following to the list branches api:
- 'query' parameter for querying branches using arbitrary substrings
- 'sort' parameter for sorting the branches (name and date supported)
- 'direction' parameter for specifing the direction of the sorted output
2022-10-21 20:45:26 -07:00
Johannes Batzill f655c2fae3 Add Standalone API to Harness Router (#40)
To simplify UI code we are going to expose both Harness API and Standalone API (restricted to harness embedded functionalities) when running in harness mode.

Furthermore, this PR adds a middleware that allows us to reuse standalone Handlers for Harness API for operations that don't require any request/response manipulation.
2022-10-19 18:35:40 -07:00
Johannes Batzill 743aee6029 [API] Add List Branches, Improve latestCommit Performance for listing directory (#38)
This commit has the following changes:
- API for listing branches
- Improve performance of content API for dir type responses with includeCommit=true
- swagger for git operations
- fix file names from camelCase to kebab_case
2022-10-17 23:05:50 -07:00
Johannes Batzill e423ffda3c Fix Default Branch Creation (#37)
While the HEAD is pointed to the correct branch (might not exist), we created the initial files during repo creation still on the master branch (as it's an empty repo and clone by default sets up master when cloning an empty repo)
2022-10-17 19:09:46 -07:00
Enver Bisevac 41cbb6622f server urls added, resource moved to the root path (#35) 2022-10-18 02:24:20 +02:00
Johannes Batzill 7317ec9d62 Remove types dependency from gitrpc package, add back commits/content api (#36) 2022-10-17 17:12:52 -07:00
Johannes Batzill 0a7857f660 Fix License header to 2022 (#34) 2022-10-17 15:33:49 -07:00
Enver Bisevac 2b69b3d24a [MAINT] added repos endpoints to swagger (#33)
* added repos endpoints

* todo comments removed in create repo method
2022-10-18 00:10:36 +02:00
Johannes Batzill 91a75ed601 Add GetContent and ListCommits APIs, Fix DefaultBranch support (#32)
Adds the following:
- Add GetContent API (with gitrpc, proto, gitadapter changes)
- Add ListCommits API (with gitrpc, proto, gitadapter changes)
- DefaultBranch (to repo table in DB, update branch in git-repo, have default value in config)
2022-10-17 00:14:31 -07:00
Enver Bisevac 00647d7d1b [MAINT] golangci-lint config changed (#31)
* goheader linter added

* file header consistency
2022-10-13 14:39:15 +02:00
Johannes Batzill ecb6276fa8 Add EOF to RPC File Chunk & Cleanups (#29)
Adds an EOF flag to data chunks to avoid using []byte("EOF") as end (due to potential false positives).
Furthermore, a few cleanups are done:
- Add TODOs for initial git changes
- Add missing file headers
- Fix typo for license (was licence)
- Fix make wire target
2022-10-12 10:21:53 -07:00
Tan Nhu 6cadb048ba Initial skeleton for Repository Resource View flow (#30)
* API integration for Repos listing page

* Add custom branch when creating a repo

* Skeleton for Repository Resource View flow
2022-10-11 23:54:10 -07:00
Enver Bisevac 1cf07b6417 initial work on create repository (#27)
* initial work on create repository

* create repository as single method call using client stream

* resources handler and files

* minor fix for wire dep graph
2022-10-11 17:48:04 +02:00
Johannes Batzill 5786ad2409 [Embedded] Harness Router, Inline Space Creation, Bootstrap, Harness/Admin User Setup (#28)
Adds the basic for harness embedded mode:
- Harness dedicated router with custom APIHandler
- Inline Space Creation
- Client for Account/Org/Project
- Bootstrap (Allows for automated creation of admin user and gitness service (used for all platform required ops))
- Inline harness service principal creation
- Ignore flag for ACL.
2022-10-10 21:32:14 -07:00
Johannes Batzill c07dc4c779 Remove translator (#26)
Simplify the router code by removing the translator. Now that we have Api/Git/WebHandler interfaces, they can be wrapped in handlers to do any custom request translation.
2022-10-04 10:16:26 -07:00
Johannes Batzill fad6e18898 Introduce Controller for Repo, Space, User, and ServiceAccount (#25)
Preparing the support for harness specific API router + http handler, which allows us to have complete control over the rest api naming and functionality, without having to do complex path rewrites or request / reponse rewrites inline.
2022-10-03 18:56:49 -07:00
Tan Nhu e4cf2e7279 Update README.md 2022-10-03 12:17:43 -07:00
Tan Nhu 788ee30ba3 Add prototyping for Repos page (#24) 2022-10-03 12:06:27 -07:00
Johannes Batzill 4d3db64397 add specific handlers for api/git/web to allow replacement for harness (#23)
Abstracting the api/git/web routers will allow us to replace API routing (and potentially web?), while keeping the rest the same.
2022-09-30 17:05:39 -07:00
Johannes Batzill 4668e94027 [Harness] Adding JWT/PAT/SAT Support, Harness Clients, Inline User/ServiceAccount Creation, harness Build flag, ... (#22)
This change adds the initial stepping stones for harness integration:
- Authentication: JWT/PAT/SAT support
- Authorization: ACL integration (acl currently denies requests as gitness hasn't been integrated yet)
- Remote Clients for Token, User, ServiceAccount, ACL
- User Integration: Syncs harness users during authentication if unknown
- SA integration: syncs harness service accounts during authentication if unknown
- Initial harness API: THIS WILL BE CHANGED IN THE FUTURE!
- single harness subpackage (all marked with harness build flag)
- harness & standalone wire + make build commands
2022-09-30 16:22:12 -07:00
Johannes Batzill 5baf42d5ca Add context to pingDatabase and change logging behavior (#21)
Add cancelable context to our server CLI and adds canceling and improved logging to PingDatabase
2022-09-27 09:45:52 -07:00
Johannes Batzill d0cba5509e Fix pingDatabase routine to complete on successful ping (#20) 2022-09-26 10:58:04 -07:00
Johannes Batzill 8c2f900c80 Principals, ServiceAccounts, Tokens and auth.Sessions (#15)
This change introduces the concept of a principal (abstraction of call identity), and adds a new service account type principal. Also adds support for different tokens (session, PAT, SAT, OAuth2) and adds auth.Session which is being used to capture information about the caller and call method.
2022-09-25 23:44:51 -07:00
Enver Bisevac f3ef0f64fc gh token secret for ci pipeline 2022-09-22 19:44:43 +02:00
Enver Bisevac 78d5794221 makefile build rule modified, ioutil deprecated removed 2022-09-22 16:27:46 +02:00
Enver Bisevac 66f2dadb7a [MAINT] fixing linter errors (#19)
* fix linter errors

* fix exhaust linter error

* fix exhaust linter error

* fix linter errors

* golangci-lint timeout increased

* golangci-lint verbose flag
2022-09-22 16:08:41 +02:00
Enver Bisevac 560c08dcca [MAINT] fix linter errors. (#18)
* fix linter errors

* fix exhaust linter error

* fix exhaust linter error
2022-09-21 19:49:14 +02:00
Enver Bisevac f03528e862 [MAINT] initial config for ci linter (#17)
* initial config for ci linter

* more linter work

* linter errors fix

* linter errors fix

* linter conf minor changes
2022-09-19 18:13:18 +02:00
Enver Bisevac 11f3aa532c readme updated 2022-09-13 01:56:42 +02:00
Enver Bisevac 1808545de2 codeql workflow added 2022-09-13 01:48:14 +02:00
Enver Bisevac 47bbd0cdf7 codeql workflow added 2022-09-13 01:45:43 +02:00
Enver Bisevac cad145b4ae node action added in ci 2022-09-13 01:13:01 +02:00
Enver Bisevac 46b4b98d1f node action added in ci 2022-09-13 01:09:33 +02:00
Enver Bisevac 8aa924416d node action added in ci 2022-09-13 01:04:14 +02:00
Enver Bisevac 89b44d2862 node action added in ci 2022-09-13 01:03:19 +02:00
Enver Bisevac b416d5ce85 node action added in ci 2022-09-13 01:00:38 +02:00
Enver Bisevac e2d3baf58a Merge branch 'main' of github.com:harness/gitness 2022-09-13 00:39:45 +02:00
Enver Bisevac f87602e20e action status badge 2022-09-13 00:39:22 +02:00
Enver Bisevac 3d626f7099 Create ci.yml 2022-09-13 00:35:25 +02:00
Enver Bisevac a549689c16 Merge branch 'main' of github.com:harness/gitness 2022-09-13 00:28:28 +02:00
Enver Bisevac 90693f7a10 precommit modified 2022-09-13 00:28:14 +02:00
Enver Bisevac ca8aa47e05 [MAINT] initial work on linter setup (#16)
* initial work on linter setup

* simple linter rules fixed
2022-09-13 00:08:43 +02:00
Enver Bisevac f58ceac474 [MAINT] initial work on local dev env (#13)
* initial work on local dev env

* minor changes on makefile

* pre-commit x permission added

* readme updated and minor improvments in docker conf
2022-09-12 19:09:04 +02:00
Johannes Batzill b7b9f53b0d Improve error handling to match go standards - don't wrap and rethrow, but log and return. Also adds some more validations for path creation and resource moving. Add accesslogging for git and api router (#14)
This commit contains the following:
- Improve and simplify error handling (remove unnecessary wrappers, make it feel like go)
- Add extra validation for path creation and resource moving (path has to be within same top space, no top space alias allowed)
- Add access logging for rest api and git api
2022-09-09 22:08:46 -07:00
Johannes Batzill 4812beedc6 Enforce max path length on store layer to avoid racing condition, (#12)
Add enforcement of the path length to the store layer before writing the path, move errs to internal, and adds a comms package under internal/api.
2022-09-09 00:45:41 -07:00
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
Johannes Batzill 1db4fc9c8d Change create API for space/repo to follow REST best practices (#10)
Move repo and space create apis to /api/v1/repos/ and /api/v1/spaces/ and take name and parentId in body.
2022-09-06 20:36:34 -07:00
Johannes Batzill 608ae2f0c8 Add Basics for Authn, Authz, Spaces, Repos. #9
This PR removes some unnecessary files inherited from the sample-repo,
and adds the frame for the following:

Rest Server (terminated FQN encoding, high level routing, basic API/GIT/UI routes, repo/space/user injection into request)
Spaces (Struct, DB, CRUD Operations)
Repos (Struct, DB, CRUD Operatons)
guard middleware for simplifying authorization
Authentication (Abstraction, frame for harness integration)
Authorization (Abstraction, harness ACL based implementation)
2022-09-06 15:02:41 -07:00
Johannes Batzill 3fa479429c Address comments on customer guard errors 2022-09-06 15:01:13 -07:00