Commit Graph

84 Commits

Author SHA1 Message Date
Enver Bisevac
b092c1b8df added go-rbac dependency 2023-04-18 03:10:30 +02:00
Enver Bisevac
5c266ad78f fix for merge-check response 2023-03-30 20:51:25 +02:00
Enver Bisevac
75ec201c2b Merge branch 'eb/gitrpc_error_handling' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#8) 2023-03-21 10:19:21 +00:00
Marko Gaćeša
c7c36e49e1 Add git blame API (#346) 2023-03-09 12:55:23 +01:00
Enver Bisevac
56d8f304a6 gitrpc error handling - initial work 2023-03-06 16:36:19 +01:00
Enver Bisevac
fd08fa9775 [maint] api for PR metadata added (#319) 2023-02-12 21:39:56 -08:00
Enver Bisevac
82b8679d6f [fix] diff-stats api returns total commits and files changed in compare branches (#323) 2023-02-13 00:47:23 +01:00
Enver Bisevac
13a456e357 [scm-58] Add merge-check and Integrate with PR (#318)
Co-authored-by: Johannes Batzill <johannes.batzill@harness.io>
2023-02-11 23:22:12 -08:00
Johannes Batzill
b0c8c91c08 [MISC] Hide email from public principals API. (#314) 2023-02-06 11:33:41 -08:00
Johannes Batzill
bf9906c4ce [API] Add principals API, move users to admin, simplify user/service/serviceaccount validation (#300) 2023-02-03 00:15:11 -08:00
Johannes Batzill
c5d92b498b [API] Add GetCommit API (#291) 2023-02-01 18:50:54 -08:00
Johannes Batzill
fe83493623 [API] Add GetBranch API (#290) 2023-02-01 18:13:27 -08:00
Enver Bisevac
e2b350e704 [maint] pr statistic is in pr response now (#269) 2023-01-31 15:21:05 +01:00
Enver Bisevac
baa3822acc [SCM-55] initial work on PR metadata (#262) 2023-01-31 02:08:23 +01:00
Johannes Batzill
7da9bce7c1 [Githook] Add GitHook binary (#259)
This PR adds a githook sub-package to our cmd packages, introducing the githook binary.
The binary is linked as pre-receie/update/post-receive by gitrpc if configured.
This is required to have a gitrpc deployment without requiring the one-in-all gitness binary on the same machine.
2023-01-27 13:04:58 -08:00
Enver Bisevac
6a7cc4e518 [scm-63] fix for empty commits and diff in PR (#228) 2023-01-20 02:27:51 +01:00
Johannes Batzill
335998505e [MISC] Introduce PathStore and Move PathLogic to Controller Layer (#226)
This change is a follow up on the effort to remove transactions and sync stores from the database layer, and move them in the application layer. It is addressing the repo + space store.
The following changes are included:
- Introduce PathStore storing resource paths (repo + space)
- Add foreign key from path.repo_id/space_id to repo.id/space.id
- Add foreign key from repo/space.parent_id to space.id
- Remove repo_sync and space_sync
- Move path creation logic to repo/space controller (for both creating primary paths for new repos/spaces, as well as creating alias spaces)
- Reimplement repo/space moving on controller layer
2023-01-18 11:34:12 -08:00
Hitesh Aringa
66cc979334 [SCM-61]: sort in webhook list api (#199)
* [SCM-61]: order by in webhook api

* [SCM-61]: comment change

* [SCM-61]: added query filter on display name
2023-01-17 09:59:27 -08:00
Marko Gaćeša
8151b4591e PR change state API; Removed rejected state (#220) 2023-01-17 16:04:30 +01:00
Enver Bisevac
63de576d08 [feat] initial work on merging PR (#170)
* initial work on merging PR

* code refactored based on requested changes

* requested changes
2023-01-10 02:09:43 +01:00
Johannes Batzill
5cb824debd [feat]: Add Git Server Hook Support (#159)
This change is adding git server hook components:
- githook CLI implementation
- githook api handlers
- githook controler
2023-01-06 12:15:11 -08:00
Marko Gaćeša
65b49a933a pull request reviewers (#167) 2023-01-06 20:29:20 +01:00
Johannes Batzill
2006f769c9 [Webhook] Add url.Provider, Add principal to branch webhooks (#163) 2023-01-06 01:57:26 -08:00
Johannes Batzill
6c567b38d0 [MISC] Move GitRPC to Read/WriteRequest, Update Create/Delete Branch to use Push, Setup githook Symlink, Accept Incoming X-Request-Id (#157) 2023-01-05 11:03:35 -08:00
Johannes Batzill
7ada1af3aa [API] Add after Support to Commit Listing (#155) 2023-01-04 16:59:43 -08:00
Johannes Batzill
1f1118f624 [Webhook] Add Event Processing and Retrigger (#148)
This change includes:
- webhook event processor (includes actual webhook execution)
- webhook retrigger API allowing to retrigger previous webhook executions
2023-01-04 14:43:36 -08:00
Johannes Batzill
44ec7ceb07 [Webhook] Add API and DB Basics (#142)
This change introduces:
- webhook type / store / controller / handler
- webhookExecution type / store / controller / handler
- foreign key fix for sqlite3
2022-12-28 13:07:48 -08:00
Marko Gaćeša
da53331ca1 PR comment: edit and delete APIs (#138) 2022-12-27 14:55:53 +01:00
Marko Gaćeša
b5bdeb8538 create comment API (#137) 2022-12-27 11:46:49 +01:00
Marko Gaćeša
7fc77396a9 Pull request timeline feature: DB and the list API (#136) 2022-12-26 12:17:38 +01:00
Enver Bisevac
22b0595476 initial work on raw diff (#129) 2022-12-22 14:30:31 +01:00
Marko Gaćeša
204548169d pullreq: update API (#122) 2022-12-13 16:13:27 +01:00
Marko Gaćeša
fe9118e074 PullReq list API: Added pagination headers (#121) 2022-12-09 17:02:45 +01:00
Marko Gaćeša
15163f3daa pullreq: dedicated struct for pulling data from DB (#116) 2022-12-08 12:52:31 +01:00
Marko Gaćeša
9e86875217 Returning author and merger info for PRs (#114) 2022-12-07 14:03:17 +01:00
Enver Bisevac
7a54ef9d65 fix with file content on commit, fix linter, removed unused provider 2022-11-30 22:36:01 +01:00
Marko Gaćeša
1f4ac7e4b4 pullreq: list API (#99) 2022-11-30 13:56:29 +01:00
Marko Gaćeša
1eba93695b feat: pull requests (#89)
* feat: pull requests, data layer

* pull requests: api layer

* add pull request number

* added auth check
2022-11-29 13:51:59 +01:00
Enver Bisevac
630c9b553f ordering imports linter and writer (#85) 2022-11-22 23:42:39 +01:00
Enver Bisevac
ad619c7e3c [feat]ability to commit files using REST api (#82)
* initial work on commit files

* minor improvements, grpc server interceptors and more

* compare file old sha and current sha

* added some validation steps

* config immutable, introduce temp repos dir

* handler added to standalone

* fix CI linter, fix minor bug on update

* wire generator files
2022-11-22 19:24:40 +01:00
Johannes Batzill
60f0ea969d [API] Add API For Commit Divergence Calulation (#77)
This commit contains the following changes:
- Add `commits/calculate_divergence` API to calculate commit divergence of reference pairs
- Rename `serviceAccounts` to `service_accounts` to follow REST best practices
2022-11-16 16:53:31 -08:00
Enver Bisevac
86716b4a0c [bug] authentication on push to public repo (#74)
* authentication on push to public repo

* receivepack or uploadpack this should also be enum.PermissionRepoEdit or enum.PermissionRepoView

* accountID used for realm
2022-11-15 21:59:58 +01:00
Enver Bisevac
93fc430776 [bug] git clone/pull/push auth using Basic Authorization fixed (#66)
* git clone/pull/push auth using Basic Authorization fixed

* use api key as git login

* middleware renamed to RequiredInGitPath

* remove requiredingitpath middleware

* requested changes

* requested changes

* minor code cleanup
2022-11-11 07:59:32 +01:00
Johannes Batzill
c55c53deab [API] Add Create + Delete Branch API (+ Basic GIT Error Propagation) (#70)
This change adds the following:
- create / delete branch
- basic error propagation from git to user (notfound, conflict, invalidinput)
- create repo root folder in server instead of service constructor
2022-11-10 20:57:31 -08:00
Johannes Batzill
c8cee4d250 [Misc] Preparation for Container Deployment (#67)
This change is fixing our docker file which is used to build our harness code image used for PR deployments.
Furthermore, the change contains some logging improvements that were added along the way of setting up the PR environment.
2022-11-09 23:03:40 -08:00
Johannes Batzill
ff2f949e78 add GITURL to repo apis list and create (#64)
- rename repo.url to repo.GitURL to avoid ambiguity
- add support to create / list api
- add default value (http://localhost:3000)
- remove handler backfilling host / port to simplify flow (can be added if needed)
2022-11-08 19:35:49 -08:00
Enver Bisevac
98436fb644 clone url implemented (#63)
Clone URL (http) used for clone/pull/push git operations
2022-11-08 18:32:01 -08:00
Enver Bisevac
e24c2192eb repo path fixed on gitrpc server 2022-11-09 00:10:55 +01:00
Johannes Batzill
3ba0f75c8d Introduce UIDs for Space / Repo / Tokens, Add Custom Harness Validation, ... (#57)
This change adds the following:
- Space UID + Custom harness validation (accountId for top level space, harness identifier for child spaces)
- Repo UID + Custom harness validation (harness identifier)
- Store Unique casing of space / repo path and add Path.ValueUnique (with Unique index) to allow for application layer controlling the case sensitivity (case insensitive standalone vs partially case sensitive harness)
- Token UID (unique index over ownertype + ownerID + tokenUID)
- Add DisplayName for principals (replaces Name to avoid confustion)
- Store Unique casing of principal UID and add Principal.ValueUnique (with unique index) to allow for application layer, per principal type control of case sensitivity (required in embedded mode)
- Generate serviceAccount UID (+Email) Randomly (sa-{space|repo}-{ID}-{random}) - Allows to have a unique UID across all principals while reducing likelyhood of overlaps with users + avoid overlap across spaces / repos.
- Sync casing of space names (accountId orgId projectId) when creating spaces on the fly (to ensure case sensitivity of - harness code) or use the existing space to update casing.
- Update serviceaccount client to match updated NG Manager API
- in embedded mode create spaces for harness resources owning the service account
2022-11-06 23:14:47 -08:00
Enver Bisevac
578dd13d8d [maint] eb/gitrpc refactor (#51)
* pull/push impl done

* Basic auth for harness

* gitrpc as top level package

* New ctor for package

* gitrpcserver instead of server2
2022-11-03 13:17:03 +01:00