Skip to content
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

Release 3 #10

Merged
merged 27 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
30b30d4
[fix:20] -Criação do banco de dados com POST, GET e DELETE by id
MilenaFRocha Jul 24, 2024
ba77d20
[feat:20] - EndPoint de Post feito
MilenaFRocha Jul 26, 2024
ca8b51b
[feat:20] - Ajuste para método de GET
MilenaFRocha Jul 27, 2024
598f716
[feat:20] - Ajuste para método de GET
MilenaFRocha Jul 28, 2024
bef13b1
[feat:20] - Update de dados
MilenaFRocha Jul 28, 2024
2fe76cb
[feat:20] - Update de dados corretos
MilenaFRocha Jul 29, 2024
428f16a
[feat:20] - Verifica nome repetido
MilenaFRocha Jul 29, 2024
81d3c58
[fix:18] - Arrumando o campo obrigatório
davimesquit Aug 2, 2024
8d121e0
Resolução de conflito simples
AlGouvea Aug 6, 2024
3501abd
[fix:3] - update sonar exclusions
saracampss Aug 14, 2024
9f23999
[fix:3] - update release workflow
saracampss Aug 14, 2024
7cc833d
[fix:18] lint and format validation
Diogo-Barboza Aug 17, 2024
901e40c
[tests:18] Adicionando testes de supplier-form
AlGouvea Aug 19, 2024
29b4528
Merge pull request #7 from fga-eps-mds/fixing-18-supplier
AlGouvea Aug 19, 2024
1a331d9
Merge pull request #3 from fga-eps-mds/20-bank-account-registration
ingridSCarvalho Aug 20, 2024
66b7607
[deploy] Configurando variavel de ambiente
AlGouvea Aug 20, 2024
2d47e8e
[deploy] Configurando variavel de ambiente
AlGouvea Aug 20, 2024
c5bd8ee
[deploy] Configurando variavel de ambiente
AlGouvea Aug 20, 2024
7326aa6
[fix:deploy] Importando variavel
AlGouvea Aug 20, 2024
0bf2e95
[test-20] - teste da bankAccountController
MilenaFRocha Aug 23, 2024
09496f9
[test-20] - teste da bankAccountController
MilenaFRocha Aug 23, 2024
41055bd
[fix] - format
ingridSCarvalho Aug 25, 2024
b80190a
[fix] - update package.json
ingridSCarvalho Aug 25, 2024
e526785
[devops:3] - add step to check if branch or tag on sonar metrics
saracampss Aug 26, 2024
9685fe4
Merge pull request #9 from fga-eps-mds/20-bank-account-registration
ingridSCarvalho Aug 26, 2024
a4288e3
[fix - Resolve conflicts]
ingridSCarvalho Aug 25, 2024
295e6f7
[hotfix] Corrigindo testes e schema
AlGouvea Aug 26, 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
140 changes: 140 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: backend-financeiro-ci

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

jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: 📬 Caching
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/dist
key: ${{ runner.os }}-node-${{ hashFiles('*/package-lock.json') }}-${{ hashFiles('/.{js,jsx,ts,tsx}') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-
- name: 🧰 Instala bibliotecas e dependências
run: npm i

- name: 🔍 Verifica estilização do código
run: npm run check-format

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: 📬 Caching
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/dist
key: ${{ runner.os }}-node-${{ hashFiles('*/package-lock.json') }}-${{ hashFiles('/.{js,jsx,ts,tsx}') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-
- name: 🧰 Instala bibliotecas e dependências
run: npm i

- name: 🧹 Verifica eslint
run: npm run lint

test:
runs-on: ubuntu-latest
env:
MONGO_URI: ${{ secrets.MONGO_URI }}
MONGO_INITDB_ROOT_USERNAME: ${{ secrets.MONGO_INITDB_ROOT_USERNAME }}
MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.MONGO_INITDB_ROOT_PASSWORD }}
DB_HOST: ${{ secrets.DB_HOST }}
PORT: ${{ secrets.PORT }}
EMAIL: ${{ secrets.EMAIL }}
SECRET: ${{ secrets.SECRET }}
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: 📬 Caching
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/dist
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('/.{js,jsx,ts,tsx}') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-
- name: 🧰 Instala bibliotecas e dependências
run: npm i

- name: 🧪 Roda suíte de testes
run: npm test -- --passWithNoTests

sonarcloud:
name: sonarcloud
needs: [test]
runs-on: ubuntu-latest
env:
MONGO_URI: ${{ secrets.MONGO_URI }}
MONGO_INITDB_ROOT_USERNAME: ${{ secrets.MONGO_INITDB_ROOT_USERNAME }}
MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.MONGO_INITDB_ROOT_PASSWORD }}
DB_HOST: ${{ secrets.DB_HOST }}
PORT: ${{ secrets.PORT }}
EMAIL: ${{ secrets.EMAIL }}
SECRET: ${{ secrets.SECRET }}
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: 📬 Caching
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/dist
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.{js,jsx,ts,tsx}') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-
- name: 🧰 Instala bibliotecas e dependências
run: npm i

