-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: added git submodule for gateway proto
- Loading branch information
Showing
14 changed files
with
159 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version = 1 | ||
|
||
exclude_patterns = ["package/**", "example-app/**"] | ||
|
||
test_patterns = ["**/Tests/**"] | ||
|
||
[[analyzers]] | ||
name = "test-coverage" | ||
enabled = true | ||
|
||
[[analyzers]] | ||
name = "swift" | ||
|
||
[analyzers.meta] | ||
swift_version = "5.9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
interval: 'daily' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: CodiumAI PR Agent | ||
on: | ||
pull_request: | ||
issue_comment: | ||
jobs: | ||
pr_agent: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
contents: write | ||
steps: | ||
- name: Exec PR Agent | ||
id: pragent | ||
uses: Codium-ai/pr-agent@main | ||
env: | ||
OPENAI_KEY: ${{ secrets.OPENAI_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: 'Lint PR Title' | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
permissions: | ||
pull-requests: read | ||
|
||
jobs: | ||
main: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: 'Validate' | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Swift | ||
uses: swift-actions/setup-swift@v1 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 21 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Install Task | ||
uses: arduino/setup-task@v1 | ||
- name: Install Pre-Commit | ||
run: python -m pip install pre-commit && pre-commit install | ||
- name: Load Cached Pre-Commit Dependencies | ||
id: cached-pre-commit-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pre-commit/ | ||
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Lint | ||
run: task lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "proto/gateway"] | ||
path = proto/gateway | ||
url = https://github.com/basemind-ai/gateway-proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
default_stages: [commit] | ||
repos: | ||
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook | ||
rev: "v9.10.0" | ||
hooks: | ||
- id: commitlint | ||
stages: [commit-msg] | ||
additional_dependencies: | ||
- "@commitlint/cli" | ||
- "@commitlint/config-conventional" | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: "v4.5.0" | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
exclude: "package" | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: "v3.1.0" | ||
hooks: | ||
- id: prettier | ||
exclude: "package" | ||
- repo: github.com/nicklockwood/SwiftFormat | ||
rev: "" | ||
hooks: | ||
- id: swiftformat | ||
- repo: github.com/realm/SwiftLint | ||
rev: "" | ||
hooks: | ||
- id: swiftlint | ||
entry: swiftlint --fix --strict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"quoteProps": "consistent", | ||
"semi": true, | ||
"singleQuote": true, | ||
"tabWidth": 4, | ||
"trailingComma": "all", | ||
"useTabs": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Security Policy | ||
|
||
## Reporting a Vulnerability | ||
|
||
Please open an issue on GitHub. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,196 +1,17 @@ | ||
version: '3' | ||
version: "3" | ||
|
||
tasks: | ||
# project dependencies | ||
install-pnpm: | ||
cmds: | ||
- | | ||
if command -v brew &> /dev/null; then | ||
brew install pnpm | ||
else | ||
npm install -g pnpm | ||
fi | ||
status: | ||
- command -v pnpm &> /dev/null || exit 1 | ||
install-pre-commit: | ||
cmds: | ||
- | | ||
if command -v brew &> /dev/null; then | ||
brew install pre-commit | ||
else | ||
pip install pre-commit | ||
fi | ||
status: | ||
- command -v pre-commit &> /dev/null || exit 1 | ||
install-sqlc: | ||
cmds: | ||
- | | ||
if command -v brew &> /dev/null; then | ||
brew install sqlc | ||
else | ||
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest | ||
fi | ||
status: | ||
- command -v sqlc &> /dev/null || exit 1 | ||
install-atlas: | ||
cmds: | ||
- | | ||
if command -v brew &> /dev/null; then | ||
brew install ariga/tap/atlas | ||
else | ||
curl -sSf https://atlasgo.sh | sh | ||
fi | ||
status: | ||
- command -v atlas &> /dev/null || exit 1 | ||
install-buf: | ||
cmds: | ||
- | | ||
if command -v brew &> /dev/null; then | ||
brew install bufbuild/buf/buf | ||
else | ||
npm install -g @bufbuild/buf | ||
fi | ||
status: | ||
- command -v buf &> /dev/null || exit 1 | ||
install-terraform: | ||
cmds: | ||
- | | ||
if command -v brew &> /dev/null; then | ||
brew tap hashicorp/tap | ||
brew install hashicorp/tap/terraform | ||
brew install tflint | ||
else | ||
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - | ||
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | ||
sudo apt-get update && sudo apt-get install terraform | ||
curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash | ||
fi | ||
status: | ||
- command -v terraform &> /dev/null || exit 1 | ||
update-brew: | ||
cmds: | ||
- | | ||
if command -v brew &> /dev/null; then | ||
brew update; | ||
brew upgrade; | ||
brew cleanup || true; | ||
fi | ||
setup: | ||
desc: Setup the project dependencies | ||
cmds: | ||
- task: update-brew | ||
- task: install-pnpm | ||
- task: install-pre-commit | ||
- task: install-sqlc | ||
- task: install-atlas | ||
- task: install-buf | ||
- task: install-terraform | ||
- pre-commit install && pre-commit install --hook-type commit-msg | ||
- pnpm install -r | ||
- go mod download | ||
# repository management | ||
update:android: | ||
cmds: | ||
- ./gradlew wrapper --gradle-version latest | ||
- ./gradlew androidDependencies | ||
- ./gradlew versionCatalogUpdate | ||
lint:android: | ||
desc: Lint the android codebase with in-built lint checks | ||
cmds: | ||
- ./gradlew :sdks:android:sdk:lint | ||
- ./gradlew :sdks:android:test-app:lint | ||
- ./gradlew spotlessApply | ||
- command -v pre-commit &> /dev/null || brew install pre-commit | ||
- pre-commit install && pre-commit install --hook-type commit-msg && pre-commit install-hooks | ||
update: | ||
desc: Update the project dependencies | ||
cmds: | ||
- task: update-brew | ||
- task: update:android | ||
- pnpm add -g pnpm && pnpm update -r --latest | ||
- go mod tidy && go get -u ./... &> /dev/null | ||
- pre-commit autoupdate | ||
- swift package update | ||
- swift outdated | ||
lint: | ||
desc: Lint the project | ||
cmds: | ||
- pre-commit run --show-diff-on-failure --color=always --all-files | ||
- task: lint:android | ||
# database | ||
db:up: | ||
desc: Bring up the local database | ||
cmds: | ||
- docker compose stop && docker compose up db --detach | ||
db:down: | ||
desc: Tear down the local database | ||
cmds: | ||
- docker compose down db | ||
migrations:apply: | ||
desc: Apply the migrations to the local database | ||
cmds: | ||
- task: db:up | ||
- sleep 2 | ||
- atlas migrate apply --dir "file://sql/migrations" --url "postgresql://basemind:basemind@localhost:5432/basemind?search_path=public&sslmode=disable" | ||
migrations:create: | ||
desc: Create a new migration | ||
cmds: | ||
- task: db:up | ||
- sleep 2 | ||
- atlas migrate diff {{.CLI_ARGS}} --dir "file://sql/migrations" --to "file://sql/schema.sql" --dev-url "postgresql://basemind:basemind@localhost:5432/basemind?search_path=public&sslmode=disable" | ||
slqc:generate: | ||
desc: Generate the database code from the sqlc.yaml file | ||
cmds: | ||
- rm -rf shared/go/db/models | ||
- sqlc generate | ||
slqc:vet: | ||
desc: Lint the database schema | ||
cmds: | ||
- task: db:up | ||
- sleep 2 | ||
- sqlc vet | ||
# protobuf | ||
buf:generate: | ||
desc: Generate gRPC types and code from proto files | ||
cmds: | ||
- rm -rf gen | ||
- npx buf generate | ||
- rm -rf gen/go/openai | ||
- rm -rf gen/go/cohere | ||
- rm -rf gen/ts/gateway | ||
- rm -rf gen/ts/ptesting | ||
- rm -rf sdks/ios/Sources/BaseMindGateway | ||
- mv gen/swift/gateway/v1 sdks/ios/Sources/BaseMindGateway | ||
- rm -rf gen/swift | ||
buf:lint: | ||
desc: Lint the protobuf files | ||
cmds: | ||
- npx buf lint | ||
buf:format: | ||
desc: Format the protobuf files | ||
cmds: | ||
- npx buf format | ||
# testing | ||
e2e:seed: | ||
desc: Seed the local database with testing data | ||
cmds: | ||
- task: db:up | ||
- go run e2e/main.go seed | ||
e2e:clean: | ||
desc: Clean the local database of all testing data | ||
cmds: | ||
- task: db:up | ||
- go run e2e/main.go clean | ||
e2e:create-jwt: | ||
desc: Create a JWT from the given applicationId arg | ||
cmds: | ||
- go run e2e/main.go create-jwt {{.CLI_ARGS}} | ||
# gcp commands | ||
gcp:deploy-emailsender: | ||
desc: Deploys the email sender cloud function to GCP | ||
dir: cloud-functions/emailsender | ||
cmds: | ||
- | | ||
gcloud functions deploy email-sender \ | ||
--gen2 \ | ||
--runtime=go121 \ | ||
--region=europe-west3 \ | ||
--source=. \ | ||
--entry-point=SendgridEmailPubSub \ | ||
--trigger-topic=send-email |