From 07039c864255768a90c470572e0c391ba17b3498 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Tue, 9 Sep 2025 19:33:10 -0700 Subject: [PATCH 01/25] edit:added my name to README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c2bec0368b7..f5b2091969e 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,4 @@ go build -o notely && ./notely *This starts the server in non-database mode.* It will serve a simple webpage at `http://localhost:8080`. You do *not* need to set up a database or any interactivity on the webpage yet. Instructions for that will come later in the course! +Harsha's version of Boot.dev's Notely app. From bbe4e473e7ceb8a85e2796d16c98f21b0beae967 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Tue, 9 Sep 2025 19:41:16 -0700 Subject: [PATCH 02/25] added CI workflows --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..f48b49e05be --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: ci + +on: + pull_request: + branches: [main] + +jobs: + tests: + name: Tests + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.23.0" + + - name: Force Failure + run: (exit 1) \ No newline at end of file From 2de838842fdad04aee3bd4488c05f4154bbf826d Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Tue, 9 Sep 2025 19:50:08 -0700 Subject: [PATCH 03/25] edit:updated last step to print go version --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f48b49e05be..8aeade5f7b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,5 @@ jobs: with: go-version: "1.23.0" - - name: Force Failure - run: (exit 1) \ No newline at end of file + - name: Print Go Version + run: go version \ No newline at end of file From 6151682f2453696b17c4ff33b21f91b6d3795d0d Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 10:16:08 -0700 Subject: [PATCH 04/25] added testing workflow to fail --- .github/workflows/ci.yml | 4 +-- internal/auth/auth_test.go | 62 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 internal/auth/auth_test.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8aeade5f7b5..5fb053e9d06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,5 @@ jobs: with: go-version: "1.23.0" - - name: Print Go Version - run: go version \ No newline at end of file + - name: Test Api + run: go test ./... \ No newline at end of file diff --git a/internal/auth/auth_test.go b/internal/auth/auth_test.go new file mode 100644 index 00000000000..9995a4adc9d --- /dev/null +++ b/internal/auth/auth_test.go @@ -0,0 +1,62 @@ +package auth + +import ( + "fmt" + "net/http" + "strings" + "testing" +) + +func TestGetAPIKey(t *testing.T) { + tests := []struct { + key string + value string + expect string + expectErr string + }{ + { + expectErr: "no authorization header", + }, + { + key: "Authorization", + expectErr: "malformed authorization header", + }, + { + key: "Authorization", + value: "-", + expectErr: "malformed authorization header", + }, + { + key: "Authorization", + value: "Bearer xxxxxx", + expectErr: "malformed authorization header", + }, + { + key: "Authorization", + value: "ApiKey xxxxxx", + expect: "xxxxxx", + expectErr: "no authorization header", + }, + } + + for i, test := range tests { + t.Run(fmt.Sprintf("TestGetAPIKey Case #%v:", i), func(t *testing.T) { + header := http.Header{} + header.Add(test.key, test.value) + + output, err := GetAPIKey(header) + if err != nil { + if strings.Contains(err.Error(), test.expectErr) { + return + } + t.Errorf("Unexpected: TestGetAPIKey:%v\n", err) + return + } + + if output != test.expect { + t.Errorf("Unexpected: TestGetAPIKey:%s", output) + return + } + }) + } +} From 2b15c8dc5581231a2dc510b30c85e889fc6ca409 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 10:19:36 -0700 Subject: [PATCH 05/25] edit: updated test still to fail --- internal/auth/auth_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/auth/auth_test.go b/internal/auth/auth_test.go index 9995a4adc9d..152380787c5 100644 --- a/internal/auth/auth_test.go +++ b/internal/auth/auth_test.go @@ -19,7 +19,7 @@ func TestGetAPIKey(t *testing.T) { }, { key: "Authorization", - expectErr: "malformed authorization header", + expectErr: "no authorization header", }, { key: "Authorization", From e91e212c29e8ad876095a15723a0200bf264a258 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 10:23:30 -0700 Subject: [PATCH 06/25] edit: workflow fail case updated --- internal/auth/auth_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/auth/auth_test.go b/internal/auth/auth_test.go index 152380787c5..7c614c4071c 100644 --- a/internal/auth/auth_test.go +++ b/internal/auth/auth_test.go @@ -34,8 +34,8 @@ func TestGetAPIKey(t *testing.T) { { key: "Authorization", value: "ApiKey xxxxxx", - expect: "xxxxxx", - expectErr: "no authorization header", + expect: "xxxxx", + expectErr: "not expecting an error", }, } From 1bfc30052ac15cab56a626061b3afffd38e2d05d Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 10:25:48 -0700 Subject: [PATCH 07/25] edit: workflow to pass --- internal/auth/auth_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/auth/auth_test.go b/internal/auth/auth_test.go index 7c614c4071c..5ac1cd99d36 100644 --- a/internal/auth/auth_test.go +++ b/internal/auth/auth_test.go @@ -34,7 +34,7 @@ func TestGetAPIKey(t *testing.T) { { key: "Authorization", value: "ApiKey xxxxxx", - expect: "xxxxx", + expect: "xxxxxx", expectErr: "not expecting an error", }, } From c1357270844d80a0024dd642a36936f20d210af1 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 10:51:40 -0700 Subject: [PATCH 08/25] added cover flag for the api test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5fb053e9d06..dcf9a0226d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,4 @@ jobs: go-version: "1.23.0" - name: Test Api - run: go test ./... \ No newline at end of file + run: go test ./... -cover \ No newline at end of file From ba6e0e3c38443fed0c8f67de9b6e0dd9123211ee Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 10:59:24 -0700 Subject: [PATCH 09/25] added testing badge to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f5b2091969e..7485aa8c43b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +![Testing Badge - Status of Tests][https://github.com/mhv2408/learn-cicd-starter/actions/workflows/ci.yml/badge.svg] # learn-cicd-starter (Notely) This repo contains the starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev). From c3f518bfbd0cd7ab7b5893183f3573c511a43fe4 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 11:01:19 -0700 Subject: [PATCH 10/25] added testing badge to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7485aa8c43b..b64eb36a5fe 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Testing Badge - Status of Tests][https://github.com/mhv2408/learn-cicd-starter/actions/workflows/ci.yml/badge.svg] +![Testing Badge - Status of Tests](https://github.com/mhv2408/learn-cicd-starter/actions/workflows/ci.yml/badge.svg) # learn-cicd-starter (Notely) This repo contains the starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev). From 0a713e699492e0bf769c7d1f9c53307640e7d277 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 11:47:00 -0700 Subject: [PATCH 11/25] added new style format job --- .github/workflows/ci.yml | 17 ++++++++++++++++- main.go | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcf9a0226d3..8fc0fc79018 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,19 @@ jobs: go-version: "1.23.0" - name: Test Api - run: go test ./... -cover \ No newline at end of file + run: go test ./... -cover + + styles: + name: Styles + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.23.0" + + - name : Format the code + run: test -z $(go fmt ./...) diff --git a/main.go b/main.go index 19d7366c5f7..29a4093d258 100644 --- a/main.go +++ b/main.go @@ -17,8 +17,8 @@ import ( _ "github.com/tursodatabase/libsql-client-go/libsql" ) -type apiConfig struct { - DB *database.Queries +type apiConfig struct{ + DB *database.Queries } //go:embed static/* From c20e2ea25860da7b0ca4744591b3452c55e3d305 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 11:52:34 -0700 Subject: [PATCH 12/25] added new formar changes to main --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 29a4093d258..19d7366c5f7 100644 --- a/main.go +++ b/main.go @@ -17,8 +17,8 @@ import ( _ "github.com/tursodatabase/libsql-client-go/libsql" ) -type apiConfig struct{ - DB *database.Queries +type apiConfig struct { + DB *database.Queries } //go:embed static/* From 442fbeb4c54646003d9cc09d749810bbff67d2d5 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 11:57:05 -0700 Subject: [PATCH 13/25] modified styles name to style --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8fc0fc79018..d0a1ab2d55f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,8 @@ jobs: - name: Test Api run: go test ./... -cover - styles: - name: Styles + style: + name: Style runs-on: ubuntu-latest steps: - name: Check out code From 485f0de5083504943f54265ce1d26eb461a30ea9 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 12:56:09 -0700 Subject: [PATCH 14/25] added code to test linting issues --- .github/workflows/ci.yml | 8 +++++++- main.go | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0a1ab2d55f..97170eb1e2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,5 +33,11 @@ jobs: with: go-version: "1.23.0" - - name : Format the code + - name: Install staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@latest + + - name: Check formatting issues run: test -z $(go fmt ./...) + + - name: Check linting issues + run: staticcheck ./... diff --git a/main.go b/main.go index 19d7366c5f7..fab451eae79 100644 --- a/main.go +++ b/main.go @@ -96,3 +96,9 @@ func main() { log.Printf("Serving on port: %s\n", port) log.Fatal(srv.ListenAndServe()) } + +func goNothing(){ + + //this function does nothin + //apart from triggering an error +} \ No newline at end of file From 51ffa6b5b68d5af07239dcf578e38b4616d11851 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 13:02:58 -0700 Subject: [PATCH 15/25] added code to test linting issues --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index fab451eae79..9732fd97ee3 100644 --- a/main.go +++ b/main.go @@ -97,8 +97,8 @@ func main() { log.Fatal(srv.ListenAndServe()) } -func goNothing(){ +func goNothing() { //this function does nothin //apart from triggering an error -} \ No newline at end of file +} From 570584365c7a3f1841b837d7755a9641d173209a Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 13:05:54 -0700 Subject: [PATCH 16/25] removed doNothing functions to resolve linting issues --- main.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/main.go b/main.go index 9732fd97ee3..981c5278857 100644 --- a/main.go +++ b/main.go @@ -97,8 +97,3 @@ func main() { log.Fatal(srv.ListenAndServe()) } -func goNothing() { - - //this function does nothin - //apart from triggering an error -} From 3e1de6532d24927ece2f77a243b29b26c7aaa4c1 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 13:07:51 -0700 Subject: [PATCH 17/25] removed doNothing functions to resolve linting issues --- main.go | 1 - 1 file changed, 1 deletion(-) diff --git a/main.go b/main.go index 981c5278857..19d7366c5f7 100644 --- a/main.go +++ b/main.go @@ -96,4 +96,3 @@ func main() { log.Printf("Serving on port: %s\n", port) log.Fatal(srv.ListenAndServe()) } - From 4770c9f1206d9f4914eb4e6defe3fc7e0880ecb2 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 16:25:43 -0700 Subject: [PATCH 18/25] added gosec checks to CI --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97170eb1e2e..8eedd011406 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,12 @@ jobs: - name: Test Api run: go test ./... -cover + - name: Install gosec + run: go install github.com/securego/gosec/v2/cmd/gosec@latest + + - name: Run gosec + run: gosec ./... + style: name: Style runs-on: ubuntu-latest From 21ff7e35c6d2af5255c77c6313db60a2165538b7 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Wed, 10 Sep 2025 16:45:51 -0700 Subject: [PATCH 19/25] resolved security vulnerabilities thrown by gosec --- json.go | 7 ++++++- main.go | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/json.go b/json.go index 1e6e7985e18..ff9829766a2 100644 --- a/json.go +++ b/json.go @@ -30,5 +30,10 @@ func respondWithJSON(w http.ResponseWriter, code int, payload interface{}) { return } w.WriteHeader(code) - w.Write(dat) + _, err = w.Write(dat) + if err != nil { + log.Printf("Error writing data as response: %s", err) + w.WriteHeader(http.StatusInternalServerError) + return + } } diff --git a/main.go b/main.go index 19d7366c5f7..15ee531c5dc 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( "log" "net/http" "os" + "time" "github.com/go-chi/chi" "github.com/go-chi/cors" @@ -89,8 +90,9 @@ func main() { router.Mount("/v1", v1Router) srv := &http.Server{ - Addr: ":" + port, - Handler: router, + Addr: ":" + port, + Handler: router, + ReadHeaderTimeout: 5 * time.Second, } log.Printf("Serving on port: %s\n", port) From e16642260b7f5671cb45068127fc6a4777657158 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Thu, 11 Sep 2025 19:50:32 -0700 Subject: [PATCH 20/25] added cd pipeline to the code --- .github/workflows/cd.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 00000000000..7eadb73f71d --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,22 @@ +name: cd + +on: + push: + branches: [main] + +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + + steps: + - name: Checkout the code + uses: actions/checkout@v4 + + - name: Setup Go Tool Chain + uses: actions/setup-go@v5 + with: + go-version: "1.23.0" + + - name: Build the app + run: scripts/buildprod.sh \ No newline at end of file From 618356fc312c783431c874465585b81327cdea06 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Thu, 11 Sep 2025 22:57:33 -0700 Subject: [PATCH 21/25] added building the image and pushing it to google artifact registry --- .github/workflows/cd.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 7eadb73f71d..84595fabbec 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -19,4 +19,18 @@ jobs: go-version: "1.23.0" - name: Build the app - run: scripts/buildprod.sh \ No newline at end of file + run: scripts/buildprod.sh + + - id: 'auth' + uses: 'google-github-actions/auth@v2' + with: + credentials_json: '${{ secrets.GCP_CREDENTIALS }}' + + - name: 'Set up Cloud SDK' + uses: 'google-github-actions/setup-gcloud@v3' + + - name: 'Use gcloud CLI' + run: 'gcloud info' + + - name: 'Build the Docker Image and Push to Artifact Registry' + run: 'gcloud builds submit --tag us-central1-docker.pkg.dev/notely-471904/notely-ar-repo/mhv2408/notely:latest .' \ No newline at end of file From 18e3aee1e5c847a6a69210d6a70d0ce7bfb716c7 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Fri, 12 Sep 2025 00:00:32 -0700 Subject: [PATCH 22/25] added new changes to the application --- .github/workflows/cd.yml | 5 ++++- static/index.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 84595fabbec..4dec2f2e0a0 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -33,4 +33,7 @@ jobs: run: 'gcloud info' - name: 'Build the Docker Image and Push to Artifact Registry' - run: 'gcloud builds submit --tag us-central1-docker.pkg.dev/notely-471904/notely-ar-repo/mhv2408/notely:latest .' \ No newline at end of file + run: 'gcloud builds submit --tag us-central1-docker.pkg.dev/notely-471904/notely-ar-repo/mhv2408/notely:latest .' + + - name: Deploy to Cloud Run + run: gcloud run deploy notely --image us-central1-docker.pkg.dev/notely-471904/notely-ar-repo/mhv2408/notely:latest --region us-central1 --allow-unauthenticated --project notely-471904 --max-instances=4 \ No newline at end of file diff --git a/static/index.html b/static/index.html index 72be101028c..5d4ad73c095 100644 --- a/static/index.html +++ b/static/index.html @@ -7,7 +7,7 @@ -

