From 018d719de395f5255b20784eafd7736c52ac5551 Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 9 Dec 2024 15:02:34 -0500 Subject: [PATCH 1/7] run branch check on PRs only --- .github/workflows/node.js.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d42b6ef76ee..7dbd9730049 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -33,6 +33,7 @@ jobs: with: node-version: '20' - name: Check Branch title + if: ${{ github.event_name == 'pull_request'}} env: BRANCH_NAME: ${{ github.head_ref }} run: | From d03a2dad47fb665ec55b902b2515f1ac526de812 Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 9 Dec 2024 15:06:06 -0500 Subject: [PATCH 2/7] use event branch name --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 7dbd9730049..4d2ace1080c 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -35,7 +35,7 @@ jobs: - name: Check Branch title if: ${{ github.event_name == 'pull_request'}} env: - BRANCH_NAME: ${{ github.head_ref }} + BRANCH_NAME: ${{ github.event.pull_request.head.ref }} run: | node "$GITHUB_WORKSPACE/.github/workflows/lintbranch.js" run "$BRANCH_NAME" - name: Check PR title From 4fb8e66da03c6efb523ab523f8c3d9a769abc622 Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 9 Dec 2024 15:16:32 -0500 Subject: [PATCH 3/7] change wording --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 4d2ace1080c..6d057d0ddf4 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -32,7 +32,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: '20' - - name: Check Branch title + - name: Validate Branch name if: ${{ github.event_name == 'pull_request'}} env: BRANCH_NAME: ${{ github.event.pull_request.head.ref }} From cdecab61aa146bef8816b24eb0db44699855797e Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 9 Dec 2024 15:21:27 -0500 Subject: [PATCH 4/7] add extra check --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6d057d0ddf4..86e6db52651 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -33,7 +33,7 @@ jobs: with: node-version: '20' - name: Validate Branch name - if: ${{ github.event_name == 'pull_request'}} + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref != ""}} env: BRANCH_NAME: ${{ github.event.pull_request.head.ref }} run: | From f2900e5c570b16a649086f0cc43ca4e2d33ec870 Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 9 Dec 2024 15:27:37 -0500 Subject: [PATCH 5/7] switch to single quotes --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 86e6db52651..a7541f39b9c 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -33,7 +33,7 @@ jobs: with: node-version: '20' - name: Validate Branch name - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref != ""}} + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref != ''}} env: BRANCH_NAME: ${{ github.event.pull_request.head.ref }} run: | From f15d0ffc0482ed7a7c9be1c6c7e3b9c40e180f10 Mon Sep 17 00:00:00 2001 From: hkobew Date: Thu, 12 Dec 2024 17:22:16 -0500 Subject: [PATCH 6/7] update thresholds --- packages/core/src/testInteg/perf/buildIndex.test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/core/src/testInteg/perf/buildIndex.test.ts b/packages/core/src/testInteg/perf/buildIndex.test.ts index e8c469db4bc..c6c2555e691 100644 --- a/packages/core/src/testInteg/perf/buildIndex.test.ts +++ b/packages/core/src/testInteg/perf/buildIndex.test.ts @@ -10,7 +10,7 @@ import assert from 'assert' import { LspClient, LspController } from '../../amazonq' import { LanguageClient, ServerOptions } from 'vscode-languageclient' import { createTestWorkspace } from '../../test/testUtil' -import { BuildIndexRequestType, GetRepomapIndexJSONRequestType, GetUsageRequestType } from '../../amazonq/lsp/types' +import { BuildIndexRequestType, GetUsageRequestType } from '../../amazonq/lsp/types' import { fs, getRandomString } from '../../shared' import { FileSystem } from '../../shared/fs/fs' import { getFsCallsUpperBound } from './utilities' @@ -22,11 +22,10 @@ interface SetupResult { } async function verifyResult(setup: SetupResult) { - // A correct run makes 3 requests, but don't want to make it exact to avoid over-sensitivity to implementation. If we make 10+ something is likely wrong. - assert.ok(setup.clientReqStub.callCount >= 3 && setup.clientReqStub.callCount <= 10) + // A correct run makes 2 requests, but don't want to make it exact to avoid over-sensitivity to implementation. If we make 10+ something is likely wrong. + assert.ok(setup.clientReqStub.callCount >= 1 && setup.clientReqStub.callCount <= 10) assert.ok(setup.clientReqStub.calledWith(BuildIndexRequestType)) assert.ok(setup.clientReqStub.calledWith(GetUsageRequestType)) - assert.ok(setup.clientReqStub.calledWith(GetRepomapIndexJSONRequestType)) assert.strictEqual(getFsCallsUpperBound(setup.fsSpy), 0, 'should not make any fs calls') assert.ok(setup.findFilesSpy.callCount <= 2, 'findFiles should not be called more than twice') From ac336db31c501546f63539ffe7ba65a32173fea8 Mon Sep 17 00:00:00 2001 From: hkobew Date: Thu, 12 Dec 2024 17:23:03 -0500 Subject: [PATCH 7/7] require at least two requests --- packages/core/src/testInteg/perf/buildIndex.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/testInteg/perf/buildIndex.test.ts b/packages/core/src/testInteg/perf/buildIndex.test.ts index c6c2555e691..d60de3bdc3a 100644 --- a/packages/core/src/testInteg/perf/buildIndex.test.ts +++ b/packages/core/src/testInteg/perf/buildIndex.test.ts @@ -23,7 +23,7 @@ interface SetupResult { async function verifyResult(setup: SetupResult) { // A correct run makes 2 requests, but don't want to make it exact to avoid over-sensitivity to implementation. If we make 10+ something is likely wrong. - assert.ok(setup.clientReqStub.callCount >= 1 && setup.clientReqStub.callCount <= 10) + assert.ok(setup.clientReqStub.callCount >= 2 && setup.clientReqStub.callCount <= 10) assert.ok(setup.clientReqStub.calledWith(BuildIndexRequestType)) assert.ok(setup.clientReqStub.calledWith(GetUsageRequestType))