- name: 📜 Relatório do eslint
run: npx eslint -f json -o reports/eslint-report.json src || true

- name: 🧪 Testes e cobertura
run: JEST_SONAR=jest-sonar CI=true npm test -- --coverage --passWithNoTests

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: backend-financeiro-release

on:
push:
branches: [main]
tags:
- "v*"
pull_request:
branches:
- main
- devel
types: [closed]

jobs:
generate-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: "Get Previous tag"
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 1.0.0

- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Cria métricas do SonarCloud
run: python metrics/sonar-metrics.py ${{ github.event.repository.name }} ${{ github.ref_name }}

- name: Commita arquivos de métricas do SonarCloud
run: |
git config --global user.email "${{ secrets.GIT_EMAIL }}"
git config --global user.name "${{ secrets.GIT_USER }}"
git clone --single-branch --branch main "https://x-access-token:${{ secrets.PERSONAL_TOKEN }}@github.com/fga-eps-mds/2024.1-SENTINELA-DOC" doc
mkdir -p doc/analytics-raw-data
cp -R fga-eps-mds*.json doc/analytics-raw-data
cd doc
git add .
git commit -m "Métricas SonarCloud - ${{ github.event.repository.name }} ${{ github.ref_name }}"
git push
echo "Arquivos de métricas gerado com sucesso."
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ yarn-error.log
# Arquivos de configuração de IDEs
.idea
.vscode
.env
.env
package-lock.json

/coverage
20 changes: 20 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
echo '🏗️👷 Estilizando e verificando os padrões do seu código antes de commitar . . .\n'

# Check Prettier standards
npm run check-format ||
(
echo '\n🤢🤮 Parece haver um problema de estilo 🤢🤮
Checagem do Prettier falhou... Rode um npm run format, adicione as alterações e tente novamente.\n';
false;
)

# Check ESLint Standards
npm run lint ||
(
echo '\n😤🏀👋😤 Daqui não passa! 😤🏀👋😤
Checagem do ESLint falhou... Faça as alterações listadas acima e tente novamente.\n'
false;
)

# If everything passes... Now we can commit
echo '\n\n✅✅✅✅ Você ganhou dessa vez, commitando agora. ✅✅✅✅\n'
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.github
*.md
coverage
dist
*.json
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": false
}
64 changes: 32 additions & 32 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
version: '3.8'
version: "3.8"
services:
mongodb:
image: mongo:7.0
container_name: financedb
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
ports:
- "27018:27017"
env_file: .env
volumes:
- mongo-data:/data/db
networks:
- backend_network
command: ["mongod", "--quiet", "--logpath", "/dev/null"]
mongodb:
image: mongo:7.0
container_name: financedb
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
ports:
- "27018:27017"
env_file: .env
volumes:
- mongo-data:/data/db
networks:
- backend_network
command: ["mongod", "--quiet", "--logpath", "/dev/null"]

express_backend:
build: .
container_name: express_backend_finances
ports:
- "3002:3002"
env_file: .env
environment:
MONGO_URI: ${MONGO_URI}
depends_on:
- mongodb
networks:
- backend_network
volumes:
- ./:/app
express_backend:
build: .
container_name: express_backend_finances
ports:
- "3002:3002"
env_file: .env
environment:
MONGO_URI: ${MONGO_URI}
depends_on:
- mongodb
networks:
- backend_network
volumes:
- ./:/app

volumes:
mongo-data:
mongo-data:

networks:
backend_network:
backend_network:
11 changes: 11 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const pluginPrettier = require("eslint-plugin-prettier/recommended");

module.exports = [
pluginPrettier,
{
rules: {
"no-console": "warn",
"no-unused-vars": "error",
},
},
];
Loading
Loading