Notely

+

Welcome to Notely

From 046b431dd7f61e005939bb6cc9ec79fb25578164 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Fri, 12 Sep 2025 00:45:48 -0700 Subject: [PATCH 23/25] TURSO DB connection --- .github/workflows/cd.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 4dec2f2e0a0..c4e53401eb1 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -9,6 +9,9 @@ jobs: name: Deploy runs-on: ubuntu-latest + env: + DATABASE_URL: ${{ secrets.DATABASE_URL }} + steps: - name: Checkout the code uses: actions/checkout@v4 @@ -18,6 +21,9 @@ jobs: with: go-version: "1.23.0" + - name: Install goose for to run DB migrations + run: go install github.com/pressly/goose/v3/cmd/goose@latest + - name: Build the app run: scripts/buildprod.sh @@ -34,6 +40,9 @@ jobs: - name: 'Build the Docker Image and Push to Artifact Registry' run: 'gcloud builds submit --tag us-central1-docker.pkg.dev/notely-471904/notely-ar-repo/mhv2408/notely:latest .' + + - name: Run Database Migrations + run: scripts/migrateup.sh - name: Deploy to Cloud Run run: gcloud run deploy notely --image us-central1-docker.pkg.dev/notely-471904/notely-ar-repo/mhv2408/notely:latest --region us-central1 --allow-unauthenticated --project notely-471904 --max-instances=4 \ No newline at end of file From 1337b669eae2ce751876b65a64a4da3a1956f9eb Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Fri, 12 Sep 2025 01:22:23 -0700 Subject: [PATCH 24/25] made some changes to shell scripts --- .github/workflows/cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c4e53401eb1..39caae68f2c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -25,7 +25,7 @@ jobs: run: go install github.com/pressly/goose/v3/cmd/goose@latest - name: Build the app - run: scripts/buildprod.sh + run: ./scripts/buildprod.sh - id: 'auth' uses: 'google-github-actions/auth@v2' @@ -42,7 +42,7 @@ jobs: run: 'gcloud builds submit --tag us-central1-docker.pkg.dev/notely-471904/notely-ar-repo/mhv2408/notely:latest .' - name: Run Database Migrations - run: scripts/migrateup.sh + run: ./scripts/migrateup.sh - name: Deploy to Cloud Run run: gcloud run deploy notely --image us-central1-docker.pkg.dev/notely-471904/notely-ar-repo/mhv2408/notely:latest --region us-central1 --allow-unauthenticated --project notely-471904 --max-instances=4 \ No newline at end of file From fa8b85f84ece6de4aeeef4d913df22fed8ff4a12 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Mirthinti Date: Thu, 4 Dec 2025 18:07:39 -0700 Subject: [PATCH 25/25] ci/cd demo --- json.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json.go b/json.go index ff9829766a2..60d8c2803d9 100644 --- a/json.go +++ b/json.go @@ -32,7 +32,7 @@ func respondWithJSON(w http.ResponseWriter, code int, payload interface{}) { w.WriteHeader(code) _, err = w.Write(dat) if err != nil { - log.Printf("Error writing data as response: %s", err) + log.Printf("Error writing data for response: %s", err) w.WriteHeader(http.StatusInternalServerError) return }