Commit Graph

425 Commits

Author SHA1 Message Date
Abhinav Singh
1a07ee90d2 fix: [CODE-965]: codeowners file parse (#684) 2023-10-18 06:38:50 +00:00
Marko Gacesa
419fe92dde add branch protection: DB and API layer (#671) 2023-10-16 11:33:00 +00:00
Akhilesh Pandey
23b9117302 feat: Image Upload (Backend) (#651) 2023-10-11 17:54:03 +00:00
Abhinav Singh
1a5c6b06ac feat: Add pr closed event (#643) 2023-10-05 01:39:33 +00:00
Johannes Batzill
d83552f288 [MISC] Cleanup stale Webhook-Executions & Session Tokens (#640) 2023-10-03 17:54:18 +00:00
Johannes Batzill
f51f97adb2 [MISC] Make Internal/Container URL Generic (and fix GetTreeNode) (#621) 2023-09-28 03:33:45 +00:00
Johannes Batzill
f2bf0991e3 [MISC] Fix casing in ENV Var (#616) 2023-09-26 18:04:03 -07:00
Johannes Batzill
dc351cdcef [LINT] Fix All Linting Errors (#609) 2023-09-26 00:56:53 +00:00
Johannes Batzill
5ca48e7f59 [MISC] Replace BIND with PORT, fix space_path for postgres (#607) 2023-09-25 22:34:45 +00:00
Johannes Batzill
1246bd78ab [MISC] improve url generation to reduce configuration overhead (#606) 2023-09-25 17:58:20 +00:00
Johannes Batzill
a83cd21c17 [OPEN-SOURCE] Prepare Repository (#605) 2023-09-24 07:33:16 +00:00
Johannes Batzill
6c42b77500 [SSE] Add full stack SSE support for PRs (#591) 2023-09-21 02:55:41 +00:00
Enver Bisevac
36f83c8652 cookie name configurable 2023-09-20 16:54:47 +02:00
Johannes Batzill
fde1490c59 [UI] Dynamic reloading of code comments (#547) 2023-09-19 21:42:33 +00:00
Vistaar Juneja
40af7bfa33 add plugins support for v1 YAML (#552) 2023-09-19 21:05:50 +00:00
Vistaar Juneja
7eaed15272 add stage.when support and cancel/schedule downstream stages (#524) 2023-09-18 21:34:54 +00:00
Abhinav Singh
7b153fbd84 Merge branch 'abhinav/CODE-888' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#521) 2023-09-18 21:31:25 +00:00
Abhinav Singh
b28df9bde2 address coments 2023-09-18 12:57:41 -07:00
Johannes Batzill
27de7971b9 [File Viewed] Adding Full Stack Support for File Viewed Feature (#516) 2023-09-18 15:59:40 +00:00
Vistaar Juneja
094c14049a decrease parallel workers to 2 for CI (#522) 2023-09-18 13:36:07 +00:00
Abhinav Singh
16e6889811 feat: [CODE-888]: minor export improvements 2023-09-18 01:10:47 -07:00
Abhinav Singh
a09421e01b Merge remote-tracking branch 'origin' into abhinav/CODE-888 2023-09-18 00:38:44 -07:00
Abhinav Singh
c7971bbbb1 feat: [CODE-888]: minor export improvements 2023-09-18 00:27:55 -07:00
Johannes Batzill
ac87d06e5e [SWAGGER] Minor Swagger Fix and yarn services (#506) 2023-09-15 18:59:34 +00:00
Vistaar Juneja
bb7a914233 Adds support for V1 YAML (#496) 2023-09-15 15:56:35 +00:00
Johannes Batzill
0a9dde7459 [Refactor] Move from paths to space_paths Table (#500) 2023-09-15 15:19:53 +00:00
Abhinav Singh
4ff032c968 feat: [CODE-852]: code export e2e (#483) 2023-09-15 08:08:13 +00:00
Abhinav Singh
3f58c5bc3e feat: [CODE-861]: Export progress (#490) 2023-09-15 08:04:46 +00:00
Enver Bisevac
53d277b108 metrics collector added 2023-09-14 13:25:44 +02:00
Johannes Batzill
8cd3e5d015 [Standalone] Add temporary JWT for pipeline executions (#480) 2023-09-14 08:54:03 +00:00
Vistaar Juneja
5612c9a438 move CI migrations to main folder (#459) 2023-09-13 22:17:29 +00:00
Vistaar Juneja
625d8af797 add cancellation support for CI builds (#456) 2023-09-13 15:22:26 +00:00
Marko Gaćeša
035815539d resolve issues with repo import 2023-09-13 14:23:00 +02:00
Vistaar Juneja
3bc56a1814 add support for checks summary in CI (#436) 2023-09-13 09:55:25 +00:00
Johannes Batzill
db4379e5b9 [SSE] Add repository_import_completed event (#445) 2023-09-13 02:45:03 +00:00
Johannes Batzill
ef4855e901 [Server Sent Events] Improve both Frontend and Backend (#441) 2023-09-12 23:45:54 +00:00
Vistaar Juneja
c7ef132cbc add support for triggered builds (#428) 2023-09-12 09:08:38 +00:00
Marko Gaćeša
cde80d53a8 add space import 2023-09-09 12:55:49 +02:00
Johannes Batzill
0d086a1a4d [Events] This PR introduces the Trigger Service for Event Consumption + Some Minor improvements (#419) 2023-09-08 23:52:19 +00:00
Vistaar Juneja
414993a388 add pubsub for events 2023-09-08 12:52:25 +01:00
Marko Gaćeša
239ae8f10f add repo import api 2023-09-08 11:55:38 +02:00
Vistaar Juneja
1f89bdb9f9 address comments 2023-09-07 19:39:37 +01:00
Vistaar Juneja
501605721e address comments, fix stage and step join 2023-09-07 16:29:15 +01:00
Vistaar Juneja
4c8302845d add logic to run executions 2023-09-07 11:07:49 +01:00
Marko Gacesa
4a596edab2 Merge branch 'mg/jobs/global_ctx' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#400) 2023-09-05 19:26:15 +00:00
Marko Gaćeša
28931b39e6 use global ctx to launch jobs 2023-09-05 21:22:52 +02:00
Johannes Batzill
e9ec7d1933 [MISC] Change User Sign-Up Default Value (#399) 2023-09-05 19:10:39 +00:00
Marko Gaćeša
646bd3745d fix canceling of scheduled jobs 2023-09-04 10:44:21 +02:00
Johannes Batzill
f09ce8987a Merge branch 'jobatzil/fix/rbac_statuscheck' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#374) 2023-09-01 07:49:34 +00:00
Johannes Batzill
94dc365d3e move commitcheck report permission under repo 2023-09-01 00:48:39 -07:00
Vistaar Juneja
c97d4783a9 add optional execution information in list pipelines (#384) 2023-08-31 19:26:53 +00:00
Vistaar Juneja
d15aa03dfd move pipelines, executions, triggers & logs under repos (#376) 2023-08-31 08:03:33 +00:00
Marko Gacesa
5a2caa9c3e Merge branch 'mg/jobs/initial' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#342) 2023-08-29 16:29:37 +00:00
Marko Gaćeša
045d80c5bf background jobs 2023-08-29 17:57:09 +02:00
Vistaar Juneja
a1948ff42d Add plugins list API (#349) 2023-08-28 19:02:46 +00:00
Marko Gaćeša
dea23b88a4 add filtering and pagination to the user's list spaces API 2023-08-28 14:02:58 +02:00
Vistaar Juneja
b94d30dcb6 address comments 2023-08-22 18:21:31 +01:00
Vistaar Juneja
ebfac87860 fix some formatting 2023-08-22 15:28:30 +01:00
Vistaar Juneja
23f612162a add connector/template permissions, add in controllers for connectors and templates 2023-08-22 14:05:13 +01:00
Vistaar Juneja
8f11177818 add types and DB layer 2023-08-22 14:05:13 +01:00
Abhinav Singh
1c1ae3c06a Merge branch 'abhinav/CODE-716' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#322) 2023-08-21 23:06:06 +00:00
Vistaar Juneja
d5f121eff7 address comments 2023-08-17 12:15:46 +01:00
Vistaar Juneja
1f06534259 address comments 2023-08-17 12:15:45 +01:00
Vistaar Juneja
13ae2a0361 fix lint/format 2023-08-17 12:15:45 +01:00
Vistaar Juneja
9e94009182 move executions to separate struct, update migrations 2023-08-17 12:15:09 +01:00
Vistaar Juneja
f784eedeae working executions flow 2023-08-17 12:15:09 +01:00
Vistaar Juneja
443ec9e600 use stage store and step store to fetch logs 2023-08-17 12:15:09 +01:00
Vistaar Juneja
6ae5145be4 add log data store for s3/DB 2023-08-17 12:13:25 +01:00
Abhinav Singh
b6917d9efd fix 2023-08-16 14:09:04 -07:00
Abhinav Singh
286137e64f Merge remote-tracking branch 'origin' into abhinav/CODE-716 2023-08-16 12:54:18 -07:00
Akhilesh Pandey
34e46c30c1 Merge branch 'main' into akp/CODE-617 2023-08-17 01:07:59 +05:30
Abhinav Singh
56bd32d4c6 support for whitelisting 2023-08-15 21:48:40 -07:00
Enver Bisevac
63145686f4 fix commit adn files changed counters 2023-08-14 17:17:08 +02:00
Vistaar Juneja
29c494c23f Merge branch 'ci_gitness' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#273) 2023-08-11 16:55:54 +00:00
Vistaar Juneja
430605a13e update env value 2023-08-11 17:48:07 +01:00
Hitesh Aringa
ce90c63d01 [CODE-717]: redis sentinel mode (#292) 2023-08-11 16:28:53 +00:00
Vistaar Juneja
d1d50377fc address comments 2023-08-11 11:36:39 +01:00
Akhilesh Pandey
a8f6f9528a fix: Update the code to use registerInput along with createInput for user registration and subsequent creation 2023-08-11 00:52:05 +05:30
Marko Gaćeša
4f1767d512 dedicated api to get the last commit info 2023-08-10 18:42:10 +02:00
Vistaar Juneja
2bf73fbb5c add UpdateOptLock 2023-08-09 23:56:47 +01:00
Vistaar Juneja
e24eb858d5 run make format and fix lint errors 2023-08-09 23:00:33 +01:00
Vistaar Juneja
5574fcac47 address comments 2023-08-09 22:25:13 +01:00
Vistaar Juneja
26d6651168 address comments, complete secret CRUD 2023-08-09 15:02:48 +01:00
Marko Gaćeša
b7c339c31e status checks: raw and markdown payload kinds 2023-08-09 14:42:26 +02:00
Vistaar Juneja
5a47d789a4 add secret store and encryptor/decryptor 2023-08-08 13:32:50 +01:00
Vistaar Juneja
1e7e4c98dd fix some TODOs 2023-08-08 00:25:58 +01:00
Vistaar Juneja
c8ae92150f add pipelines auth 2023-08-07 18:29:29 +01:00
Vistaar Juneja
bc921ac1a2 add execution endpoints 2023-08-07 02:19:41 +01:00
Vistaar Juneja
2c5c781a3c Add execution db interface 2023-08-06 18:13:42 +01:00
Vistaar Juneja
21d666b430 add list API 2023-08-04 16:08:12 +01:00
Vistaar Juneja
f04a695732 add copyright header to all files 2023-08-04 10:50:39 +01:00
Vistaar Juneja
8cdcecb56f add pipelines and executions handlers to gitness 2023-08-04 10:50:39 +01:00
Enver Bisevac
a85df2b43a Merge branch 'eb/code-684' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#265) 2023-08-02 12:16:01 +00:00
Enver Bisevac
7cce097b0f error handling on merge operation 2023-08-02 14:11:25 +02:00
Akhilesh Pandey
084443f81e [CODE-617]: Update variable name and merge with main 2023-08-01 18:53:01 +05:30
Akhilesh Pandey
8f2c1d93ef Merge branch 'main' into akp/CODE-617 2023-08-01 17:40:50 +05:30
Marko Gacesa
5fd846fd25 Merge branch 'mg/spaces/list-pagination' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#257) 2023-08-01 10:40:30 +00:00
Marko Gaćeša
6946df193b add pagination to the status check list API 2023-07-31 13:23:34 +02:00
Marko Gaćeša
416bd1ba36 openapi update for the sapce membership list API 2023-07-31 12:36:31 +02:00
Marko Gaćeša
f5084697b1 Minor fixes and refactoring 2023-07-28 12:57:16 +02:00
Johannes Batzill
338271fb14 feat: [CODE-674]: user's space membership; membership API pagination (#241) 2023-07-26 20:53:42 +00:00
Johannes Batzill
c8ce82d197 [Standalone] Make Token Expiration Optional & Fix CLI Register + Login (#239) 2023-07-26 01:03:03 +00:00
Johannes Batzill
45e48a2b05 [GITHA] Expose GRPC Server/Client Configurations for HA Kubernetes Deployment (#231) 2023-07-25 18:15:06 +00:00
Akhilesh Pandey
71ffa224f0 [CODE-621]: Add check to prevent last and only admin deletion (#205) 2023-07-25 04:03:43 +00:00
Marko Gaćeša
9c8e578d90 typo fixes 2023-07-24 15:10:56 +02:00
Johannes Batzill
baa4eb5ac9 feat: [CODE-626,CODE-627]: space membership API&DB (#194) 2023-07-20 21:20:56 +00:00
Akhilesh Pandey
9fb093bad3 Merge branch 'main' into akp/CODE-617 2023-07-20 16:35:43 +05:30
Akhilesh Pandey
4c92c32c0a [CODE-617]: Add env variable in Gitness to allow/disallow sign-ups 2023-07-20 16:34:07 +05:30
Johannes Batzill
478ae74e49 make grants optional for pat/sat create APIs 2023-07-18 16:45:33 -07:00
Johannes Batzill
5543fba0b4 [GIHA] Introduce githa custom githook binary (#186) 2023-07-12 15:49:06 +00:00
Hitesh Aringa
34db95b900 [CODE-454]: go profiler (#125) 2023-06-19 23:38:47 +00:00
Johannes Batzill
e1a24699c3 CODE-385: Search and Add reviewers to Database API (#126) 2023-06-15 20:26:36 +00:00
Marko Gaćeša
cdc1370564 feat: [CODE-389]: status checks API layer 2023-06-08 12:38:20 +02:00
Marko Gaćeša
d750b8a459 feat: [CODE-365]: add status check data layer 2023-05-30 19:52:20 +02:00
Abhinav Singh
a0ce4fe88e feat: [CODE-345]: rename enhancement and committer addition 2023-05-23 18:02:31 -07:00
Abhinav Singh
a6615c91a2 feat: [CODE-200]: list commits with date filter 2023-05-17 15:22:59 -07:00
Enver Bisevac
d865f08eb0 Merge branch 'eb/code-174-fix' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#69) 2023-05-12 17:12:03 +00:00
Enver Bisevac
3889cb891f use enum from types 2023-05-12 19:01:29 +02:00
Enver Bisevac
4c4035d1e3 Merge branch 'eb/code-174' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#63) 2023-05-12 15:57:52 +00:00
Enver Bisevac
74c3c856a8 squash merge option added 2023-05-12 14:33:02 +02:00
Abhinav Singh
7dcccc323e Merge branch 'abhinav/CODE-260' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#58) 2023-05-10 21:06:57 +00:00
Abhinav Singh
24fab5b3bf should have old path new path param to determine if we moved or got moved. 2023-05-09 13:29:56 -07:00
Marko Gaćeša
8c329715dc submit review API requires commit SHA 2023-05-09 13:54:48 +02:00
Abhinav Singh
59a7cdf8a8 feat: [CODE-260]: commit api should have path filter 2023-05-08 22:54:00 -07:00
Marko Gaćeša
59b7cf5e69 comment status API 2023-05-08 16:03:23 +02:00
Marko Gaćeša
de0ab2bc75 return old/new-line-new values used to create cc 2023-05-04 11:08:24 +02:00
Marko Gaćeša
96942f13b6 fix line numbers for code comments 2023-04-28 13:55:58 +02:00
Marko Gaćeša
be3b68e577 make merge base SHA not nullable 2023-04-27 13:12:54 +02: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
Marko Gaćeša
c7c36e49e1 Add git blame API (#346) 2023-03-09 12:55:23 +01:00
Johannes Batzill
b44948bd97 [MISC] Expose Content Encoding as Enum across APIs (#359) 2023-02-27 18:50:52 -08:00
Johannes Batzill
9d894c79cc [MERGE] Enhance PR Merge (Check) Fields. (#342) 2023-02-14 20:18:10 -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
9bec905a65 [MISC] Always create system service principal (#309) 2023-02-03 19:18:29 -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
Marko Gaćeša
9dfad8b5e1 Added column comment_count to the PR entity (#280) 2023-02-02 11:31:22 +01:00
Johannes Batzill
83c24913d3 [Webhook] Add pullreq_created and pullreq_reopened webhook triggers (#283) 2023-02-01 13:52:36 -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
Marko Gaćeša
ce322ec596 Writing pull req activities in controllers (#263) 2023-01-31 12:34:18 +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
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
fe3d6d5990 Added num_merged_pulls (#240) 2023-01-25 11:21:19 +01:00
Johannes Batzill
085e63422b [MISC] Explicitly type PullReqActivity.Payload (#233) 2023-01-20 12:29:13 -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
Marko Gaćeša
ec4003e331 Handling branch events for PRs (#221) 2023-01-18 13:26:20 +01: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
Marko Gaćeša
6705c7234d feat: [SCM-60]: return number of duplicate PR, unique partial index for PR branch uniqueness (#214) 2023-01-17 11:42:33 +01:00
Marko Gaćeša
4881eb3863 allow empty value in enum sanitize if default is defined (#209) 2023-01-13 19:03:25 +01:00
Marko Gaćeša
ce55d3349c added merge commit sha fields to PR (#205) 2023-01-13 14:49:24 +01:00
Marko Gaćeša
bacda596fa Added Correct method for enum types (#194) 2023-01-13 13:59:53 +01:00
Johannes Batzill
eabdf2ab86 [MISC] Show merged after PR got merged (#201) 2023-01-13 00:35:41 -08:00
Johannes Batzill
65c59d0b5b [MISC] Fix review bugs, regenerate swagger from latest service, fix webhook.has_secret in swagger (#198)
This change contains the following changes:
- allow submitting reviews without comment for approve
- fix openapi for /reviews api and fix UI calls for submitting reviews
- fix recently broken openapi for webhook (it removed has_secret field as part of openapi refactor)
- fix fatal submit review bug (we passed repo.UID not repo.GitUID to gitrpc - not sure how that ever worked?)
- add missing merge pr activity to list of all pr activity enum values
- return all PR states by default
- show Open PRs by default (instead of all) and fix state filtering query
- regenerate code services based on latest swagger
- fix UI code to work with regenerated code service
2023-01-12 22:39:38 -08:00
Marko Gaćeša
8909037ec7 enum types should have Enum() method (#192) 2023-01-12 17:13:03 +01:00
Johannes Batzill
155563615b [MISC] Minor Cleanup in types + enum Package (#186) 2023-01-11 23:16:07 -08:00
Johannes Batzill
5b55f48772 [Tags] Adding EVENT and WEBHOOK Support For Tags (#185)
Adding tagcreated, tagupdated, and tagdeleted events.
Adding tag_created, tag_updated, and tag_deleted webhooks
2023-01-11 20:56:00 -08:00
Johannes Batzill
a74d779dc4 [Webhook] Add display_name/description/latest_execution_result to webhook (#180)
This PR adds the following fields to webhooks:
- 'DisplayName' - the display name of the webhook for easier recognition in UI (no uniqueness guarantees)
- 'Description' - an (optional) description of the webhook
 - 'LatestExecutionResult' - contains the result of the latest execution of the webhook
2023-01-11 17:11:10 -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
a426cdd69b [GIT] Add Support for Other Git Clients (#171) 2023-01-10 14:35:09 -08:00
Marko Gaćeša
afd86bacb0 Hide PR internal fields (#169) 2023-01-10 18:22:20 +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
1a84e19ce4 [MISC] Add internal API URL to url.Provider (#168) 2023-01-06 14:17:41 -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
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
Marko Gaćeša
98ac3d130d techdebt: [SCM-43]: Using opt lock to generate PR number (#151) 2023-01-04 12:24:17 +01: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
1337f729e7 [Webhook] Add Swagger (#145)
This change adds webhook APIs to swagger and regenerates the web service clients based on the latest swagger.
2022-12-28 14:42:13 -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
f14731455d Add parent_id column to the pullreq_activities DB table (#143) 2022-12-28 18:51:34 +01: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
Marko Gaćeša
8f5e579001 rename DB table pullreq to pullreqs; added version (#130) 2022-12-22 20:21:15 +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
Marko Gaćeša
6bde210adf added branch params to PR list API (#119) 2022-12-09 15:45:02 +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
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
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
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
Johannes Batzill
8fe80ab811 Remove Identifier from UI - Replace with original Name (#59)
* remove identifier from UI and replace it with original 'Name'
* extend uid to length 100
* allow repo name of length 1
2022-11-07 14:37:50 -08: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
fb0e93394d [feat] pull/push over https - done (#47)
* pull/push impl done

* Basic auth for harness
2022-11-01 19:02:29 +01:00
Johannes Batzill
2d4db78991 Add Tag Listing API (#49)
This change is adding the List Tags API. To do so, a few changes were necessary:
- Refactor List Branches on giteaAdapter / repo_service
- Expose WalkReferences via giteaAdapter
2022-10-28 13:10:26 -07:00
Johannes Batzill
2d897c4486 [MAINT] Add PAT CLI command and update readme (#45)
Add PAT CLI command and update readme
2022-10-24 22:50:33 -07:00
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
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
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
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
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
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
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
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
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
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
3b6f6b8916 Add proper scoping to authorization code 2022-09-05 22:17:16 -07:00
Johannes Batzill
ff806fb492 block 'api' as root space name, minor improvements 2022-09-05 18:45:16 -07:00
Johannes Batzill
d7f0ae4b2c Add base structure for rest api, git api, web api. Add base authn and authz, as well as spaces and repository apis 2022-09-05 13:47:00 -07:00
Johannes Batzill
32e6c4929f Add authn, authz, spaces, guard, terminated FQNs 2022-09-05 13:47:00 -07:00
Johannes Batzill
4cd1ecebf1 Remove unnecessary types 2022-09-05 13:47:00 -07:00
Johannes Batzill
4aa8819765 Rename project to 'gitness' 2022-08-29 10:12:07 -07:00
Johannes Batzill
813d343f6a Rename module to github.com/harness/scm. Fix web/dist.go 2022-08-18 15:15:50 -07:00
Tan Nhu
5891818ce1 Initial commit 2022-08-09 12:37:37 -07:00