From 9bab5952042f598cb814b4ccf36d676cd472a6dd Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Wed, 20 Mar 2024 12:15:42 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=AC=20chore:=20Add=20Circular=20Depend?= =?UTF-8?q?ency=20Check=20to=20`backend-review`=20(#2149)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🔬 chore: Add Circular Dependency check to `backend-review` * chore: touch random file for workflow trigger * chore: workflow step order * chore: update workflow to create empty auth.json file * fix: attempt empty auth.json creation * chore: add test_bundle ESLint ignore pattern --- .eslintrc.js | 1 + .github/workflows/backend-review.yml | 15 +++++++++++++++ api/utils/azureUtils.js | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 6d8e085182..e85e0d768c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -19,6 +19,7 @@ module.exports = { 'e2e/playwright-report/**/*', 'packages/data-provider/types/**/*', 'packages/data-provider/dist/**/*', + 'packages/data-provider/test_bundle/**/*', 'data-node/**/*', 'meili_data/**/*', 'node_modules/**/*', diff --git a/.github/workflows/backend-review.yml b/.github/workflows/backend-review.yml index 2d5cf387be..9f8bd7b530 100644 --- a/.github/workflows/backend-review.yml +++ b/.github/workflows/backend-review.yml @@ -35,6 +35,21 @@ jobs: - name: Install Data Provider run: npm run build:data-provider + + - name: Create empty auth.json file + run: | + mkdir -p api/data + echo '{}' > api/data/auth.json + + - name: Check for Circular dependency in rollup + working-directory: ./packages/data-provider + run: | + output=$(npm run rollup:api) + echo "$output" + if echo "$output" | grep -q "Circular dependency"; then + echo "Error: Circular dependency detected!" + exit 1 + fi - name: Run unit tests run: cd api && npm run test:ci diff --git a/api/utils/azureUtils.js b/api/utils/azureUtils.js index fe8a34d6d6..27396a8fc5 100644 --- a/api/utils/azureUtils.js +++ b/api/utils/azureUtils.js @@ -6,7 +6,7 @@ const { isEnabled } = require('~/server/utils'); * @returns {string} The sanitized model name. */ const sanitizeModelName = (modelName) => { - // Replace periods with empty strings and other disallowed characters as needed + // Replace periods with empty strings and other disallowed characters as needed. return modelName.replace(/\./g, ''); };