Skip to content

Gitea workflow trigger #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=${P

# Gitea Webhook Configuration
GITEA_WEBHOOK_AUTH="your_webhook_secret_here"
GITEA_TOKEN="your_gitea_token_here"
GITEA_BASE_URL="https://git.topcoder-dev.com/api/v1"
GITEA_ORG="TC-Reviews-Tests"
GITEA_REPO_DEF_BRANCH="develop"

# Kafka Configuration
KAFKA_BROKERS=localhost:9092
Expand Down
30 changes: 30 additions & 0 deletions docs/GITEA_WORKFLOW_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Gitea Workflow Setup Guide

New environment properties were added to support Gitea Workflows. These new properties are listed below:

- GITEA_TOKEN - the gitea token
- GITEA_BASE_URL - gitea base URL which will be used by generated gitea client
- GITEA_ORG - the gitea Org name
- GITEA_REPO_DEF_BRANCH - default branch name to use when creating new repositories

These new properties are added in .env.sample.

## Gitea TS Client Generation

A generated gitea typescript client is used in this app. If there are new endpoints or new changes to existing endpoints, a new gitea client can be generated by running the provided script.

The script uses "swagger-typescript-api" which should be installed in dev dependencies. Also, take note that the generated client uses Axios to handle HTTP requests. Axios is the obvious choice as this is already part of the dependencies.

To generate a new client, just run:

```bash
./generateGiteaClient.sh
```

The script uses the following information:

- URL of Swagger JSON - https://git.topcoder-dev.com/swagger.v1.json
- Output directory - ./src/shared/clients/gitea
- Filename - gitea.client.ts

Any of the information above can be modified as needed.
2 changes: 2 additions & 0 deletions generateGiteaClient.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
npx swagger-typescript-api generate -p https://git.topcoder-dev.com/swagger.v1.json -o ./src/shared/clients/gitea -n gitea.client.ts --axios
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
"cors": "^2.8.5",
"jsonwebtoken": "^9.0.2",
"jwks-rsa": "^3.2.0",
"kafkajs": "^2.2.4",
"lodash": "^4.17.21",
"multer": "^2.0.1",
"nanoid": "~5.1.2",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"tc-core-library-js": "appirio-tech/tc-core-library-js.git#v3.0.1",
"kafkajs": "^2.2.4"
"tc-core-library-js": "appirio-tech/tc-core-library-js.git#v3.0.1"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
Expand All @@ -67,6 +67,7 @@
"prisma": "^6.3.1",
"source-map-support": "^0.5.21",
"supertest": "^7.0.0",
"swagger-typescript-api": "^13.2.8",
"ts-jest": "^29.2.5",
"ts-loader": "^9.5.2",
"ts-node": "^10.9.2",
Expand Down
Loading