From 03c1d6ea93bfe81a80a3e7ea2ed5acc5aca0d3fd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 11:53:00 +0000 Subject: [PATCH 1/5] Initial plan From 3c8adbd59ec143704d1cef220928de24c829d4b8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 11:56:17 +0000 Subject: [PATCH 2/5] Refactor CI to use composite action + artifacts to avoid repeated npm ci Co-authored-by: sfreeman422 <16405652+sfreeman422@users.noreply.github.com> Agent-Logs-Url: https://github.com/dev-chat/mocker/sessions/4c494880-0851-4259-9bf2-0172fcf671c4 --- .github/actions/setup/action.yml | 13 ++++++++++ .github/workflows/ci.yml | 41 +++++++++++++++++++------------- 2 files changed, 37 insertions(+), 17 deletions(-) create mode 100644 .github/actions/setup/action.yml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 00000000..f0d98869 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,13 @@ +name: 'Setup Node.js with cached dependencies' +description: 'Sets up Node.js and restores node_modules from the artifact uploaded by the setup job.' + +runs: + using: composite + steps: + - uses: actions/setup-node@v4 + with: + node-version: '20' + - uses: actions/download-artifact@v4 + with: + name: node-modules + path: node_modules diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66260529..e8019cce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,9 +4,12 @@ on: pull_request: types: [opened, synchronize, reopened] +permissions: + contents: read + jobs: - lint: - name: Lint + setup: + name: Install Dependencies runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -15,41 +18,45 @@ jobs: node-version: '20' cache: 'npm' - run: npm ci + - uses: actions/upload-artifact@v4 + with: + name: node-modules + path: node_modules + retention-days: 1 + + lint: + name: Lint + needs: setup + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup - run: npm run lint format-check: name: Format Check + needs: setup runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' - - run: npm ci + - uses: ./.github/actions/setup - run: npm run format:check build: name: Build + needs: setup runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' - - run: npm ci + - uses: ./.github/actions/setup - run: npm run build test: name: Test & Coverage + needs: setup runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' - - run: npm ci + - uses: ./.github/actions/setup - name: Enforce 80% coverage run: npm run test:coverage From 2396c37f6854ff5973de1fa87efce05acc83638f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 12:01:14 +0000 Subject: [PATCH 3/5] Fix actions permissions for artifact upload/download in CI workflow Co-authored-by: sfreeman422 <16405652+sfreeman422@users.noreply.github.com> Agent-Logs-Url: https://github.com/dev-chat/mocker/sessions/9c6de18d-4d6d-4a01-a0c4-6091c6499711 --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8019cce..ee62bbb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,9 @@ jobs: setup: name: Install Dependencies runs-on: ubuntu-latest + permissions: + contents: read + actions: write steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -28,6 +31,9 @@ jobs: name: Lint needs: setup runs-on: ubuntu-latest + permissions: + contents: read + actions: read steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup @@ -37,6 +43,9 @@ jobs: name: Format Check needs: setup runs-on: ubuntu-latest + permissions: + contents: read + actions: read steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup @@ -46,6 +55,9 @@ jobs: name: Build needs: setup runs-on: ubuntu-latest + permissions: + contents: read + actions: read steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup @@ -55,6 +67,9 @@ jobs: name: Test & Coverage needs: setup runs-on: ubuntu-latest + permissions: + contents: read + actions: read steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup From ea56ad0bdb8245162376a410e3330a29631421c4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 12:06:19 +0000 Subject: [PATCH 4/5] Fix: restore execute permissions on node_modules/.bin after artifact download Co-authored-by: sfreeman422 <16405652+sfreeman422@users.noreply.github.com> Agent-Logs-Url: https://github.com/dev-chat/mocker/sessions/c08c9005-bef2-4528-b4ab-b197997e8da9 --- .github/actions/setup/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index f0d98869..6eb45008 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -11,3 +11,5 @@ runs: with: name: node-modules path: node_modules + - run: chmod -R +x node_modules/.bin + shell: bash From 344ccd056d4c5e9dd4d75cbc2c822e375aca9f07 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 12:19:39 +0000 Subject: [PATCH 5/5] Fix: tar node_modules to preserve symlinks and permissions across artifact upload/download Co-authored-by: sfreeman422 <16405652+sfreeman422@users.noreply.github.com> Agent-Logs-Url: https://github.com/dev-chat/mocker/sessions/95656348-9a9c-4213-a56b-4604864084e8 --- .github/actions/setup/action.yml | 4 ++-- .github/workflows/ci.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 6eb45008..e64ea34a 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -10,6 +10,6 @@ runs: - uses: actions/download-artifact@v4 with: name: node-modules - path: node_modules - - run: chmod -R +x node_modules/.bin + path: . + - run: tar -xzf node-modules.tar.gz && rm node-modules.tar.gz shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee62bbb2..5ed900d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,10 +21,11 @@ jobs: node-version: '20' cache: 'npm' - run: npm ci + - run: tar -czf node-modules.tar.gz node_modules - uses: actions/upload-artifact@v4 with: name: node-modules - path: node_modules + path: node-modules.tar.gz retention-days: 1 lint: