From 043e9e2ae0a749920c4a981c283d478ad5322dcd Mon Sep 17 00:00:00 2001 From: Harsh Pratp Tiwari <2022pceitharsh020@poornima.org> Date: Sun, 12 Oct 2025 17:38:27 +0530 Subject: [PATCH 1/8] chore: verify github actions --- .github/workflows/ci.yaml | 4 ++-- src/product-catalog/main.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 37a13a8f08..20ee88cc78 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,7 +41,7 @@ jobs: - name: Setup Go 1.22 uses: actions/setup-go@v2 with: - go-version: 1.22 + go-version: 1.22 - name: Run golangci-lint uses: golangci/golangci-lint-action@v6 @@ -90,7 +90,7 @@ jobs: - name: Update tag in kubernetes deployment manifest run: | - sed -i "s|image: .*|image: ${{ secrets.DOCKER_USERNAME }}/product-catalog:${{github.run_id}}|" kubernetes/productcatalog/deploy.yaml + sed -i "s|image: .*|image: ${{ secrets.DOCKER_USERNAME }}/product-catalog:${{github.run_id}}|" kubernetes/productcatalog/deploy.yaml - name: Commit and push changes run: | diff --git a/src/product-catalog/main.go b/src/product-catalog/main.go index f62c3c0d94..fcedad366d 100644 --- a/src/product-catalog/main.go +++ b/src/product-catalog/main.go @@ -320,3 +320,4 @@ func createClient(ctx context.Context, svcAddr string) (*grpc.ClientConn, error) + From 416deec7ab9d7cc22f0f576dbfeb0a774a6e1c63 Mon Sep 17 00:00:00 2001 From: Harsh Pratp Tiwari <2022pceitharsh020@poornima.org> Date: Sun, 12 Oct 2025 17:57:06 +0530 Subject: [PATCH 2/8] chore: verify github actions-v2 --- .github/workflows/ci.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 20ee88cc78..81bfe6cbb5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -99,10 +99,3 @@ jobs: git add kubernetes/productcatalog/deploy.yaml git commit -m "[CI]: Update product catalog image tag" git push origin HEAD:main -f - - - - - - - From 495470ad466e57be523918f2e5d80df44cf501e0 Mon Sep 17 00:00:00 2001 From: Harsh Pratp Tiwari <2022pceitharsh020@poornima.org> Date: Sun, 12 Oct 2025 18:25:02 +0530 Subject: [PATCH 3/8] chore: verify github actions-v3 --- src/product-catalog/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/product-catalog/main.go b/src/product-catalog/main.go index fcedad366d..9635ef68aa 100644 --- a/src/product-catalog/main.go +++ b/src/product-catalog/main.go @@ -321,3 +321,9 @@ func createClient(ctx context.Context, svcAddr string) (*grpc.ClientConn, error) + + + + + + From 5b2b96074b147a03f0b2999e9a30b94ba54fb170 Mon Sep 17 00:00:00 2001 From: Harsh Pratp Tiwari <2022pceitharsh020@poornima.org> Date: Sun, 12 Oct 2025 18:33:51 +0530 Subject: [PATCH 4/8] chore: verify github actions-v4 --- .github/workflows/ci.yaml | 5 +++++ src/product-catalog/main.go | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 81bfe6cbb5..88ce099ac8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -99,3 +99,8 @@ jobs: git add kubernetes/productcatalog/deploy.yaml git commit -m "[CI]: Update product catalog image tag" git push origin HEAD:main -f + + + + + \ No newline at end of file diff --git a/src/product-catalog/main.go b/src/product-catalog/main.go index 9635ef68aa..dc48cec9ca 100644 --- a/src/product-catalog/main.go +++ b/src/product-catalog/main.go @@ -324,6 +324,23 @@ func createClient(ctx context.Context, svcAddr string) (*grpc.ClientConn, error) + + + + + + + + + + + + + + + + + From d09dbf33884d03c8f66f9f0fe2ec4fb2ece83885 Mon Sep 17 00:00:00 2001 From: Harsh Pratp Tiwari <2022pceitharsh020@poornima.org> Date: Sun, 12 Oct 2025 18:46:36 +0530 Subject: [PATCH 5/8] chore: verify github action part 3.v1 --- .github/workflows/ci.yaml | 190 ++++++++++++++++++-------------------- 1 file changed, 88 insertions(+), 102 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 88ce099ac8..73f55d174c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,106 +1,92 @@ -# CI for Product Catalog Service - name: product-catalog-ci -on: - pull_request: - branches: - - main +on: + pull_request: + branches: + - main jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: checkout code - uses: actions/checkout@v4 - - - name: Setup Go 1.22 - uses: actions/setup-go@v2 - with: - go-version: 1.22 - - - name: Build - run: | - cd src/product-catalog - go mod download - go build -o product-catalog-service main.go - - - name: unit tests - run: | - cd src/product-catalog - go test ./... - - code-quality: - runs-on: ubuntu-latest - - steps: - - name: checkout code - uses: actions/checkout@v4 - - - name: Setup Go 1.22 - uses: actions/setup-go@v2 - with: - go-version: 1.22 - - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v6 - with: - version: v1.55.2 - run: golangci-lint run - working-directory: src/product-catalog - - docker: - runs-on: ubuntu-latest - - needs: build - - steps: - - name: checkout code - uses: actions/checkout@v4 - - - name: Install Docker - uses: docker/setup-buildx-action@v1 - - - name: Login to Docker - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - - name: Docker Push - uses: docker/build-push-action@v6 - with: - context: src/product-catalog - file: src/product-catalog/Dockerfile - push: true - tags: ${{ secrets.DOCKER_USERNAME }}/product-catalog:${{github.run_id}} - - - updatek8s: - runs-on: ubuntu-latest - - needs: docker - - steps: - - name: checkout code - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Update tag in kubernetes deployment manifest - run: | - sed -i "s|image: .*|image: ${{ secrets.DOCKER_USERNAME }}/product-catalog:${{github.run_id}}|" kubernetes/productcatalog/deploy.yaml - - - name: Commit and push changes - run: | - git config --global user.email "estharsh@gmail.com" - git config --global user.name "Harsh Pratap" - git add kubernetes/productcatalog/deploy.yaml - git commit -m "[CI]: Update product catalog image tag" - git push origin HEAD:main -f - - - - - \ No newline at end of file + build: + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v4 + + - name: Setup Go 1.22 + uses: actions/setup-go@v5 # Using a more recent version + with: + go-version: '1.22' + + - name: Build + run: | + cd src/product-catalog + go mod download + go build -o product-catalog-service main.go + + - name: unit tests + run: | + cd src/product-catalog + go test ./... + + code-quality: + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v4 + + - name: Setup Go 1.22 + uses: actions/setup-go@v5 # Using a more recent version + with: + go-version: '1.22' + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.55.2 + # 'run:' is not a valid parameter for this action, the command runs by default + working-directory: src/product-catalog + + docker: + runs-on: ubuntu-latest + needs: build + steps: + - name: checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 # Using a more recent version + + - name: Login to Docker + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Docker Push + uses: docker/build-push-action@v6 + with: + context: src/product-catalog + file: src/product-catalog/Dockerfile + push: true + tags: ${{ secrets.DOCKER_USERNAME }}/product-catalog:${{ github.run_id }} + + updatek8s: + runs-on: ubuntu-latest + needs: docker + steps: + - name: checkout code + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Update tag in kubernetes deployment manifest + run: | + sed -i "s|image: .*|image: ${{ secrets.DOCKER_USERNAME }}/product-catalog:${{ github.run_id }}|" kubernetes/productcatalog/deploy.yaml + + - name: Commit and push changes + run: | + git config --global user.email "estharsh@gmail.com" + git config --global user.name "Harsh Pratap" + git add kubernetes/productcatalog/deploy.yaml + git commit -m "[CI]: Update product catalog image tag" + git push origin HEAD:main -f \ No newline at end of file From 9c2c6da004ae5a7b30c6495ebe1b6b89b0b61d1c Mon Sep 17 00:00:00 2001 From: Harsh Pratp Tiwari <2022pceitharsh020@poornima.org> Date: Sun, 12 Oct 2025 18:49:45 +0530 Subject: [PATCH 6/8] chore: verify github action part 3.v2 --- .github/workflows/ci.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 73f55d174c..79f09bfd26 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -89,4 +89,10 @@ jobs: git config --global user.name "Harsh Pratap" git add kubernetes/productcatalog/deploy.yaml git commit -m "[CI]: Update product catalog image tag" - git push origin HEAD:main -f \ No newline at end of file + git push origin HEAD:main -f + + + + + + \ No newline at end of file From cc66de5ccab7a5de3ec6020889f4b225f100cbb3 Mon Sep 17 00:00:00 2001 From: Harsh Pratp Tiwari <2022pceitharsh020@poornima.org> Date: Sun, 12 Oct 2025 18:58:04 +0530 Subject: [PATCH 7/8] chore: verify github action part 3.v2 --- .github/workflows/ci.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 79f09bfd26..5a581a3210 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -83,16 +83,13 @@ jobs: run: | sed -i "s|image: .*|image: ${{ secrets.DOCKER_USERNAME }}/product-catalog:${{ github.run_id }}|" kubernetes/productcatalog/deploy.yaml + + + - name: Commit and push changes run: | git config --global user.email "estharsh@gmail.com" git config --global user.name "Harsh Pratap" git add kubernetes/productcatalog/deploy.yaml git commit -m "[CI]: Update product catalog image tag" - git push origin HEAD:main -f - - - - - - \ No newline at end of file + git push origin HEAD:main -f \ No newline at end of file From 2e25fee8c94f4d1283739b7488a23c05f7bc1d1c Mon Sep 17 00:00:00 2001 From: Harsh Pratp Tiwari <2022pceitharsh020@poornima.org> Date: Mon, 13 Oct 2025 20:31:25 +0530 Subject: [PATCH 8/8] chore: verify github action part 3.v3 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5a581a3210..d0d6fde125 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: product-catalog-ci +# est-harshname: product-catalog-ci on: pull_request: