From be2126e136d517a369fc95776cb4a3c887f8a37e Mon Sep 17 00:00:00 2001 From: Michael Clark <5285928+MikesGlitch@users.noreply.github.com> Date: Mon, 10 Feb 2025 22:46:25 +0000 Subject: [PATCH] =?UTF-8?q?=E2=98=81=EF=B8=8F=20=20Server=20workflows=20ru?= =?UTF-8?q?n=20only=20when=20server=20files=20have=20changed=20(#4348)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * making the server workflows run only when server files have changed * release notes * also on merge to master * rabbit suggestion * e2e tests and size compare dont need to run when server changes * adding to the paths ignore --- .github/workflows/docker-edge.yml | 7 ++++--- .github/workflows/e2e-test.yml | 6 +++++- .github/workflows/size-compare.yml | 3 +++ packages/sync-server/src/app-simplefin/app-simplefin.js | 4 ++-- packages/sync-server/src/util/middlewares.js | 6 +++++- upcoming-release-notes/4348.md | 6 ++++++ 6 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 upcoming-release-notes/4348.md diff --git a/.github/workflows/docker-edge.yml b/.github/workflows/docker-edge.yml index 11f141879e..ef3b59aa61 100644 --- a/.github/workflows/docker-edge.yml +++ b/.github/workflows/docker-edge.yml @@ -5,12 +5,13 @@ on: push: branches: - master - paths-ignore: - - README.md - - LICENSE.txt + paths: + - packages/sync-server pull_request: branches: - master + paths: + - packages/sync-server schedule: - cron: '0 0 * * *' workflow_dispatch: diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 9c5127795d..1dab635e28 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -1,6 +1,10 @@ name: E2E Tests -on: [pull_request] +on: + pull_request: + paths-ignore: + - packages/sync-server + - upcoming-release-notes env: GITHUB_PR_NUMBER: ${{github.event.pull_request.number}} diff --git a/.github/workflows/size-compare.yml b/.github/workflows/size-compare.yml index 008f98a764..d41a228192 100644 --- a/.github/workflows/size-compare.yml +++ b/.github/workflows/size-compare.yml @@ -13,6 +13,9 @@ name: Compare Sizes on: pull_request_target: + paths-ignore: + - packages/sync-server + - upcoming-release-notes concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/packages/sync-server/src/app-simplefin/app-simplefin.js b/packages/sync-server/src/app-simplefin/app-simplefin.js index e401824f2f..f453f0b150 100644 --- a/packages/sync-server/src/app-simplefin/app-simplefin.js +++ b/packages/sync-server/src/app-simplefin/app-simplefin.js @@ -76,13 +76,13 @@ app.post( } if (Array.isArray(accountId) != Array.isArray(startDate)) { - console.log(accountId, startDate); + console.log({ accountId, startDate }); throw new Error( 'accountId and startDate must either both be arrays or both be strings', ); } if (Array.isArray(accountId) && accountId.length !== startDate.length) { - console.log(accountId, startDate); + console.log({ accountId, startDate }); throw new Error('accountId and startDate arrays must be the same length'); } diff --git a/packages/sync-server/src/util/middlewares.js b/packages/sync-server/src/util/middlewares.js index 99eb821280..69b0e5eaf0 100644 --- a/packages/sync-server/src/util/middlewares.js +++ b/packages/sync-server/src/util/middlewares.js @@ -22,7 +22,11 @@ async function errorMiddleware(err, req, res, next) { // Source: https://expressjs.com/en/guide/error-handling.html return next(err); } - console.log(`Error on endpoint ${req.url}`, err.message, err.stack); + + console.log(`Error on endpoint %s`, { + requestUrl: req.url, + stacktrace: err.stack, + }); res.status(500).send({ status: 'error', reason: 'internal-error' }); } diff --git a/upcoming-release-notes/4348.md b/upcoming-release-notes/4348.md new file mode 100644 index 0000000000..5b0ace66b5 --- /dev/null +++ b/upcoming-release-notes/4348.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [MikesGlitch] +--- + +Making Server related github actions run only when server files change