From f797533509acc3343a2b387641ccbdfd370aa10d Mon Sep 17 00:00:00 2001 From: Yuriy Tsemashko Date: Thu, 25 Jun 2026 15:26:05 +0300 Subject: [PATCH 1/4] Setup github workflows --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 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 0000000..7817335 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI + +on: + pull_request: + push: + branches: + - master + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + cache-dependency-path: go.mod + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v8 + with: + version: v2.12.2 + + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + cache-dependency-path: go.mod + + - name: Run unit tests + run: go test ./... From 6e8abadcb4bf1f7e6aa60ee83b55d4eca5092378 Mon Sep 17 00:00:00 2001 From: Yuriy Tsemashko Date: Thu, 25 Jun 2026 15:31:30 +0300 Subject: [PATCH 2/4] Support annotations --- .github/workflows/ci.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7817335..f44b69b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,15 @@ concurrency: group: ci-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: + contents: read + jobs: lint: runs-on: ubuntu-latest + permissions: + contents: read + checks: write steps: - name: Checkout uses: actions/checkout@v4 @@ -28,6 +34,7 @@ jobs: uses: golangci/golangci-lint-action@v8 with: version: v2.12.2 + problem-matchers: true test: runs-on: ubuntu-latest @@ -43,4 +50,21 @@ jobs: cache-dependency-path: go.mod - name: Run unit tests - run: go test ./... + shell: bash + run: | + set -o pipefail + + output_file="$(mktemp)" + go test ./... 2>&1 | tee "$output_file" + status=${PIPESTATUS[0]} + + while IFS= read -r line; do + if [[ "$line" =~ ^([^:[:space:]]+\.go):([0-9]+):[[:space:]](.*)$ ]]; then + file="${BASH_REMATCH[1]}" + line_no="${BASH_REMATCH[2]}" + message="${BASH_REMATCH[3]}" + echo "::error file=${file},line=${line_no}::${message}" + fi + done < "$output_file" + + exit "$status" From fe93835581357e95d62126a447492c84000b5b08 Mon Sep 17 00:00:00 2001 From: Yuriy Tsemashko Date: Thu, 25 Jun 2026 15:31:54 +0300 Subject: [PATCH 3/4] make linter error --- engine/types/value.go | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/types/value.go b/engine/types/value.go index 3b73850..50a4853 100644 --- a/engine/types/value.go +++ b/engine/types/value.go @@ -49,6 +49,7 @@ func (v Value) IsBool() bool { } func NewStringValue(s string) Value { + return Value{ Kind: KindString, S: s, From 0e6949df9c9a55f0873d82e183ea84e8d6f45225 Mon Sep 17 00:00:00 2001 From: Yuriy Tsemashko Date: Thu, 25 Jun 2026 15:35:10 +0300 Subject: [PATCH 4/4] fix --- .github/workflows/ci.yml | 19 +------------------ engine/storage/jsonl/decoder.go | 6 +++--- engine/types/error.go | 10 ---------- engine/types/value.go | 1 - 4 files changed, 4 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f44b69b..c42bb87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,21 +50,4 @@ jobs: cache-dependency-path: go.mod - name: Run unit tests - shell: bash - run: | - set -o pipefail - - output_file="$(mktemp)" - go test ./... 2>&1 | tee "$output_file" - status=${PIPESTATUS[0]} - - while IFS= read -r line; do - if [[ "$line" =~ ^([^:[:space:]]+\.go):([0-9]+):[[:space:]](.*)$ ]]; then - file="${BASH_REMATCH[1]}" - line_no="${BASH_REMATCH[2]}" - message="${BASH_REMATCH[3]}" - echo "::error file=${file},line=${line_no}::${message}" - fi - done < "$output_file" - - exit "$status" + run: go test ./... diff --git a/engine/storage/jsonl/decoder.go b/engine/storage/jsonl/decoder.go index fb6c102..0cd118b 100644 --- a/engine/storage/jsonl/decoder.go +++ b/engine/storage/jsonl/decoder.go @@ -133,9 +133,9 @@ func (d *Decoder) decodeValue(name string, kind types.Kind, raw any) (types.Valu } case types.KindTimestamp: - return types.NewNullValue(), &types.TypeNotImplementedError{ - Field: name, - Kind: kind, + return types.NewNullValue(), &types.TypeError{ + Field: name, + Expected: kind, } default: diff --git a/engine/types/error.go b/engine/types/error.go index c9c5590..26f2ca1 100644 --- a/engine/types/error.go +++ b/engine/types/error.go @@ -14,13 +14,3 @@ func (e *TypeError) Error() string { return "type error: field " + e.Field + " expected " + string(e.Expected) + " but got " + string(e.Actual) } - -// TypeNotImplementedError represents an error that occurs when a value's type is not implemented in the system. -type TypeNotImplementedError struct { - Field string // The name of the field that caused the error - Kind Kind // The kind of the field that is not implemented -} - -func (e *TypeNotImplementedError) Error() string { - return "type not implemented error: field " + e.Field + " of kind " + string(e.Kind) + " is not implemented" -} diff --git a/engine/types/value.go b/engine/types/value.go index 50a4853..3b73850 100644 --- a/engine/types/value.go +++ b/engine/types/value.go @@ -49,7 +49,6 @@ func (v Value) IsBool() bool { } func NewStringValue(s string) Value { - return Value{ Kind: KindString, S: s,