Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
cc60ff4
feat: CRUD users, organizations and repositories
leapalazzolo Mar 6, 2024
c2752fb
feat: update CI
leapalazzolo Mar 6, 2024
b4fd83f
feat: use Basic auth in create/delete endpoints
leapalazzolo Mar 7, 2024
5f3353b
feat: add issue endpoints (WIP)
leapalazzolo Mar 8, 2024
29b397c
feat: decouple db init and db conn. Improve db scheme
leapalazzolo Apr 13, 2024
9a922a6
feat: add migrations, add query params and db join/where
leapalazzolo Apr 14, 2024
ff7d3dd
feat: add some custom query args in get users
leapalazzolo Apr 14, 2024
0f72983
feat: improve pagination and sort
leapalazzolo Apr 15, 2024
ca6aee6
feat: improve sort and error handling
leapalazzolo Apr 16, 2024
42953ac
feat: add new endpoints
leapalazzolo Apr 20, 2024
26fc5f0
feat: improve tests and minor fixes
leapalazzolo Apr 22, 2024
7b250e5
Merge pull request #3 from kudos-ink/feat/add-issue
leapalazzolo Apr 22, 2024
3ccd5e3
feat: add endpoints and tess
leapalazzolo Apr 28, 2024
a02bef2
feat: test CI
leapalazzolo Apr 28, 2024
7b9bcdb
fix: test CI
leapalazzolo Apr 28, 2024
3809300
fix: test CI name
leapalazzolo Apr 28, 2024
b170004
fix: test CI name
leapalazzolo Apr 28, 2024
5b3560b
fix: deploy
leapalazzolo Apr 28, 2024
34b3254
fix: deploy
leapalazzolo Apr 28, 2024
516173e
Merge pull request #4 from kudos-ink/feat/organization-endpoints
leapalazzolo Apr 28, 2024
1dccb79
fix: CI
leapalazzolo Apr 28, 2024
9ec00fc
Merge pull request #5 from kudos-ink/fix/CI
leapalazzolo Apr 28, 2024
26191b7
fix: env var
leapalazzolo Apr 28, 2024
a3d3e46
Merge pull request #6 from kudos-ink/chore/env-fixes
leapalazzolo Apr 28, 2024
b69aa6f
chore: wake up cron
leapalazzolo Apr 29, 2024
7b2ba0d
Merge pull request #7 from kudos-ink/chore/wake-up-cron
leapalazzolo Apr 29, 2024
c100204
refactor: diesel pool and query builder
ipapandinas May 2, 2024
c7f20da
refactor: reorg and projects endpoint
ipapandinas May 4, 2024
66cac3a
chore: add repository table
leapalazzolo May 5, 2024
def324e
refactor: repository
leapalazzolo May 5, 2024
64ca9ec
refactor: users
leapalazzolo May 5, 2024
bdea265
Merge pull request #8 from kudos-ink/diesel
leapalazzolo May 6, 2024
ef8e235
feat/issues
leapalazzolo May 12, 2024
351c491
Revert "feat/issues"
leapalazzolo May 12, 2024
501a526
Revert "Revert "feat/issues""
leapalazzolo May 12, 2024
588eb40
chore: comment issues
leapalazzolo May 12, 2024
c749b24
fix: issues and error handler
leapalazzolo May 18, 2024
e6698db
fix: ci and lint
leapalazzolo May 18, 2024
0506831
fix: stage ci
leapalazzolo May 18, 2024
8e6bdee
chore(deps): bump mio from 0.8.9 to 0.8.11
dependabot[bot] May 18, 2024
0def61e
chore(deps): bump h2 from 0.3.22 to 0.3.26
dependabot[bot] May 18, 2024
377f68c
fix: test command
leapalazzolo May 18, 2024
92108d3
Merge pull request #9 from kudos-ink/dependabot/cargo/mio-0.8.11
leapalazzolo May 18, 2024
f960078
Merge branch 'main' into dependabot/cargo/h2-0.3.26
leapalazzolo May 18, 2024
defc510
fix: test
leapalazzolo May 18, 2024
08f676b
Merge branch 'main' of github.com:kudos-ink/issues-api
leapalazzolo May 18, 2024
bcb9273
Merge branch 'main' into dependabot/cargo/h2-0.3.26
leapalazzolo May 18, 2024
8bbba17
Merge pull request #10 from kudos-ink/dependabot/cargo/h2-0.3.26
leapalazzolo May 18, 2024
5547f79
feat: integration tests enabler
leapalazzolo May 19, 2024
55f5ec9
fix: commands
leapalazzolo May 19, 2024
c8347ea
chore: remove command
leapalazzolo May 19, 2024
c6016b5
fix: dockerfile
leapalazzolo May 19, 2024
674a2d8
chore: improve stage CI
leapalazzolo May 19, 2024
5f1aa24
fix: improve db helper
leapalazzolo May 19, 2024
8d71cf2
fix: test
leapalazzolo May 19, 2024
4f3bb8c
Merge pull request #11 from kudos-ink/feat/integration-tests
leapalazzolo May 19, 2024
b404128
feat: languages endpoint created
ipapandinas Jul 8, 2024
595a76a
feat: repositories endpoint adjusted
ipapandinas Jul 8, 2024
e3c8585
chore: push image to private ECR
Aug 8, 2024
612960d
chore: change tag
leapalazzolo Aug 8, 2024
3bb5777
chore: fix name
leapalazzolo Aug 8, 2024
e299873
chore: fix dockerfile
leapalazzolo Aug 8, 2024
e90ada2
chore: automate deployment
leapalazzolo Aug 8, 2024
0f7d5ad
chore: fix var
leapalazzolo Aug 9, 2024
5a296a1
chore: retry
leapalazzolo Aug 9, 2024
59b1a7e
chore: retry
leapalazzolo Aug 9, 2024
9d5d5b3
chore: use vars
leapalazzolo Aug 10, 2024
4081ca6
chore: remove param
leapalazzolo Aug 10, 2024
d11fdd9
issues - still WIP
ipapandinas Aug 10, 2024
db4c1f4
chore: update task name
leapalazzolo Aug 10, 2024
2124113
chore: test
leapalazzolo Aug 10, 2024
db9c305
chore: add curl
leapalazzolo Aug 10, 2024
ce32f74
chore: wait new deployment
leapalazzolo Aug 11, 2024
41329f8
chore: add dockerhub
leapalazzolo Aug 11, 2024
b7fd8c9
chore: add dockerhub
leapalazzolo Aug 11, 2024
f91e8a0
chore: fix push dockerhub
leapalazzolo Aug 11, 2024
e57a6d3
chore: fix push dockerhub
leapalazzolo Aug 11, 2024
559fe46
fix: dockerhub
leapalazzolo Aug 11, 2024
28c8bf2
fix: dockerhub
leapalazzolo Aug 11, 2024
1037023
chore: deplyo to stage
leapalazzolo Aug 11, 2024
3b260cf
chore: deplyo to stage
leapalazzolo Aug 11, 2024
172222b
chore: deploy to stage
leapalazzolo Aug 11, 2024
e4fc6f2
chore: deploy to stage
leapalazzolo Aug 11, 2024
3eafbb6
chore: deploy to stage
leapalazzolo Aug 11, 2024
c471beb
chore: fix new line
leapalazzolo Aug 11, 2024
751fdf4
chore: improve workflows
leapalazzolo Aug 11, 2024
73bfafa
Merge pull request #12 from kudos-ink/chore/ecs
leapalazzolo Aug 11, 2024
8ffe95f
chore: remove integration tests
leapalazzolo Aug 11, 2024
59abdb0
feat: add users endpoints
leapalazzolo Aug 25, 2024
8d7e775
fix: minor fixes
leapalazzolo Aug 25, 2024
247af5a
feat: improve issue creation
leapalazzolo Aug 29, 2024
388f49a
feat: improve projects
leapalazzolo Aug 29, 2024
a82618d
feat: merge
leapalazzolo Aug 29, 2024
45b8a4b
chore: use newer rust image
leapalazzolo Aug 29, 2024
15ff57f
Merge pull request #14 from kudos-ink/igor/project-page
leapalazzolo Aug 29, 2024
4f8afaa
chore: migrate schema
leapalazzolo Sep 5, 2024
92e54bb
fix: models
leapalazzolo Sep 5, 2024
0d5321f
fix: issue handler
leapalazzolo Sep 5, 2024
dd5fda3
chore: add script to generate test data
leapalazzolo Sep 5, 2024
2f70bb7
Merge pull request #15 from kudos-ink/feat/db-updates
leapalazzolo Sep 5, 2024
1a618f8
chore: fix ids and endpoint in mock data script
leapalazzolo Sep 5, 2024
fc8e4ef
Merge pull request #16 from kudos-ink/chore/fix-mock-data-script
leapalazzolo Sep 5, 2024
ed41917
chore: add delete on cascade
leapalazzolo Sep 8, 2024
907d7d4
Merge pull request #17 from kudos-ink/chore/delete-repo-issues
leapalazzolo Sep 8, 2024
5352ae6
feat: improve users endpoints
leapalazzolo Sep 8, 2024
79de15a
feat: add new endpoints to patch/delete issues assignees
leapalazzolo Sep 8, 2024
1c2b256
feat: add users in mock data script
leapalazzolo Sep 8, 2024
042d4bd
chore: format code
leapalazzolo Sep 8, 2024
1607102
Merge pull request #18 from kudos-ink/feat/issues-assignees
leapalazzolo Sep 8, 2024
7d56b0a
refactor: use text cols + add types/remove categories
CJ13th Sep 12, 2024
32111f8
refactor: add types instead of categories
CJ13th Sep 12, 2024
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
7 changes: 4 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DATABASE_URL=postgres://postgres:password@localhost:5432/database
DATABASE_INIT_FILE=db.sql
HTTP_SERVER_HOST=0.0.0.0
HTTP_SERVER_PORT=8000
HOST=0.0.0.0
PORT=8000
USERNAME=test
PASSWORD=test
125 changes: 84 additions & 41 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,90 @@
name: Build, Test Prod
name: Production

