From 23b61f041a0172854fc3c45af59eaa2b7a314f50 Mon Sep 17 00:00:00 2001 From: Andreas Klos Date: Fri, 31 Jan 2025 18:04:49 +0100 Subject: [PATCH 01/13] chore: rename lint and test workflow and add submodule update job --- .github/workflows/lint-and-test.yml | 39 +++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index d5a4fd4..3a76632 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -1,4 +1,4 @@ -name: Lint and test workflow +name: lint-and-test on: pull_request: @@ -7,12 +7,12 @@ on: workflow_dispatch: jobs: - SanitizeBranchName: + sanitize-branch-name: runs-on: ubuntu-latest outputs: sanitized_ref: ${{ steps.sanitize.outputs.sanitized_ref }} steps: - - name: Sanitize Branch Name + - name: sanitize-branch-name id: sanitize run: | SANITIZED_REF=$(echo "${GITHUB_HEAD_REF}" | tr '[:upper:]' '[:lower:]' | tr -c 'a-z0-9' '-') @@ -27,10 +27,38 @@ jobs: env: GITHUB_HEAD_REF: ${{ github.head_ref }} + update-submodules: + name: update-submodules + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.ref }} + submodules: false + + - name: update-submodules + id: update-submodules + run: | + git config --global url."https://github.com/".insteadOf "git@github.com:" + git submodule sync --recursive + git submodule update --init --remote --recursive + + if [ -n "$(git status --porcelain)" ]; then + echo "Submodules have new commits. Committing and pushing..." + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git commit -am "chore: update submodules to latest main" + git push + else + echo "No submodule changes." + fi + # TODO: check if checkout make a checkout of the latest commit of the PR BuildAndLint: name: Build and Lint runs-on: ubuntu-latest - needs: [SanitizeBranchName] + needs: [sanitize-branch-name, update-submodules] strategy: fail-fast: true matrix: @@ -41,7 +69,8 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} repository: stackitcloud/rag-template - submodules: 'true' + submodules: false + - name: Set Docker Image Name run: | echo "IMAGE_NAME=${{ matrix.service }}:${{ needs.SanitizeBranchName.outputs.sanitized_ref }}-${{ github.run_number }}" >> $GITHUB_ENV From 5be859bbd4be8be07bc8da5fd144248db2a2b4d6 Mon Sep 17 00:00:00 2001 From: Andreas Klos Date: Tue, 4 Feb 2025 14:31:43 +0100 Subject: [PATCH 02/13] chore: add logging for sanitized branch name in lint-and-test workflow --- .github/workflows/lint-and-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 3a76632..c7d1e01 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -23,6 +23,7 @@ jobs: SANITIZED_REF="tmp-branch" fi echo "::set-output name=sanitized_ref::${SANITIZED_REF}" + echo "Sanitized branch name: $SANITIZED_REF" shell: bash env: GITHUB_HEAD_REF: ${{ github.head_ref }} From 671123a4bb4204ca35e1eec6b34aed8b36a8ffd4 Mon Sep 17 00:00:00 2001 From: Andreas Klos Date: Tue, 4 Feb 2025 14:32:39 +0100 Subject: [PATCH 03/13] chore: fix typo in lint-and-test workflow for sanitized branch name --- .github/workflows/lint-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index c7d1e01..f000f9c 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -74,7 +74,7 @@ jobs: - name: Set Docker Image Name run: | - echo "IMAGE_NAME=${{ matrix.service }}:${{ needs.SanitizeBranchName.outputs.sanitized_ref }}-${{ github.run_number }}" >> $GITHUB_ENV + echo "IMAGE_NAME=${{ matrix.service }}:${{ needs.sanitize-branch-name.outputs.sanitized_ref }}-${{ github.run_number }}" >> $GITHUB_ENV shell: bash - name: Build lint image From 03f376987d4d2a18ff952a5461debdde9ae05f64 Mon Sep 17 00:00:00 2001 From: Andreas Klos Date: Tue, 4 Feb 2025 14:35:56 +0100 Subject: [PATCH 04/13] chore: enable submodules in lint-and-test workflow and remove debug logging --- .github/workflows/lint-and-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index f000f9c..aa461b3 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -23,7 +23,6 @@ jobs: SANITIZED_REF="tmp-branch" fi echo "::set-output name=sanitized_ref::${SANITIZED_REF}" - echo "Sanitized branch name: $SANITIZED_REF" shell: bash env: GITHUB_HEAD_REF: ${{ github.head_ref }} @@ -70,7 +69,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} repository: stackitcloud/rag-template - submodules: false + submodules: true - name: Set Docker Image Name run: | From 4d0130598d87f64c6ca8e39280e410542660284c Mon Sep 17 00:00:00 2001 From: Andreas Klos Date: Tue, 4 Feb 2025 14:37:59 +0100 Subject: [PATCH 05/13] chore: add submodule commit check in lint-and-test workflow --- .github/workflows/lint-and-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index aa461b3..3b41a29 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -70,6 +70,10 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} repository: stackitcloud/rag-template submodules: true + - name: Check submodules commit + run: | + echo "Checked out submodules commit(s):" + git submodule status --recursive - name: Set Docker Image Name run: | From e306794f72380dcfd4762eff90fa44f6444f7568 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 4 Feb 2025 14:25:47 +0000 Subject: [PATCH 06/13] chore: update submodules to latest main --- rag-core-library | 2 +- rag-infrastructure | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rag-core-library b/rag-core-library index 3f1408a..28353d3 160000 --- a/rag-core-library +++ b/rag-core-library @@ -1 +1 @@ -Subproject commit 3f1408a6dfee24aecfe21e6cef74f147b0925b2c +Subproject commit 28353d375b9b59e92b47c9f074555da7b40af69c diff --git a/rag-infrastructure b/rag-infrastructure index 6068413..0247f68 160000 --- a/rag-infrastructure +++ b/rag-infrastructure @@ -1 +1 @@ -Subproject commit 60684130e179358d74aae16dd5859bcd155099ef +Subproject commit 0247f683bb28dd97dc6f214a7964887577bcb2e8 From 17df913cee0c4b5ec8373e12a0d504051bde80ad Mon Sep 17 00:00:00 2001 From: Andreas Klos Date: Tue, 4 Feb 2025 15:29:23 +0100 Subject: [PATCH 07/13] chore: update submodule checkout to use the current commit SHA --- .github/workflows/lint-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 3b41a29..710fa4a 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -68,7 +68,7 @@ jobs: uses: actions/checkout@v4 with: token: ${{ secrets.GITHUB_TOKEN }} - repository: stackitcloud/rag-template + ref: ${{ github.sha }} submodules: true - name: Check submodules commit run: | From f564d0952ffae7926c06c36f605df0a64d9be6fd Mon Sep 17 00:00:00 2001 From: Andreas Klos Date: Tue, 4 Feb 2025 15:30:09 +0100 Subject: [PATCH 08/13] chore: update submodule commits for rag-core-library and rag-infrastructure --- rag-core-library | 2 +- rag-infrastructure | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rag-core-library b/rag-core-library index 28353d3..3f1408a 160000 --- a/rag-core-library +++ b/rag-core-library @@ -1 +1 @@ -Subproject commit 28353d375b9b59e92b47c9f074555da7b40af69c +Subproject commit 3f1408a6dfee24aecfe21e6cef74f147b0925b2c diff --git a/rag-infrastructure b/rag-infrastructure index 0247f68..6068413 160000 --- a/rag-infrastructure +++ b/rag-infrastructure @@ -1 +1 @@ -Subproject commit 0247f683bb28dd97dc6f214a7964887577bcb2e8 +Subproject commit 60684130e179358d74aae16dd5859bcd155099ef From bd8f9a35d8afee3d4ff3bc6424992ddbc7d93b83 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 4 Feb 2025 14:30:25 +0000 Subject: [PATCH 09/13] chore: update submodules to latest main --- rag-core-library | 2 +- rag-infrastructure | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rag-core-library b/rag-core-library index 3f1408a..28353d3 160000 --- a/rag-core-library +++ b/rag-core-library @@ -1 +1 @@ -Subproject commit 3f1408a6dfee24aecfe21e6cef74f147b0925b2c +Subproject commit 28353d375b9b59e92b47c9f074555da7b40af69c diff --git a/rag-infrastructure b/rag-infrastructure index 6068413..0247f68 160000 --- a/rag-infrastructure +++ b/rag-infrastructure @@ -1 +1 @@ -Subproject commit 60684130e179358d74aae16dd5859bcd155099ef +Subproject commit 0247f683bb28dd97dc6f214a7964887577bcb2e8 From 474813aedd78aacc077dccd9a05ec707ccc85cf3 Mon Sep 17 00:00:00 2001 From: Andreas Klos Date: Tue, 4 Feb 2025 15:32:39 +0100 Subject: [PATCH 10/13] chore: rename BuildAndLint job to build-and-lint in lint-and-test workflow --- .github/workflows/lint-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 710fa4a..1d671c3 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -55,7 +55,7 @@ jobs: echo "No submodule changes." fi # TODO: check if checkout make a checkout of the latest commit of the PR - BuildAndLint: + build-and-lint: name: Build and Lint runs-on: ubuntu-latest needs: [sanitize-branch-name, update-submodules] From 1d50403c892b06c678e0313bdc6dcddbbfbd4184 Mon Sep 17 00:00:00 2001 From: Andreas Klos Date: Tue, 4 Feb 2025 15:52:39 +0100 Subject: [PATCH 11/13] chore: update checkout ref in lint-and-test workflow and update submodule commit for rag-infrastructure --- .github/workflows/lint-and-test.yml | 3 +-- rag-infrastructure | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 1d671c3..235972e 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -67,8 +67,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} - ref: ${{ github.sha }} + ref: ${{ github.event.pull_request.head.ref }} submodules: true - name: Check submodules commit run: | diff --git a/rag-infrastructure b/rag-infrastructure index 0247f68..6068413 160000 --- a/rag-infrastructure +++ b/rag-infrastructure @@ -1 +1 @@ -Subproject commit 0247f683bb28dd97dc6f214a7964887577bcb2e8 +Subproject commit 60684130e179358d74aae16dd5859bcd155099ef From 89d751da66482bba2428c9b71355aced7faa65dc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 4 Feb 2025 14:52:56 +0000 Subject: [PATCH 12/13] chore: update submodules to latest main --- rag-infrastructure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag-infrastructure b/rag-infrastructure index 6068413..0247f68 160000 --- a/rag-infrastructure +++ b/rag-infrastructure @@ -1 +1 @@ -Subproject commit 60684130e179358d74aae16dd5859bcd155099ef +Subproject commit 0247f683bb28dd97dc6f214a7964887577bcb2e8 From 3051317e8b68cd27b037b1fb833cc5a29f82c68c Mon Sep 17 00:00:00 2001 From: Andreas Klos Date: Tue, 4 Feb 2025 15:54:49 +0100 Subject: [PATCH 13/13] chore: clean up lint-and-test workflow by removing unused submodule check --- .github/workflows/lint-and-test.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 235972e..71fabf8 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -54,7 +54,7 @@ jobs: else echo "No submodule changes." fi - # TODO: check if checkout make a checkout of the latest commit of the PR + build-and-lint: name: Build and Lint runs-on: ubuntu-latest @@ -69,10 +69,6 @@ jobs: with: ref: ${{ github.event.pull_request.head.ref }} submodules: true - - name: Check submodules commit - run: | - echo "Checked out submodules commit(s):" - git submodule status --recursive - name: Set Docker Image Name run: |