From e1dadc0ca6d36eb9f459b2184db88e50a546f3cf Mon Sep 17 00:00:00 2001 From: rmanaem Date: Thu, 9 Jan 2025 10:34:26 -0500 Subject: [PATCH 01/34] Added submodules --- neurobagel_examples | 1 + recipes | 1 + 2 files changed, 2 insertions(+) create mode 160000 neurobagel_examples create mode 160000 recipes diff --git a/neurobagel_examples b/neurobagel_examples new file mode 160000 index 00000000..d44875e8 --- /dev/null +++ b/neurobagel_examples @@ -0,0 +1 @@ +Subproject commit d44875e85150bc8a0659fa2b298846dc3db36377 diff --git a/recipes b/recipes new file mode 160000 index 00000000..04b6631a --- /dev/null +++ b/recipes @@ -0,0 +1 @@ +Subproject commit 04b6631af1a9340458a2e3dd31edf622e708c0a0 From a8f2a19819a75abc6b4c672e9c1ed2fa13c7a8c9 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Thu, 9 Jan 2025 10:45:55 -0500 Subject: [PATCH 02/34] Updated submodules --- neurobagel_examples | 2 +- recipes | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/neurobagel_examples b/neurobagel_examples index d44875e8..5690cd4f 160000 --- a/neurobagel_examples +++ b/neurobagel_examples @@ -1 +1 @@ -Subproject commit d44875e85150bc8a0659fa2b298846dc3db36377 +Subproject commit 5690cd4f42ca9df9651e93d488b9acad3cdf3213 diff --git a/recipes b/recipes index 04b6631a..f52d2f27 160000 --- a/recipes +++ b/recipes @@ -1 +1 @@ -Subproject commit 04b6631af1a9340458a2e3dd31edf622e708c0a0 +Subproject commit f52d2f27dab581ceae43f5873de649a8cf5c329b From 7b9b3b3180455b0c137971cc2412e455f029fc85 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Thu, 9 Jan 2025 11:01:56 -0500 Subject: [PATCH 03/34] Added `UpdateExamples` e2e test --- cypress/e2e/UpdateExamples.cy.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 cypress/e2e/UpdateExamples.cy.ts diff --git a/cypress/e2e/UpdateExamples.cy.ts b/cypress/e2e/UpdateExamples.cy.ts new file mode 100644 index 00000000..3e50da44 --- /dev/null +++ b/cypress/e2e/UpdateExamples.cy.ts @@ -0,0 +1,18 @@ +import fapiQuerySuccess200 from '../../neurobagel_examples/api-responses/fapi_query_success_200.json'; + +describe('Update Examples', () => { + it('Removes a newline character from a dataset name in the downloaded dataset-level results file', () => { + cy.intercept('GET', 'query*', (req) => { + req.reply(fapiQuerySuccess200); + }).as('call'); + cy.visit('/'); + cy.get('[data-cy="close-auth-dialog-button"]').click(); + cy.get('[data-cy="submit-query-button"]').click(); + cy.wait('@call'); + cy.get('[data-cy="select-all-checkbox"]').find('input').check(); + cy.get('[data-cy="download-results-button"]').click(); + cy.get('[data-cy="download-results-dropdown-button"]').click(); + cy.contains('URIs').click(); + cy.get('[data-cy="download-results-button"]').click(); + }); +}); From 74fd965b5f3f1ee8bbeef51bb58c47fe17192c2a Mon Sep 17 00:00:00 2001 From: rmanaem Date: Thu, 9 Jan 2025 11:03:32 -0500 Subject: [PATCH 04/34] Added `Update examples` workflow --- .github/workflows/updated_examples.yaml | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/updated_examples.yaml diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml new file mode 100644 index 00000000..362f036e --- /dev/null +++ b/.github/workflows/updated_examples.yaml @@ -0,0 +1,41 @@ +name: update examples + +on: + push: + branches: + - maint-368 + pull_request: + workflow_dispatch: + +jobs: + e2e-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up node env + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Create .env file + run: | + echo -e "NB_API_QUERY_URL=https://federate.neurobagel.org/\nNB_ENABLE_AUTH=true\nNB_QUERY_CLIENT_ID=mockclientid" > .env + + - name: build + run: npm install && npm run build + + - name: Run end to end tests + uses: cypress-io/github-action@v6 + with: + wait-on: http://localhost:5173 + start: npm run preview + spec: cypress/e2e/UpdateExamples.cy.js + component: false + + - name: Upload test artifacts + uses: actions/upload-artifact@v3 + with: + name: e2e-test-results + path: cypress/downloads/* \ No newline at end of file From c3c371aedacea5796d0e7e15d7e24a8569ebe11c Mon Sep 17 00:00:00 2001 From: rmanaem Date: Thu, 9 Jan 2025 11:08:35 -0500 Subject: [PATCH 05/34] Included the submodules in the checkout step --- .github/workflows/updated_examples.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 362f036e..5e8fb479 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + submodules: true - name: Set up node env uses: actions/setup-node@v4 From 52e4eac74da99cb1548c3a0bc74ffdc7ca4753f4 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Thu, 9 Jan 2025 11:12:27 -0500 Subject: [PATCH 06/34] Fixed typo in the file format --- .github/workflows/updated_examples.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 5e8fb479..576f763c 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -33,7 +33,7 @@ jobs: with: wait-on: http://localhost:5173 start: npm run preview - spec: cypress/e2e/UpdateExamples.cy.js + spec: cypress/e2e/UpdateExamples.cy.ts component: false - name: Upload test artifacts From 7fc8a966abff2099e843901869f08b33f10f32ba Mon Sep 17 00:00:00 2001 From: rmanaem Date: Thu, 9 Jan 2025 19:38:03 -0500 Subject: [PATCH 07/34] Added `update-query-tool-results` job --- .github/workflows/updated_examples.yaml | 51 ++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 576f763c..ebe01848 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -40,4 +40,53 @@ jobs: uses: actions/upload-artifact@v3 with: name: e2e-test-results - path: cypress/downloads/* \ No newline at end of file + path: cypress/downloads/* + + update-query-tool-results: + runs-on: ubuntu-latest + needs: e2e-test + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + submodules_recursive: true + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: e2e-test-results + path: neurobagel_examples/query-tool-results + + - name: Generate a token + id: generate-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ vars.NB_BOT_ID }} + private-key: ${{ secrets.NB_BOT_KEY }} + + - name: Check for changes and commit if there are any + run: | + git config --global user.name "neurobagel bot" + git config --global user.email "neurobagel@example.com" + cd neurobagel_examples + git checkout -b update-query-tool-results + git add query-tool-results + if [[ -n $(git diff --staged) ]]; then + git commit -m "Update query-tool-results with new e2e test results" + git push origin update-query-tool-results + else + echo "No changes to commit" + cd .. + + - name: Create Pull Request + id: create_pr + if: steps.commit.outputs.changes + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ steps.generate-token.outputs.token }} + commit-message: Update `query-tool-results` files + branch: neurobagel_examples/update-query-tool-results + title: Update `query-tool-results` files + body: "This PR updates the `query-tool-results` files with the latest changes." + labels: _bot \ No newline at end of file From 577b7427915a7ea6d3e0741883d922e7e20b4b93 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Thu, 9 Jan 2025 19:43:38 -0500 Subject: [PATCH 08/34] Fixed the open condition --- .github/workflows/updated_examples.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index ebe01848..7f90c198 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -77,7 +77,7 @@ jobs: git push origin update-query-tool-results else echo "No changes to commit" - cd .. + fi - name: Create Pull Request id: create_pr From 983055bd2422ed78618292aee02fbab94fb75508 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Thu, 9 Jan 2025 19:50:54 -0500 Subject: [PATCH 09/34] Try checking out the examples repo directly --- .github/workflows/updated_examples.yaml | 53 +++++-------------------- 1 file changed, 10 insertions(+), 43 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 7f90c198..c641d50f 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -10,47 +10,21 @@ on: jobs: e2e-test: runs-on: ubuntu-latest + needs: e2e-test steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - - - name: Set up node env - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Create .env file - run: | - echo -e "NB_API_QUERY_URL=https://federate.neurobagel.org/\nNB_ENABLE_AUTH=true\nNB_QUERY_CLIENT_ID=mockclientid" > .env - - - name: build - run: npm install && npm run build - - - name: Run end to end tests - uses: cypress-io/github-action@v6 - with: - wait-on: http://localhost:5173 - start: npm run preview - spec: cypress/e2e/UpdateExamples.cy.ts - component: false - - - name: Upload test artifacts - uses: actions/upload-artifact@v3 + - name: Generate a token + id: generate-token + uses: actions/create-github-app-token@v1 with: - name: e2e-test-results - path: cypress/downloads/* + app-id: ${{ vars.NB_BOT_ID }} + private-key: ${{ secrets.NB_BOT_KEY }} - update-query-tool-results: - runs-on: ubuntu-latest - needs: e2e-test - steps: - - name: Checkout + - name: Checkout neurobagel_examples repository uses: actions/checkout@v4 with: - submodules: true - submodules_recursive: true + repository: neurobagel/neurobagel_examples + path: neurobagel_examples + token: ${{ steps.generate-token.outputs.token }} - name: Download artifacts uses: actions/download-artifact@v3 @@ -58,13 +32,6 @@ jobs: name: e2e-test-results path: neurobagel_examples/query-tool-results - - name: Generate a token - id: generate-token - uses: actions/create-github-app-token@v1 - with: - app-id: ${{ vars.NB_BOT_ID }} - private-key: ${{ secrets.NB_BOT_KEY }} - - name: Check for changes and commit if there are any run: | git config --global user.name "neurobagel bot" From e677e46422345d3eb723ec32bb2fd5bda5651512 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Thu, 9 Jan 2025 19:53:17 -0500 Subject: [PATCH 10/34] Fixed the oopsie --- .github/workflows/updated_examples.yaml | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index c641d50f..6d175296 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -9,6 +9,40 @@ on: jobs: e2e-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + + - name: Set up node env + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Create .env file + run: | + echo -e "NB_API_QUERY_URL=https://federate.neurobagel.org/\nNB_ENABLE_AUTH=true\nNB_QUERY_CLIENT_ID=mockclientid" > .env + + - name: build + run: npm install && npm run build + + - name: Run end to end tests + uses: cypress-io/github-action@v6 + with: + wait-on: http://localhost:5173 + start: npm run preview + spec: cypress/e2e/UpdateExamples.cy.ts + component: false + + - name: Upload test artifacts + uses: actions/upload-artifact@v3 + with: + name: e2e-test-results + path: cypress/downloads/* + + update-query-tool-results: runs-on: ubuntu-latest needs: e2e-test steps: From 7106d8429b2a91b5b1d11f371ed57a53ba5b116c Mon Sep 17 00:00:00 2001 From: rmanaem Date: Thu, 9 Jan 2025 19:56:22 -0500 Subject: [PATCH 11/34] Let's try this --- .github/workflows/updated_examples.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 6d175296..13190b8d 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -68,9 +68,8 @@ jobs: - name: Check for changes and commit if there are any run: | - git config --global user.name "neurobagel bot" - git config --global user.email "neurobagel@example.com" - cd neurobagel_examples + git config --global user.name "Neurobagel Bot" + git config --global user.email "neurobagel-bot[bot]@users.noreply.github.com" git checkout -b update-query-tool-results git add query-tool-results if [[ -n $(git diff --staged) ]]; then From 1482317a75673858094b06b922c0b80034a19a08 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 12:28:08 -0500 Subject: [PATCH 12/34] Removed commit step --- .github/workflows/updated_examples.yaml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 13190b8d..829ed252 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -66,22 +66,8 @@ jobs: name: e2e-test-results path: neurobagel_examples/query-tool-results - - name: Check for changes and commit if there are any - run: | - git config --global user.name "Neurobagel Bot" - git config --global user.email "neurobagel-bot[bot]@users.noreply.github.com" - git checkout -b update-query-tool-results - git add query-tool-results - if [[ -n $(git diff --staged) ]]; then - git commit -m "Update query-tool-results with new e2e test results" - git push origin update-query-tool-results - else - echo "No changes to commit" - fi - - name: Create Pull Request id: create_pr - if: steps.commit.outputs.changes uses: peter-evans/create-pull-request@v5 with: token: ${{ steps.generate-token.outputs.token }} From 2a1298a92a9fec10bf997e27c6b4c82ce0784d76 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 12:58:43 -0500 Subject: [PATCH 13/34] Made a few small changes --- .github/workflows/updated_examples.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 829ed252..e144170e 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -57,7 +57,6 @@ jobs: uses: actions/checkout@v4 with: repository: neurobagel/neurobagel_examples - path: neurobagel_examples token: ${{ steps.generate-token.outputs.token }} - name: Download artifacts @@ -66,13 +65,18 @@ jobs: name: e2e-test-results path: neurobagel_examples/query-tool-results + - name: debug + run: | + ls + - name: Create Pull Request id: create_pr uses: peter-evans/create-pull-request@v5 with: token: ${{ steps.generate-token.outputs.token }} commit-message: Update `query-tool-results` files - branch: neurobagel_examples/update-query-tool-results + branch: update-query-tool-results title: Update `query-tool-results` files body: "This PR updates the `query-tool-results` files with the latest changes." + base: main labels: _bot \ No newline at end of file From 8d91c9e0ceb26a935aab29e6ad885b75e493aa74 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 13:06:11 -0500 Subject: [PATCH 14/34] Removed the debug step --- .github/workflows/updated_examples.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index e144170e..0c55146c 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -65,10 +65,6 @@ jobs: name: e2e-test-results path: neurobagel_examples/query-tool-results - - name: debug - run: | - ls - - name: Create Pull Request id: create_pr uses: peter-evans/create-pull-request@v5 From fd0603a53ffecf04585e68b62d556480671a3299 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 13:06:55 -0500 Subject: [PATCH 15/34] Added permissions --- .github/workflows/updated_examples.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 0c55146c..52c2e358 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -7,6 +7,10 @@ on: pull_request: workflow_dispatch: +permissions: + contents: write + # pull-requests: write + jobs: e2e-test: runs-on: ubuntu-latest From 934188c39128c89272860aa6f3ab6b086e8778c9 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 13:09:05 -0500 Subject: [PATCH 16/34] Added pull-request permissions --- .github/workflows/updated_examples.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 52c2e358..a8ba14c2 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -9,7 +9,7 @@ on: permissions: contents: write - # pull-requests: write + pull-requests: write jobs: e2e-test: From f4b832033e1b200945bf07acedeb63f82d357b55 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 13:31:17 -0500 Subject: [PATCH 17/34] Updated a few things --- .github/workflows/updated_examples.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index a8ba14c2..0747a371 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -12,7 +12,7 @@ permissions: pull-requests: write jobs: - e2e-test: + generate-example-files: runs-on: ubuntu-latest steps: - name: Checkout @@ -75,8 +75,8 @@ jobs: with: token: ${{ steps.generate-token.outputs.token }} commit-message: Update `query-tool-results` files - branch: update-query-tool-results title: Update `query-tool-results` files body: "This PR updates the `query-tool-results` files with the latest changes." base: main + branch: create-pull-request/query-tool-results labels: _bot \ No newline at end of file From 2398d37acf1a194b3e9d7a9af3f4d861daad383b Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 13:32:18 -0500 Subject: [PATCH 18/34] Fixed the oopsie --- .github/workflows/updated_examples.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 0747a371..ef3878c4 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -48,7 +48,7 @@ jobs: update-query-tool-results: runs-on: ubuntu-latest - needs: e2e-test + needs: generate-example-files steps: - name: Generate a token id: generate-token From b690993775683acc11e789646b3b0f7b249cda11 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 13:40:48 -0500 Subject: [PATCH 19/34] Let's use the latest version --- .github/workflows/updated_examples.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index ef3878c4..4ebb1517 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -46,7 +46,7 @@ jobs: name: e2e-test-results path: cypress/downloads/* - update-query-tool-results: + create-pull-request-for-updated-examples: runs-on: ubuntu-latest needs: generate-example-files steps: @@ -71,12 +71,12 @@ jobs: - name: Create Pull Request id: create_pr - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v7 with: token: ${{ steps.generate-token.outputs.token }} commit-message: Update `query-tool-results` files title: Update `query-tool-results` files body: "This PR updates the `query-tool-results` files with the latest changes." base: main - branch: create-pull-request/query-tool-results + branch: update-query-tool-results labels: _bot \ No newline at end of file From f130eb34225da0d00e48d2d85b4fe89d584a1797 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 13:49:23 -0500 Subject: [PATCH 20/34] Removed the label --- .github/workflows/updated_examples.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 4ebb1517..9d418d31 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -78,5 +78,4 @@ jobs: title: Update `query-tool-results` files body: "This PR updates the `query-tool-results` files with the latest changes." base: main - branch: update-query-tool-results - labels: _bot \ No newline at end of file + branch: update-query-tool-results \ No newline at end of file From 1af7929e75166758cc8e69f61e1525711d3a2363 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 13:57:44 -0500 Subject: [PATCH 21/34] Maybe we need to configure git user idk --- .github/workflows/updated_examples.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 9d418d31..ee11b960 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -46,7 +46,7 @@ jobs: name: e2e-test-results path: cypress/downloads/* - create-pull-request-for-updated-examples: + update-query-tool-results: runs-on: ubuntu-latest needs: generate-example-files steps: @@ -69,13 +69,19 @@ jobs: name: e2e-test-results path: neurobagel_examples/query-tool-results + - name: Set up git user + run: | + git config --global user.name "Neurobagel Bot" + git config --global user.email "neurobagel-bot[bot]@users.noreply.github.com" + - name: Create Pull Request id: create_pr - uses: peter-evans/create-pull-request@v7 + uses: peter-evans/create-pull-request@v5 with: token: ${{ steps.generate-token.outputs.token }} commit-message: Update `query-tool-results` files title: Update `query-tool-results` files body: "This PR updates the `query-tool-results` files with the latest changes." base: main - branch: update-query-tool-results \ No newline at end of file + branch: update-query-tool-results + labels: _bot \ No newline at end of file From 04dcc949ff4ceeec60870f94e307d617df675516 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 15:25:00 -0500 Subject: [PATCH 22/34] A bit of cleaning up --- .github/workflows/updated_examples.yaml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index ee11b960..fb989ab7 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -1,9 +1,6 @@ name: update examples on: - push: - branches: - - maint-368 pull_request: workflow_dispatch: @@ -43,7 +40,7 @@ jobs: - name: Upload test artifacts uses: actions/upload-artifact@v3 with: - name: e2e-test-results + name: query-tool-results path: cypress/downloads/* update-query-tool-results: @@ -66,14 +63,9 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v3 with: - name: e2e-test-results + name: query-tool-results path: neurobagel_examples/query-tool-results - - name: Set up git user - run: | - git config --global user.name "Neurobagel Bot" - git config --global user.email "neurobagel-bot[bot]@users.noreply.github.com" - - name: Create Pull Request id: create_pr uses: peter-evans/create-pull-request@v5 From 0ce4d33f6f2b6b37ae056fea037c32e573c0fbf4 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 15:34:53 -0500 Subject: [PATCH 23/34] Updated component-test workflow --- .github/workflows/component-test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/component-test.yaml b/.github/workflows/component-test.yaml index 457e694a..b52b4edb 100644 --- a/.github/workflows/component-test.yaml +++ b/.github/workflows/component-test.yaml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + submodules: true - name: Create .env file run: | From 1172d21cfe613a43f20ed045798d81a22285aac3 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 15:35:07 -0500 Subject: [PATCH 24/34] Updated e2e-test workflow --- .github/workflows/e2e-test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml index 869abdcf..b96165d8 100644 --- a/.github/workflows/e2e-test.yaml +++ b/.github/workflows/e2e-test.yaml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + submodules: true - name: Set up node env uses: actions/setup-node@v4 From c2611c2fb61715428d27be60b61a122dbd48e473 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 15:36:10 -0500 Subject: [PATCH 25/34] bumped download-artifact to v4 --- .github/workflows/updated_examples.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index fb989ab7..b178f523 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -61,7 +61,7 @@ jobs: token: ${{ steps.generate-token.outputs.token }} - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: query-tool-results path: neurobagel_examples/query-tool-results From e0020f1567008fbc4f40ca0b577ba5638cb5a122 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 15:50:12 -0500 Subject: [PATCH 26/34] Set the specPattern for cypress tests --- cypress.config.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cypress.config.ts b/cypress.config.ts index 37902fc5..94b8d4ab 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -3,11 +3,13 @@ import { defineConfig } from 'cypress'; export default defineConfig({ e2e: { + specPattern: 'cypress/e2e/*', experimentalStudio: true, baseUrl: 'http://localhost:5173', }, component: { + specPattern: 'cypress/component/*', devServer: { framework: 'react', bundler: 'vite', From e2dfc937f9f296e5bdbb5885df4480101fc8e4ef Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 15:51:10 -0500 Subject: [PATCH 27/34] Bumped create-pull-request to v7 --- .github/workflows/updated_examples.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index b178f523..6cf44a9c 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -68,7 +68,7 @@ jobs: - name: Create Pull Request id: create_pr - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v7 with: token: ${{ steps.generate-token.outputs.token }} commit-message: Update `query-tool-results` files From 40a647a5a2b848977bd01a7d1a84641110576ca2 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 16:02:05 -0500 Subject: [PATCH 28/34] Revert download-artifact to v3 thanks codeQL --- .github/workflows/updated_examples.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 6cf44a9c..4ce17eaf 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -55,7 +55,7 @@ jobs: private-key: ${{ secrets.NB_BOT_KEY }} - name: Checkout neurobagel_examples repository - uses: actions/checkout@v4 + uses: actions/checkout@v3 with: repository: neurobagel/neurobagel_examples token: ${{ steps.generate-token.outputs.token }} From 8d2d4a5ab5bfdb879bca7b616d6e94ba3254bdf0 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 16:06:22 -0500 Subject: [PATCH 29/34] Revert download-artifact to v3 thanks codeQL 2nd round --- .github/workflows/updated_examples.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 4ce17eaf..3a5de160 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -55,13 +55,13 @@ jobs: private-key: ${{ secrets.NB_BOT_KEY }} - name: Checkout neurobagel_examples repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: neurobagel/neurobagel_examples token: ${{ steps.generate-token.outputs.token }} - name: Download artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v3 with: name: query-tool-results path: neurobagel_examples/query-tool-results From 09bd896151693a7fa047fcfd5c81ce2859bfcbab Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 16:16:59 -0500 Subject: [PATCH 30/34] Bumped artifact version --- .github/workflows/updated_examples.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 3a5de160..aabef0ee 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -38,7 +38,7 @@ jobs: component: false - name: Upload test artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: query-tool-results path: cypress/downloads/* @@ -61,7 +61,7 @@ jobs: token: ${{ steps.generate-token.outputs.token }} - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: query-tool-results path: neurobagel_examples/query-tool-results From 4e185a9878518ee496023a295d4701e05d54ac3e Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 16:23:26 -0500 Subject: [PATCH 31/34] Try using gh cli --- .github/workflows/updated_examples.yaml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index aabef0ee..d247d819 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -66,14 +66,16 @@ jobs: name: query-tool-results path: neurobagel_examples/query-tool-results + - name: Install GitHub CLI + run: sudo apt-get install gh -y + + - name: Authenticate GitHub CLI + run: echo "${{ steps.generate-token.outputs.token }}" | gh auth login --with-token + - name: Create Pull Request - id: create_pr - uses: peter-evans/create-pull-request@v7 - with: - token: ${{ steps.generate-token.outputs.token }} - commit-message: Update `query-tool-results` files - title: Update `query-tool-results` files - body: "This PR updates the `query-tool-results` files with the latest changes." - base: main - branch: update-query-tool-results - labels: _bot \ No newline at end of file + run: | + git checkout -b update-query-tool-results + git add . + git commit -m "Update query-tool-results files" + git push origin update-query-tool-results + gh pr create --title "Update query-tool-results files" --body "This PR updates the query-tool-results files with the latest changes." --base main --head update-query-tool-results \ No newline at end of file From ccadfd10b9a6d9ae47fa90d7b22a236cc1a12950 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 16:25:53 -0500 Subject: [PATCH 32/34] Set git user --- .github/workflows/updated_examples.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index d247d819..9adfe653 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -74,6 +74,8 @@ jobs: - name: Create Pull Request run: | + git config --global user.name "Neurobagel Bot" + git config --global user.email "neurobagel-bot[bot]@users.noreply.github.com" git checkout -b update-query-tool-results git add . git commit -m "Update query-tool-results files" From c9740142890b71bc3a40e3ae619972d88930893d Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 16:41:26 -0500 Subject: [PATCH 33/34] Set the owner --- .github/workflows/updated_examples.yaml | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 9adfe653..9a98fe29 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -53,6 +53,7 @@ jobs: with: app-id: ${{ vars.NB_BOT_ID }} private-key: ${{ secrets.NB_BOT_KEY }} + owner: ${{ github.repository_owner }} - name: Checkout neurobagel_examples repository uses: actions/checkout@v4 @@ -66,18 +67,14 @@ jobs: name: query-tool-results path: neurobagel_examples/query-tool-results - - name: Install GitHub CLI - run: sudo apt-get install gh -y - - - name: Authenticate GitHub CLI - run: echo "${{ steps.generate-token.outputs.token }}" | gh auth login --with-token - - name: Create Pull Request - run: | - git config --global user.name "Neurobagel Bot" - git config --global user.email "neurobagel-bot[bot]@users.noreply.github.com" - git checkout -b update-query-tool-results - git add . - git commit -m "Update query-tool-results files" - git push origin update-query-tool-results - gh pr create --title "Update query-tool-results files" --body "This PR updates the query-tool-results files with the latest changes." --base main --head update-query-tool-results \ No newline at end of file + id: create_pr + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ steps.generate-token.outputs.token }} + commit-message: Update `query-tool-results` files + title: Update `query-tool-results` files + body: "This PR updates the `query-tool-results` files with the latest changes." + base: main + branch: update-query-tool-results + labels: _bot \ No newline at end of file From f319b21579b1c82891925296d44d4b13a44b7518 Mon Sep 17 00:00:00 2001 From: rmanaem Date: Fri, 10 Jan 2025 17:01:48 -0500 Subject: [PATCH 34/34] Set the committer --- .github/workflows/updated_examples.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/updated_examples.yaml b/.github/workflows/updated_examples.yaml index 9a98fe29..e4144e01 100644 --- a/.github/workflows/updated_examples.yaml +++ b/.github/workflows/updated_examples.yaml @@ -4,10 +4,6 @@ on: pull_request: workflow_dispatch: -permissions: - contents: write - pull-requests: write - jobs: generate-example-files: runs-on: ubuntu-latest @@ -77,4 +73,5 @@ jobs: body: "This PR updates the `query-tool-results` files with the latest changes." base: main branch: update-query-tool-results + committer: NeuroBagel Bot labels: _bot \ No newline at end of file