on:
push:
branches:
- main
on:
release:
types: [created]

env:
AWS_REGION: us-east-1
ECR_REPOSITORY: issues-api
ECS_CLUSTER: production
ECS_SERVICE: issues-api
ECS_CONTAINER: issues-api
TASK_FILE: task.json
DOCKERHUB_REGISTRY: kudosportal/issues

permissions:
id-token: write
contents: read

jobs:
build:
production-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Build and test code
run: |
cargo build --verbose
cargo test --verbose

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
run: |
docker build -t dontelmo/kudos_api:${{ github.sha }} -f Dockerfile .
docker push dontelmo/kudos_api:${{ github.sha }}
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.ECR_ROLE }}
aws-region: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR Private
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Build, tag, and push docker image to Amazon ECR
id: build-image
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: issues-api
run: |
image=$REGISTRY/${{ env.ECR_REPOSITORY }}:${{ github.event.release.tag_name }}
docker build -t $image .
docker push $image
echo "image=$image" >> $GITHUB_OUTPUT

- name: Download task definition
run: |
aws ecs describe-task-definition --task-definition issues-api --query taskDefinition > ${{ env.TASK_FILE }}

- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.TASK_FILE }}
container-name: ${{ env.ECS_CONTAINER }}
image: ${{ steps.build-image.outputs.image }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build, tag and push docker image to Docker Hub
id: build-dockerhub-image
run: |
image=${{ env.DOCKERHUB_REGISTRY }}:${{ github.event.release.tag_name }}
docker build -t $image .
docker push $image
echo "image=$image" >> $GITHUB_OUTPUT

- name: Deploy staging
run: |
image=docker.io/${{ steps.build-dockerhub-image.outputs.image }}
encoded_image=$(echo -n $image | jq -sRr @uri)
curl -f "${{ secrets.STAGE_DEPLOY_HOOK }}&imgURL=$encoded_image"
68 changes: 68 additions & 0 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Stage

on:
push:
branches:
- main

env:
DOCKERHUB_REGISTRY: kudosportal/issues

jobs:
stage-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Run Clippy
run: |
cargo clippy --all-targets --all-features

- name: Build code
run: |
cargo build --verbose

- name: Test code
run: |
make test

# - name: Integration tests
# run: |
# make test-db
# env:
# DATABASE_URL: ${{ secrets.TESTS_DATABASE_URL }}

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build, tag and push docker image to Docker Hub
id: build-dockerhub-image
run: |
image=${{ env.DOCKERHUB_REGISTRY }}:${{ github.sha }}
docker build -t $image .
docker push $image
echo "image=$image" >> $GITHUB_OUTPUT

- name: Deploy staging
run: |
image=docker.io/${{ steps.build-dockerhub-image.outputs.image }}
encoded_image=$(echo -n $image | jq -sRr @uri)
curl -f "${{ secrets.STAGE_DEPLOY_HOOK }}&imgURL=$encoded_image"
12 changes: 12 additions & 0 deletions .github/workflows/stage_cron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Stage cron
on:
schedule:
- cron: "*/15 * * * *"

jobs:
stage:
runs-on: ubuntu-latest
steps:
- name: Wake up service
run: |
curl --fail ${{ vars.ISSUES_API_STAGE_URL }}/health
50 changes: 50 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Lint and test

on:
pull_request:
branches:
- main
types: [opened, synchronize]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Run Clippy
run: |
cargo clippy --all-targets --all-features

- name: Build code
run: |
cargo build --verbose

- name: Test code
run: |
make test

# - name: Integration tests
# run: |
# make test-db
# env:
# DATABASE_URL: ${{ secrets.TESTS_DATABASE_URL }}

- name: Build docker image
run: |
docker build -t ${{ vars.DOCKER_REGISTRY }}:${{ github.sha }} -f Dockerfile .
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/target
/target
.vscode
.env
.test.env
Loading