From fe2962205b036e905d13e24dea7fd3bcbdc63dc0 Mon Sep 17 00:00:00 2001 From: RenanRoseno Date: Thu, 4 Sep 2025 22:32:44 -0300 Subject: [PATCH 1/7] test: conflicting branches --- .github/workflows/ci.yml | 42 ++++++++++++++++++++-------------------- .gitignore | 1 + 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37b66eb..e679280 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,29 +57,29 @@ jobs: # env: # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - # Adicionar essa na de PR de DEV para PROD - # integration: - # runs-on: ubuntu-latest + Adicionar essa na de PR de DEV para PROD + integration: + runs-on: ubuntu-latest # - # steps: - # - name: πŸ“₯ Verificar branches conflitantes - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 + steps: + - name: πŸ“₯ Verificar branches conflitantes + uses: actions/checkout@v4 + with: + fetch-depth: 0 # - # - name: πŸ”‘ Configurar credenciais do Git - # run: | - # git config user.name "github-actions[bot]" - # git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - # - name: πŸ” Testar merge main <- develop - # run: | - # git fetch origin - # git checkout main - # git merge --no-commit --no-ff origin/develop || ( - # echo "❌ Conflitos detectados entre main e develop" && exit 1 - # ) - # git merge --abort || true - # echo "βœ… Nenhum conflito entre main e develop" + - name: πŸ”‘ Configurar credenciais do Git + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: πŸ” Testar merge main <- develop + run: | + git fetch origin + git checkout main + git merge --no-commit --no-ff origin/develop || ( + echo "❌ Conflitos detectados entre main e develop" && exit 1 + ) + git merge --abort || true + echo "βœ… Nenhum conflito entre main e develop" check: runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index ba9f522..30e7ae1 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,5 @@ override.tf.json .terraform.tfstate.lock.info .terraformrc terraform.rc +teste From 83a1f28063c237043a6e137a739b08c6a1e3d485 Mon Sep 17 00:00:00 2001 From: RenanRoseno Date: Thu, 4 Sep 2025 22:40:49 -0300 Subject: [PATCH 2/7] feat: add test error --- .github/workflows/ci.yml | 44 +++++++++---------- .../tests/orders-controller.test.ts | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e679280..29ce851 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,29 +57,29 @@ jobs: # env: # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - Adicionar essa na de PR de DEV para PROD - integration: - runs-on: ubuntu-latest + # Adicionar essa na de PR de DEV para PROD + # integration: + # runs-on: ubuntu-latest # - steps: - - name: πŸ“₯ Verificar branches conflitantes - uses: actions/checkout@v4 - with: - fetch-depth: 0 + # steps: + # - name: πŸ“₯ Verificar branches conflitantes + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 # - - name: πŸ”‘ Configurar credenciais do Git - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - - name: πŸ” Testar merge main <- develop - run: | - git fetch origin - git checkout main - git merge --no-commit --no-ff origin/develop || ( - echo "❌ Conflitos detectados entre main e develop" && exit 1 - ) - git merge --abort || true - echo "βœ… Nenhum conflito entre main e develop" + # - name: πŸ”‘ Configurar credenciais do Git + # run: | + # git config user.name "github-actions[bot]" + # git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + # - name: πŸ” Testar merge main <- develop + # run: | + # git fetch origin + # git checkout main + # git merge --no-commit --no-ff origin/develop || ( + # echo "❌ Conflitos detectados entre main e develop" && exit 1 + # ) + # git merge --abort || true + # echo "βœ… Nenhum conflito entre main e develop" check: runs-on: ubuntu-latest @@ -135,4 +135,4 @@ jobs: run: npm install - name: πŸš€ Build do projeto - run: npm run build + run: npm run build \ No newline at end of file diff --git a/src/controllers/tests/orders-controller.test.ts b/src/controllers/tests/orders-controller.test.ts index dfa9bcd..b82d871 100644 --- a/src/controllers/tests/orders-controller.test.ts +++ b/src/controllers/tests/orders-controller.test.ts @@ -49,7 +49,7 @@ describe('OrdersController - create', () => { expect(mockNext).toHaveBeenCalledWith(expect.any(AppError)); expect((mockNext.mock.calls[0][0] as AppError).message).toBe( - 'session table not found', + 'session table not found123', ); }); From 48322bf698171dfcb072461ffd0d6d47735863b4 Mon Sep 17 00:00:00 2001 From: RenanRoseno Date: Thu, 4 Sep 2025 22:45:11 -0300 Subject: [PATCH 3/7] feat: add lint error --- src/controllers/tests/orders-controller.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/tests/orders-controller.test.ts b/src/controllers/tests/orders-controller.test.ts index b82d871..c4d53a3 100644 --- a/src/controllers/tests/orders-controller.test.ts +++ b/src/controllers/tests/orders-controller.test.ts @@ -48,7 +48,7 @@ describe('OrdersController - create', () => { ); expect(mockNext).toHaveBeenCalledWith(expect.any(AppError)); - expect((mockNext.mock.calls[0][0] as AppError).message).toBe( + expect((mockNext.mock.calls[0][0] as AppError).message).toBe( 'session table not found123', ); }); From df7ddb261fc75aaed2e3d40810cf369318d91a74 Mon Sep 17 00:00:00 2001 From: RenanRoseno Date: Thu, 4 Sep 2025 22:46:21 -0300 Subject: [PATCH 4/7] feat: add error build --- src/controllers/products-controllers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/products-controllers.ts b/src/controllers/products-controllers.ts index 31ef9f9..d0b5b75 100644 --- a/src/controllers/products-controllers.ts +++ b/src/controllers/products-controllers.ts @@ -6,7 +6,7 @@ import { AppError } from '@/utils/AppError'; class ProductController { async index(request: Request, response: Response, next: NextFunction) { try { - const { name } = request.query; + { name } = request.query; const products = await knex('products') .select() From 28056798505f0b38396d1fd27071c5f66ef6a31e Mon Sep 17 00:00:00 2001 From: RenanRoseno Date: Thu, 4 Sep 2025 23:06:49 -0300 Subject: [PATCH 5/7] feat: add integration pipeline --- .github/workflows/ci.yml | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29ce851..20b46ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,28 +58,28 @@ jobs: # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Adicionar essa na de PR de DEV para PROD - # integration: - # runs-on: ubuntu-latest - # - # steps: - # - name: πŸ“₯ Verificar branches conflitantes - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - # - # - name: πŸ”‘ Configurar credenciais do Git - # run: | - # git config user.name "github-actions[bot]" - # git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - # - name: πŸ” Testar merge main <- develop - # run: | - # git fetch origin - # git checkout main - # git merge --no-commit --no-ff origin/develop || ( - # echo "❌ Conflitos detectados entre main e develop" && exit 1 - # ) - # git merge --abort || true - # echo "βœ… Nenhum conflito entre main e develop" + integration: + runs-on: ubuntu-latest + + steps: + - name: πŸ“₯ Verificar branches conflitantes + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: πŸ”‘ Configurar credenciais do Git + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: πŸ” Testar merge main <- develop + run: | + git fetch origin + git checkout main + git merge --no-commit --no-ff origin/develop || ( + echo "❌ Conflitos detectados entre main e develop" && exit 1 + ) + git merge --abort || true + echo "βœ… Nenhum conflito entre main e develop" check: runs-on: ubuntu-latest From 3e903b875e966452ae6108c656b59e6bc3228c88 Mon Sep 17 00:00:00 2001 From: Victor Neves <43397591+v-venes@users.noreply.github.com> Date: Sat, 6 Sep 2025 08:23:58 -0300 Subject: [PATCH 6/7] =?UTF-8?q?=E2=9C=A8=20feat:=20presentation=20endpoint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/index.ts | 2 ++ src/routes/presentation.ts | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/routes/presentation.ts diff --git a/src/routes/index.ts b/src/routes/index.ts index a48ffde..b34cec3 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -6,6 +6,7 @@ import { tablesSessionsRoutes } from './tables-sessions-routes'; import { ordersRoutes } from './orders-routes'; import { metricsRoutes } from './metrics'; import { healthRoutes } from './health'; +import { presentationRoutes } from './presentation'; const routes = Router(); routes.use('/products', productsRoutes); @@ -14,5 +15,6 @@ routes.use('/tables-sessions', tablesSessionsRoutes); routes.use('/orders', ordersRoutes); routes.use('/metrics', metricsRoutes); routes.use('/health', healthRoutes); +routes.use('/presentation', presentationRoutes); export { routes }; diff --git a/src/routes/presentation.ts b/src/routes/presentation.ts new file mode 100644 index 0000000..d117d62 --- /dev/null +++ b/src/routes/presentation.ts @@ -0,0 +1,16 @@ +import { Router, Request, Response } from 'express'; + +const presentationRoutes = Router(); + +presentationRoutes.get('/', async (_: Request, res: Response) => { + try { + res.json({ + message: '✨ Novo endpoint, olΓ‘ apresentaΓ§Γ£o!', + timeStamp: new Date().toISOString(), + }); + } catch (error) { + res.status(500).send('Error generating metrics'); + } +}); + +export { presentationRoutes }; From 1b99b582cdc74e99ff5ea70f76d64413bdf83a2e Mon Sep 17 00:00:00 2001 From: RenanRoseno Date: Sat, 6 Sep 2025 10:44:10 -0300 Subject: [PATCH 7/7] fix: npm run build --- src/controllers/products-controllers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/products-controllers.ts b/src/controllers/products-controllers.ts index d0b5b75..31ef9f9 100644 --- a/src/controllers/products-controllers.ts +++ b/src/controllers/products-controllers.ts @@ -6,7 +6,7 @@ import { AppError } from '@/utils/AppError'; class ProductController { async index(request: Request, response: Response, next: NextFunction) { try { - { name } = request.query; + const { name } = request.query; const products = await knex('products') .select()