From 213155f9e4af1d3e8fe3fff055350efffad68c79 Mon Sep 17 00:00:00 2001 From: alegarman2002 <116609314+alegarman2002@users.noreply.github.com> Date: Tue, 30 Apr 2024 00:01:44 +0200 Subject: [PATCH 01/10] Hotfix added default to calculator --- webapp/src/components/game/Calculator.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webapp/src/components/game/Calculator.js b/webapp/src/components/game/Calculator.js index c259c06d..3b582cf5 100644 --- a/webapp/src/components/game/Calculator.js +++ b/webapp/src/components/game/Calculator.js @@ -104,6 +104,8 @@ const Calculator = () => { case '÷': correctAnswer = Math.round(num1 / num2); break; + default: + break; } const option = [correctAnswer]; From 817148a2458ece728441668d8969b8fcb6a172b8 Mon Sep 17 00:00:00 2001 From: Marco Quintana Date: Tue, 30 Apr 2024 00:02:55 +0200 Subject: [PATCH 02/10] added e2e to build --- .github/workflows/build.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13705be4..97966e7b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,4 +34,18 @@ jobs: uses: sonarsource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + e2e-tests: + needs: [unit-tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm --prefix users/authservice install + - run: npm --prefix users/userservice install + - run: npm --prefix gatewayservice install + - run: npm --prefix webapp install + - run: npm --prefix webapp run build + - run: npm --prefix webapp run test:e2e \ No newline at end of file From 60a757374e17b80a4d833464dae27caf185bbedf Mon Sep 17 00:00:00 2001 From: Marco Quintana Date: Tue, 30 Apr 2024 00:15:11 +0200 Subject: [PATCH 03/10] hotfix --- webapp/e2e/steps/register-form.steps.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/webapp/e2e/steps/register-form.steps.js b/webapp/e2e/steps/register-form.steps.js index f940ed07..041ca460 100644 --- a/webapp/e2e/steps/register-form.steps.js +++ b/webapp/e2e/steps/register-form.steps.js @@ -27,9 +27,12 @@ defineFeature(feature, test => { let username; let password; + let name; + let surname; given('An unregistered user', async () => { - username = "pablo" + username = name = "pablo" + surname = "gonzález" password = "pabloasw" await expect(page).toClick("p", { text: "Don't have an account? Register here." }); }); @@ -37,7 +40,10 @@ defineFeature(feature, test => { when('I fill the data in the form and press submit', async () => { await expect(page).toFill('input[name="username"]', username); await expect(page).toFill('input[name="password"]', password); - await expect(page).toClick('button', { text: 'Add user' }) + await expect(page).toFill('input[name="passwordConfirm"]', password); + await expect(page).toFill('input[name="name"]', name); + await expect(page).toFill('input[name="surname"]', surname); + await expect(page).toClick('button', { text: 'Añadir' }) }); then('A confirmation message should be shown in the screen', async () => { From ce5be00d268ffb5248795d61f273829f83228446 Mon Sep 17 00:00:00 2001 From: Marco Quintana Date: Tue, 30 Apr 2024 00:20:45 +0200 Subject: [PATCH 04/10] hotfix --- webapp/e2e/steps/register-form.steps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/e2e/steps/register-form.steps.js b/webapp/e2e/steps/register-form.steps.js index 041ca460..44cd2098 100644 --- a/webapp/e2e/steps/register-form.steps.js +++ b/webapp/e2e/steps/register-form.steps.js @@ -40,7 +40,7 @@ defineFeature(feature, test => { when('I fill the data in the form and press submit', async () => { await expect(page).toFill('input[name="username"]', username); await expect(page).toFill('input[name="password"]', password); - await expect(page).toFill('input[name="passwordConfirm"]', password); + await expect(page).toFill('input[name="confirmPassword"]', password); await expect(page).toFill('input[name="name"]', name); await expect(page).toFill('input[name="surname"]', surname); await expect(page).toClick('button', { text: 'Añadir' }) From ae18c5022226bf23fca7d064f63b04a28d56e953 Mon Sep 17 00:00:00 2001 From: Marco Quintana Date: Tue, 30 Apr 2024 00:26:41 +0200 Subject: [PATCH 05/10] hoyfix :( --- webapp/e2e/steps/register-form.steps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/e2e/steps/register-form.steps.js b/webapp/e2e/steps/register-form.steps.js index 44cd2098..1757b5f3 100644 --- a/webapp/e2e/steps/register-form.steps.js +++ b/webapp/e2e/steps/register-form.steps.js @@ -47,7 +47,7 @@ defineFeature(feature, test => { }); then('A confirmation message should be shown in the screen', async () => { - await expect(page).toMatchElement("div", { text: "User added successfully" }); + await expect(page).toMatchElement("div", { text: "Usuario añadido correctamente" }); }); }) From aab62a006694328b6f73a6def415b45ee77c9b0b Mon Sep 17 00:00:00 2001 From: Abel Date: Tue, 30 Apr 2024 00:54:10 +0200 Subject: [PATCH 06/10] Trying to fix deploy --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e4f437e..47b0c79d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -147,7 +147,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io - workdir: questionsservice/questiongeneratorservice + workdir: questionsservice platforms: linux/arm64 docker-push-wikidataextractorservice: name: Push wikidata extractor service Docker Image to GitHub Packages @@ -167,7 +167,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io - workdir: questionsservice/wikidataExtractor + workdir: questionsservice platforms: linux/arm64 docker-push-storequestionservice: name: Push questions store service Docker Image to GitHub Packages From 463330469087d486085d97bbd5e1798effe3b01b Mon Sep 17 00:00:00 2001 From: Abel Date: Tue, 30 Apr 2024 01:14:52 +0200 Subject: [PATCH 07/10] 2nd try --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47b0c79d..204c0834 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -148,6 +148,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io workdir: questionsservice + build-path: questionsservice/questiongeneratorservice platforms: linux/arm64 docker-push-wikidataextractorservice: name: Push wikidata extractor service Docker Image to GitHub Packages @@ -168,6 +169,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io workdir: questionsservice + build-path: questionsservice/wikidataExtractor platforms: linux/arm64 docker-push-storequestionservice: name: Push questions store service Docker Image to GitHub Packages From cf28b1bc70608fe901e70d46599716079f4a6faf Mon Sep 17 00:00:00 2001 From: Abel Date: Tue, 30 Apr 2024 01:22:26 +0200 Subject: [PATCH 08/10] 3rd try --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 204c0834..aed18397 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -148,7 +148,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io workdir: questionsservice - build-path: questionsservice/questiongeneratorservice + dockerfile: questionsservice/questiongeneratorservice platforms: linux/arm64 docker-push-wikidataextractorservice: name: Push wikidata extractor service Docker Image to GitHub Packages @@ -169,7 +169,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io workdir: questionsservice - build-path: questionsservice/wikidataExtractor + dockerfile: questionsservice/wikidataExtractor platforms: linux/arm64 docker-push-storequestionservice: name: Push questions store service Docker Image to GitHub Packages From bbcafc54e40b6a1b2f27935eee79c04e79f43c25 Mon Sep 17 00:00:00 2001 From: Abel Date: Tue, 30 Apr 2024 01:30:24 +0200 Subject: [PATCH 09/10] 4th try --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aed18397..1a642761 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -148,7 +148,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io workdir: questionsservice - dockerfile: questionsservice/questiongeneratorservice + dockerfile: ./questiongeneratorservice/Dockerfile platforms: linux/arm64 docker-push-wikidataextractorservice: name: Push wikidata extractor service Docker Image to GitHub Packages @@ -169,7 +169,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io workdir: questionsservice - dockerfile: questionsservice/wikidataExtractor + dockerfile: ./wikidataExtractor/Dockerfile platforms: linux/arm64 docker-push-storequestionservice: name: Push questions store service Docker Image to GitHub Packages From d5557729d13c41f92a84fc54d2611b70fa50b6fb Mon Sep 17 00:00:00 2001 From: alegarman2002 <116609314+alegarman2002@users.noreply.github.com> Date: Tue, 30 Apr 2024 01:59:36 +0200 Subject: [PATCH 10/10] Hotfix release and build fixed --- .github/workflows/build.yml | 1 + .github/workflows/release.yml | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97966e7b..900f3abf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,7 @@ jobs: - run: npm --prefix storeQuestionService ci - run: npm --prefix userStatsService ci - run: npm --prefix gameservice ci + - run: npm --prefix apisgatewayservice ci - run: npm --prefix users/authservice test -- --coverage - run: npm --prefix users/userservice test -- --coverage - run: npm --prefix gatewayservice test -- --coverage diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e4f437e..54ebf57d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,7 @@ jobs: - run: npm --prefix userStatsService ci - run: npm --prefix webapp ci - run: npm --prefix gameservice ci + - run: npm --prefix apisgatewayservice ci - run: npm --prefix users/authservice test -- --coverage - run: npm --prefix users/userservice test -- --coverage - run: npm --prefix gatewayservice test -- --coverage @@ -27,6 +28,8 @@ jobs: - run: npm --prefix storeQuestionService test -- --coverage - run: npm --prefix userStatsService test -- --coverage - run: npm --prefix gameservice test -- --coverage + + - name: Analyze with SonarCloud uses: sonarsource/sonarcloud-github-action@master env: @@ -229,6 +232,26 @@ jobs: registry: ghcr.io workdir: gameservice platforms: linux/arm64 + docker-push-apisgatewayservice: + name: Push apis gateway service Docker Image to GitHub Packages + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + needs: [e2e-tests] + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - uses: actions/checkout@v4 + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@v5 + with: + name: arquisoft/wiq_es6c/apisgatewayservice + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + workdir: apisgatewayservice + platforms: linux/arm64 deploy: name: Deploy over SSH runs-on: ubuntu-latest