82 Commits

Author SHA1 Message Date
Atefeh Mohseni-Ejiyeh
4b0dd89a6b Merge branch 'atmsn/code165' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#52) 2023-05-09 18:52:03 +00:00
atefeh
a309f4ec9b CODE 165-API for delete a space subspaces and their repositories 2023-05-09 09:21:25 -07:00
atefeh
8b335d1573 code195 repo delete cleanup, and added a cron manager for cronjobs and unit tests 2023-05-04 09:10:10 -07:00
Enver Bisevac
fffb37bfa2 Merge branch 'eb/rbac' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#25) 2023-04-19 15:29:46 +00:00
Johannes Batzill
89bb0f6b99 update gitRPC getBlob api to stream blob content, add 'raw' api. 2023-04-18 11:39:59 -07:00
Enver Bisevac
b092c1b8df added go-rbac dependency 2023-04-18 03:10:30 +02:00
Marko Gaćeša
13e4ffe522 Add code comments 2023-04-13 14:12:01 +02: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
Marko Gaćeša
efcd415603 CLI migrate command (#304) 2023-02-07 12:50:46 +01:00
Johannes Batzill
9bec905a65 [MISC] Always create system service principal (#309) 2023-02-03 19:18:29 -08:00
Marko Gaćeša
89c135f94b Improve sanitize maching name fn (#303) 2023-02-03 18:56:20 +01:00
Marko Gaćeša
c8301fc842 cli session: Fix new session path (#302) 2023-02-03 14:19:06 +01:00
Marko Gaćeša
236e2ede9e Refactor cli app startup (#293) 2023-02-03 12:08:02 +01: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
8f82c0ce4e [Webhook] Add Support for PR Branch Updated (#267) 2023-01-31 13:07:48 -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
Marko Gaćeša
4277c4c66b Simplify handling of PR events (#253) 2023-01-27 16:27:03 -08: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
Johannes Batzill
114cdb34e0 [GITRPC] Add GitRPC Binary (#257) 2023-01-27 10:34:42 -08:00
Johannes Batzill
bfb0466b11 [MISC] Move configurations to their respective packages (#256) 2023-01-26 17:30:26 -08:00
Enver Bisevac
1f86b3c73d [fix] merge commit is blocked with dbtx mutex lock (#245) 2023-01-26 13:41:45 +01:00
Marko Gaćeša
7a92d8e110 PR events and PR head ref (#244) 2023-01-25 11:19:58 +01:00
Marko Gaćeša
5524dfa9ba Renamed branchmonitor to service/pullreq (#234) 2023-01-19 17:53:37 +01:00
Johannes Batzill
43c497f59c [MISC] Move webhooks to 'services' package (#232) 2023-01-18 19:08:03 -08: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
Marko Gaćeša
ec4003e331 Handling branch events for PRs (#221) 2023-01-18 13:26:20 +01:00
Johannes Batzill
155563615b [MISC] Minor Cleanup in types + enum Package (#186) 2023-01-11 23:16:07 -08:00
Marko Gaćeša
24e03c03e0 Added principal info cache (#173)
* added principal info cache

* updated code based on the PR comments

* updated implementation of deduplicate()

* minor changes

* [K, T] -> [K, V]
2023-01-11 20:32:37 +01:00
Johannes Batzill
d1dd518b3f add commit details to webhook payload (#175) 2023-01-11 10:51:28 -08:00
Johannes Batzill
a426cdd69b [GIT] Add Support for Other Git Clients (#171) 2023-01-10 14:35:09 -08: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
06721dcf20 [Techdebt] merge user/service/serviceaccount stores into single principal store (#160)
This change merges the `UserStore`, `ServiceStore`, and `ServiceAccountStore` into a single `PrincipalStore`.
2023-01-05 15:58:18 -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
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
c30beb34ac [Harness] Add user self API (#147)
This change is adding the following:
- Global HarnessContext injection
- Block API KEY authentication for global context (They are tied to accounts)
- /user API endpoint for embedded mode
2022-12-29 16:01:14 -08:00
Marko Gaćeša
a79e187a88 DB & API refactor: Use snake case (#144)
Update DB and API to follow Harness Standard
2022-12-29 13:53:08 -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
7fc77396a9 Pull request timeline feature: DB and the list API (#136) 2022-12-26 12:17:38 +01:00
Johannes Batzill
7abcacdd2f feat: Add Events Framework (#120)
This Commit adds:
- stream package (provides different implementation of stream producers and consumers)
  + Redis -> will be used for any non-local deployments
  + InMemory -> a VERY BASIC implementation that is used for local execution
- events package
  + GenericReporter -> responsible for reporting events, can be used to send any type of event and payload
  + GenericReader -> responsible for reading events from a stream, can be used to register handlers for any type of event and payload
  + ReaderFactory -> responsible for launching readers for any type of consumer group&name.
- webhook package
  + The wire frame of the webhook package.
- gitrpc/events package
  + defines event Reader/Reporter for events of category git
2022-12-16 13:37:08 -08:00
Johannes Batzill
3b120dd2b3 Add Zerolog Support to GITRPC (#126)
This change adds the following:
- Inject APP server zerolog RequestID as metadata into all gitrpc calls from client side.
- Inject Zerolog logger into context with common fields set (like service, method, requestID, ...). This allows for better request tracking within gitrpc, but also request tracking across services we extract the requestID send by the grpc client
- Modify http logs to use http. prefix for common http related logging annotations.
2022-12-16 08:39:10 -08:00
Shubham Banthia
c6e178c71c adding server hook implementation for post and pre receive (#109)
* adding server hook implementation for post and pre receive

* addressing comments

* update logging

* updating import order

* adding file header for license
2022-12-02 13:25:53 -08:00
Enver Bisevac
7a54ef9d65 fix with file content on commit, fix linter, removed unused provider 2022-11-30 22:36:01 +01:00
Shubham Banthia
c7df722c8a adding server side hook for update (#94)
* adding server side hook for update

* addressing comments

* update comments for command
2022-11-29 19:51:08 -08: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