From a2661fe9ed50bed1781925d4be950a0c7db8399a Mon Sep 17 00:00:00 2001 From: oatman Date: Tue, 21 Apr 2026 12:17:11 +0100 Subject: [PATCH 01/12] docs: add project description to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c2bec0368b7..81dbed1a294 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,5 @@ 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! + +" oatman's version of Boot.dev's Notely app. " \ No newline at end of file From ae911db28620b87c6bd785b6c3650af70f99d848 Mon Sep 17 00:00:00 2001 From: oatman Date: Wed, 22 Apr 2026 12:04:09 +0100 Subject: [PATCH 02/12] feat: add CI workflow with initial test step --- .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..be74c5778f7 --- /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.26.0" + + - name: Force Failure + run: (exit 1) \ No newline at end of file From 90155f9f311da7d687a30d1cd8fc563744b7cefc Mon Sep 17 00:00:00 2001 From: oatman Date: Wed, 22 Apr 2026 12:14:45 +0100 Subject: [PATCH 03/12] chore: replace manual failure step with Go version verification in CI workflow --- .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 be74c5778f7..8162a5bd5d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,5 @@ jobs: with: go-version: "1.26.0" - - name: Force Failure - run: (exit 1) \ No newline at end of file + - name: Go version check + run: go version \ No newline at end of file From 1a9d60656592bf54a083eb501fde8e9ad5e1dc3d Mon Sep 17 00:00:00 2001 From: oatman Date: Wed, 22 Apr 2026 13:10:41 +0100 Subject: [PATCH 04/12] brocken code --- .github/workflows/ci.yml | 2 +- internal/auth/auth.go | 2 +- internal/auth/get_api_key_test.go | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 internal/auth/get_api_key_test.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8162a5bd5d4..5221b6ff69e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,4 @@ jobs: go-version: "1.26.0" - name: Go version check - run: go version \ No newline at end of file + run: go test ./... \ No newline at end of file diff --git a/internal/auth/auth.go b/internal/auth/auth.go index f969aacf638..10ba2dd221b 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -10,7 +10,7 @@ var ErrNoAuthHeaderIncluded = errors.New("no authorization header included") // GetAPIKey - func GetAPIKey(headers http.Header) (string, error) { - authHeader := headers.Get("Authorization") + //authHeader := headers.Get("Authorization") if authHeader == "" { return "", ErrNoAuthHeaderIncluded } diff --git a/internal/auth/get_api_key_test.go b/internal/auth/get_api_key_test.go new file mode 100644 index 00000000000..ac035d9b476 --- /dev/null +++ b/internal/auth/get_api_key_test.go @@ -0,0 +1,19 @@ +package auth + +import ( + "net/http" + "testing" +) + +func TestGetAPIKey(t *testing.T) { + headers := http.Header{ + "Authorization": {"ApiKey 1234567890"}, + } + apiKey, err := GetAPIKey(headers) + if err != nil { + t.Errorf("error should be nil, got %v", err) + } + if apiKey != "1234567890" { + t.Errorf("API key should be 1234567890, got %v", apiKey) + } +} From 01bcb3365a3a83f2e331fbbe229a530fa53c07b1 Mon Sep 17 00:00:00 2001 From: oatman Date: Wed, 22 Apr 2026 13:12:53 +0100 Subject: [PATCH 05/12] fixed --- internal/auth/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/auth/auth.go b/internal/auth/auth.go index 10ba2dd221b..f969aacf638 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -10,7 +10,7 @@ var ErrNoAuthHeaderIncluded = errors.New("no authorization header included") // GetAPIKey - func GetAPIKey(headers http.Header) (string, error) { - //authHeader := headers.Get("Authorization") + authHeader := headers.Get("Authorization") if authHeader == "" { return "", ErrNoAuthHeaderIncluded } From 269909b4785d15130df56cd108927a8daec9c778 Mon Sep 17 00:00:00 2001 From: oatman Date: Wed, 22 Apr 2026 13:18:39 +0100 Subject: [PATCH 06/12] -cover --- .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 5221b6ff69e..3b68e176b86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,4 @@ jobs: go-version: "1.26.0" - name: Go version check - run: go test ./... \ No newline at end of file + run: go test ./... -cover \ No newline at end of file From de7162ec63a876c2bcec6dc50e8b9f9567de82e4 Mon Sep 17 00:00:00 2001 From: oatman Date: Wed, 22 Apr 2026 13:26:59 +0100 Subject: [PATCH 07/12] README Badge for Tests --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 81dbed1a294..e70c449f7ae 100644 --- a/README.md +++ b/README.md @@ -22,4 +22,13 @@ go build -o notely && ./notely 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! -" oatman's version of Boot.dev's Notely app. " \ No newline at end of file +" oatman's version of Boot.dev's Notely app. " +--- + +# Code Coverage + +![alt text goes here](https://github.com/oatmanelfarji/cicd-starter/actions/workflows/ci.yml/badge.svg) + +## License + +"This code is provided for educational purposes only, as part of the [Learn CICD](https://boot.dev/courses/learn-cicd) course on [Boot.dev](https://boot.dev)." \ No newline at end of file From a72b124daca9b6984574d864b9f530099b12da28 Mon Sep 17 00:00:00 2001 From: oatman Date: Wed, 22 Apr 2026 22:51:10 +0100 Subject: [PATCH 08/12] ci: add style check job to run go fmt in CI workflow --- .github/workflows/ci.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b68e176b86..022f15e87c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,19 @@ jobs: go-version: "1.26.0" - name: Go version check - run: go test ./... -cover \ No newline at end of file + run: go test ./... -cover + + style: + name: Style + 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.26.0" + + - name: Style + run: go fmt ./... \ No newline at end of file From 83cf372c7bac6dfec748a122ac050dcd86e6d727 Mon Sep 17 00:00:00 2001 From: oatman Date: Wed, 22 Apr 2026 22:59:09 +0100 Subject: [PATCH 09/12] ci: update style check to fail on unformatted code --- .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 022f15e87c6..7739e645cee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,4 +34,4 @@ jobs: go-version: "1.26.0" - name: Style - run: go fmt ./... \ No newline at end of file + run: test -z $(go fmt ./...) \ No newline at end of file From 353df479465f3e43d94427f31ac6ada2199d9b58 Mon Sep 17 00:00:00 2001 From: oatman Date: Fri, 24 Apr 2026 21:43:35 +0100 Subject: [PATCH 10/12] docs: add YOLO section to README regarding PR review bypass --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e70c449f7ae..4e20408c09c 100644 --- a/README.md +++ b/README.md @@ -31,4 +31,8 @@ You do *not* need to set up a database or any interactivity on the webpage yet. ## License -"This code is provided for educational purposes only, as part of the [Learn CICD](https://boot.dev/courses/learn-cicd) course on [Boot.dev](https://boot.dev)." \ No newline at end of file +"This code is provided for educational purposes only, as part of the [Learn CICD](https://boot.dev/courses/learn-cicd) course on [Boot.dev](https://boot.dev)." + +# YOLO + +Goal: Merge a PR without review \ No newline at end of file From 33c88709b034af655b556f6300e380017182a422 Mon Sep 17 00:00:00 2001 From: oatman Date: Fri, 24 Apr 2026 21:45:51 +0100 Subject: [PATCH 11/12] Merge a PR --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e20408c09c..9676869cf6d 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,4 @@ You do *not* need to set up a database or any interactivity on the webpage yet. # YOLO -Goal: Merge a PR without review \ No newline at end of file +Merge a PR without review \ No newline at end of file From ec024ab0ca95cb2cf89a14e4f7dcea187c69fdfd Mon Sep 17 00:00:00 2001 From: oatman Date: Fri, 24 Apr 2026 22:07:39 +0100 Subject: [PATCH 12/12] review --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9676869cf6d..da556409d96 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,4 @@ You do *not* need to set up a database or any interactivity on the webpage yet. # YOLO -Merge a PR without review \ No newline at end of file +Merge a PR without review... \ No newline at end of file