Compare commits
95 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ab263ad2be | |||
| e53a54e58c | |||
| 018444c022 | |||
| 4a4fe3d5c8 | |||
|
65aba3a47c
|
|||
| e565f7b147 | |||
|
44464c0a85
|
|||
| 45c18ccef6 | |||
| 61f079354d | |||
| b19d1fa250 | |||
| 0f1ee07348 | |||
| 773cf10d05 | |||
| 038ef213bb | |||
| c35239b385 | |||
|
7644c6793e
|
|||
| cba9bb814d | |||
| e998aa8599 | |||
| a8a7fae14b | |||
| d092bb4158 | |||
| e7733a069d | |||
| 90518df4be | |||
| d007daed7a | |||
| a4eb50c45a | |||
| b309cf5fc7 | |||
| 824e3703a9 | |||
| aab014650e | |||
| 51dc2e8605 | |||
| b0d63489ea | |||
| 621e039ccf | |||
| 1b6d69f5f1 | |||
| 32887d6002 | |||
| 044226072b | |||
| 03b493c2e3 | |||
| 147fb3ab15 | |||
|
ac93eacbbc
|
|||
| e96ce57940 | |||
| 923e6a5585 | |||
| b2617b1eb2 | |||
| 023d0ed776 | |||
| f7c85d1e56 | |||
| f6632726c5 | |||
| 1d58e4afb1 | |||
| 1b7274b421 | |||
| e7bea420a7 | |||
| 14b00f06d3 | |||
| b286d56403 | |||
| 5c1b8981d1 | |||
| 9bb84fb008 | |||
| a3c4bcfe0f | |||
| 6deb62064d | |||
| eb8cefdc83 | |||
| 9051396b67 | |||
| 55f47a6f01 | |||
| 353801a1e0 | |||
| 6337d0170e | |||
| 6dfc528b60 | |||
| f5b36ea2ef | |||
| 0730168d32 | |||
| c597cfc0d8 | |||
| 2c26ae5ca6 | |||
| 3bde872925 | |||
| 89c8fa135f | |||
| 8e8ebce9f7 | |||
| d92f462624 | |||
| 11e581bfd4 | |||
| 816789b3e9 | |||
| f16e35d17d | |||
| 1a64a84113 | |||
| 57f5932351 | |||
| d6b201c945 | |||
| 13c8720f29 | |||
| 32664e15be | |||
|
d32e0ad41b
|
|||
| d918229d4a | |||
| 336be7fd28 | |||
| ddc2e7c759 | |||
| d1ec42b99d | |||
| 3da6de5265 | |||
| 622533df53 | |||
| 3af29c4724 | |||
| 1181cf6728 | |||
| 872d1f4620 | |||
| d95d4a9815 | |||
| 37f6f1b878 | |||
|
405df59774
|
|||
| 7dfe1a5aa1 | |||
| dbaa511fe6 | |||
| 78cf379dd3 | |||
| e2fc8a21c2 | |||
| 0541ba7662 | |||
| cff438adae | |||
| 84779c5812 | |||
| e71f40a59e | |||
| 00ee6efca8 | |||
| 772c8a1d8f |
@@ -0,0 +1,30 @@
|
|||||||
|
name: presenter
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: actions/setup-go@v6
|
||||||
|
with:
|
||||||
|
go-version: 'stable'
|
||||||
|
- name: Run tests
|
||||||
|
run: go test -race -coverprofile=coverage.txt ./...
|
||||||
|
|
||||||
|
vulnerabilities:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: actions/setup-go@v6
|
||||||
|
with:
|
||||||
|
go-version: 'stable'
|
||||||
|
- name: Check vulnerabilities
|
||||||
|
run: |
|
||||||
|
go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||||
|
govulncheck ./...
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
name: pre-commit
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pre-commit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
SKIP: no-commit-to-branch
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: actions/setup-go@v6
|
||||||
|
with:
|
||||||
|
go-version: stable
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
- name: Install goimports
|
||||||
|
run: go install golang.org/x/tools/cmd/goimports@latest
|
||||||
|
- uses: pre-commit/action@v3.0.1
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
uses: unboundsoftware/shared-workflows/.gitea/workflows/Release.yml@main
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
.idea
|
.idea
|
||||||
|
.claude
|
||||||
/release
|
/release
|
||||||
|
|||||||
+2
-2
@@ -7,7 +7,7 @@ include:
|
|||||||
- project: unboundsoftware/ci-templates
|
- project: unboundsoftware/ci-templates
|
||||||
file: Pre-Commit-Go.gitlab-ci.yml
|
file: Pre-Commit-Go.gitlab-ci.yml
|
||||||
|
|
||||||
image: amd64/golang:1.25.1@sha256:53f7808857782118f3a062261f721507dfa36e5c545e5d39c2dcf9916e3f0b1b
|
image: amd64/golang:1.25.5@sha256:ad03ba93327b8a6143b49373790b5d92c28067bdb814418509466122ee9c9e63
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- deps
|
- deps
|
||||||
@@ -32,7 +32,7 @@ test:
|
|||||||
|
|
||||||
vulnerabilities:
|
vulnerabilities:
|
||||||
stage: test
|
stage: test
|
||||||
image: amd64/golang:1.25.1@sha256:53f7808857782118f3a062261f721507dfa36e5c545e5d39c2dcf9916e3f0b1b
|
image: amd64/golang:1.25.5@sha256:ad03ba93327b8a6143b49373790b5d92c28067bdb814418509466122ee9c9e63
|
||||||
script:
|
script:
|
||||||
- go install golang.org/x/vuln/cmd/govulncheck@latest
|
- go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||||
- govulncheck ./...
|
- govulncheck ./...
|
||||||
|
|||||||
+4
-11
@@ -10,15 +10,8 @@ repos:
|
|||||||
args:
|
args:
|
||||||
- --allow-multiple-documents
|
- --allow-multiple-documents
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
- repo: https://gitlab.com/devopshq/gitlab-ci-linter
|
|
||||||
rev: v1.0.6
|
|
||||||
hooks:
|
|
||||||
- id: gitlab-ci-linter
|
|
||||||
args:
|
|
||||||
- --project
|
|
||||||
- unboundsoftware/shiny/presenter
|
|
||||||
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
|
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
|
||||||
rev: v9.22.0
|
rev: v9.23.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: commitlint
|
- id: commitlint
|
||||||
stages: [ commit-msg ]
|
stages: [ commit-msg ]
|
||||||
@@ -30,17 +23,17 @@ repos:
|
|||||||
- id: go-imports
|
- id: go-imports
|
||||||
args:
|
args:
|
||||||
- -local
|
- -local
|
||||||
- gitlab.com/unboundsoftware/shiny/presenter
|
- git.unbound.se/shiny/presenter
|
||||||
- repo: https://github.com/lietu/go-pre-commit
|
- repo: https://github.com/lietu/go-pre-commit
|
||||||
rev: v1.0.0
|
rev: v1.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: go-test
|
- id: go-test
|
||||||
- id: gofumpt
|
- id: gofumpt
|
||||||
- repo: https://github.com/golangci/golangci-lint
|
- repo: https://github.com/golangci/golangci-lint
|
||||||
rev: v2.5.0
|
rev: v2.8.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: golangci-lint-full
|
- id: golangci-lint-full
|
||||||
- repo: https://github.com/gitleaks/gitleaks
|
- repo: https://github.com/gitleaks/gitleaks
|
||||||
rev: v8.28.0
|
rev: v8.30.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: gitleaks
|
- id: gitleaks
|
||||||
|
|||||||
+138
@@ -2,12 +2,91 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [0.3.0] - 2026-01-09
|
||||||
|
|
||||||
|
### 🚀 Features
|
||||||
|
|
||||||
|
- Migrate from GitLab CI to Gitea Actions
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.85
|
||||||
|
- Update module path from gitlab to git.unbound.se
|
||||||
|
|
||||||
|
### 📚 Documentation
|
||||||
|
|
||||||
|
- Add CLAUDE.md for Claude Code integration
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.30.0
|
||||||
|
- *(deps)* Update golang docker tag to v1.25.5
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.7.0
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.7.1
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.7.2
|
||||||
|
- *(deps)* Update golang:1.25.5 docker digest to 0c27bcf
|
||||||
|
- *(deps)* Update golang:1.25.5 docker digest to ad03ba9
|
||||||
|
- *(deps)* Update actions/checkout action to v6
|
||||||
|
- *(deps)* Update actions/setup-go action to v6
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.8.0
|
||||||
|
- Add pre-commit and release workflows
|
||||||
|
|
||||||
|
## [0.2.2] - 2025-11-24
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.84
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.6.2
|
||||||
|
- *(deps)* Update golang:1.25.4 docker digest to efe81fa
|
||||||
|
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.29.1
|
||||||
|
|
||||||
|
## [0.2.1] - 2025-11-13
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.82
|
||||||
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.83
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(deps)* Update golang docker tag to v1.25.4
|
||||||
|
|
||||||
|
## [0.2.0] - 2025-11-05
|
||||||
|
|
||||||
|
### 🚀 Features
|
||||||
|
|
||||||
|
- *(errors)* Add new entity types for bank connections and transactions
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- *(deps)* Update module github.com/vektah/gqlparser/v2 to v2.5.31
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(deps)* Update golang:1.25.1 docker digest to 12640a4
|
||||||
|
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.23.0
|
||||||
|
- *(deps)* Update golang docker tag to v1.25.2
|
||||||
|
- *(deps)* Update golang docker tag to v1.25.3
|
||||||
|
- *(deps)* Update golang:1.25.3 docker digest to 69d1009
|
||||||
|
- Clean up cliff.toml configuration
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.6.0
|
||||||
|
- *(deps)* Update golang:1.25.3 docker digest to 9ac0edc
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.6.1
|
||||||
|
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.29.0
|
||||||
|
|
||||||
## [0.1.8] - 2025-09-26
|
## [0.1.8] - 2025-09-26
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.81
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.81
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.5.0
|
||||||
|
|
||||||
## [0.1.7] - 2025-09-17
|
## [0.1.7] - 2025-09-17
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
@@ -17,12 +96,35 @@ All notable changes to this project will be documented in this file.
|
|||||||
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.79
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.79
|
||||||
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.80
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.80
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.3.1
|
||||||
|
- *(deps)* Update golang docker tag to v1.24.6
|
||||||
|
- *(deps)* Update pre-commit hook pre-commit/pre-commit-hooks to v6
|
||||||
|
- *(deps)* Update golang:1.24.6 docker digest to 958bfd1
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.4.0
|
||||||
|
- *(deps)* Update golang docker tag to v1.25.0
|
||||||
|
- *(deps)* Update golang:1.25.0 docker digest to f6b9e1a
|
||||||
|
- *(deps)* Update golang docker tag to v1.25.1
|
||||||
|
- *(deps)* Update golang:1.25.1 docker digest to 53f7808
|
||||||
|
- *(deps)* Update pre-commit hook lietu/go-pre-commit to v1
|
||||||
|
|
||||||
## [0.1.6] - 2025-07-28
|
## [0.1.6] - 2025-07-28
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.78
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.78
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.2.1
|
||||||
|
- *(deps)* Update golang:1.24.4 docker digest to 9f820b6
|
||||||
|
- *(deps)* Update golang docker tag to v1.24.5
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.2.2
|
||||||
|
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.28.0
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.3.0
|
||||||
|
- *(deps)* Update golang:1.24.5 docker digest to 0a156a4
|
||||||
|
|
||||||
## [0.1.5] - 2025-06-29
|
## [0.1.5] - 2025-06-29
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
@@ -30,6 +132,10 @@ All notable changes to this project will be documented in this file.
|
|||||||
- *(deps)* Update module github.com/vektah/gqlparser/v2 to v2.5.30
|
- *(deps)* Update module github.com/vektah/gqlparser/v2 to v2.5.30
|
||||||
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.76
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.76
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.2.0
|
||||||
|
|
||||||
## [0.1.4] - 2025-06-28
|
## [0.1.4] - 2025-06-28
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
@@ -48,6 +154,13 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
- *(deps)* Update module github.com/vektah/gqlparser/v2 to v2.5.28
|
- *(deps)* Update module github.com/vektah/gqlparser/v2 to v2.5.28
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(deps)* Update golang docker tag to v1.24.4
|
||||||
|
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.27.1
|
||||||
|
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.27.2
|
||||||
|
- *(deps)* Update golang:1.24.4 docker digest to 3494bbe
|
||||||
|
|
||||||
## [0.1.1] - 2025-06-02
|
## [0.1.1] - 2025-06-02
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
@@ -55,6 +168,11 @@ All notable changes to this project will be documented in this file.
|
|||||||
- Update project reference in pre-commit config
|
- Update project reference in pre-commit config
|
||||||
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.74
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.74
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(deps)* Update golang:1.24.3 docker digest to f255a7d
|
||||||
|
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.27.0
|
||||||
|
|
||||||
## [0.1.0] - 2025-05-16
|
## [0.1.0] - 2025-05-16
|
||||||
|
|
||||||
### 🚀 Features
|
### 🚀 Features
|
||||||
@@ -70,12 +188,32 @@ All notable changes to this project will be documented in this file.
|
|||||||
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.73
|
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.73
|
||||||
- *(deps)* Update module github.com/vektah/gqlparser/v2 to v2.5.27
|
- *(deps)* Update module github.com/vektah/gqlparser/v2 to v2.5.27
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.1.2
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.1.4
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.1.5
|
||||||
|
- *(deps)* Update golang:1.24.2 docker digest to bf7899c
|
||||||
|
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.25.0
|
||||||
|
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.25.1
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.1.6
|
||||||
|
- *(deps)* Update golang docker tag to v1.24.3
|
||||||
|
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.26.0
|
||||||
|
|
||||||
## [0.0.2] - 2025-04-14
|
## [0.0.2] - 2025-04-14
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
- *(deps)* Update module github.com/vektah/gqlparser/v2 to v2.5.24
|
- *(deps)* Update module github.com/vektah/gqlparser/v2 to v2.5.24
|
||||||
|
|
||||||
|
### ⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- *(deps)* Update golang docker tag to v1.24.2
|
||||||
|
- *(deps)* Update golang:1.24.2 docker digest to aebb7df
|
||||||
|
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.24.3
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.1.0
|
||||||
|
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.1.1
|
||||||
|
|
||||||
## [0.0.1] - 2025-03-30
|
## [0.0.1] - 2025-03-30
|
||||||
|
|
||||||
### 🚀 Features
|
### 🚀 Features
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# presenter
|
||||||
|
|
||||||
|
Shared Go library for GraphQL error presentation with coded errors.
|
||||||
|
|
||||||
|
## Shared Documentation
|
||||||
|
|
||||||
|
@../docs/claude/architecture.md
|
||||||
|
@../docs/claude/go-services.md
|
||||||
|
@../docs/claude/graphql.md
|
||||||
|
@../docs/claude/conventions.md
|
||||||
|
|
||||||
|
## Library Information
|
||||||
|
|
||||||
|
### Purpose
|
||||||
|
|
||||||
|
Provides a standardized GraphQL error presenter that handles coded errors across all microservices. Converts internal error codes to GraphQL error extensions.
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
```go
|
||||||
|
import "git.unbound.se/shiny/presenter"
|
||||||
|
|
||||||
|
// Create error presenter with valid codes and entities
|
||||||
|
errorPresenter := presenter.New(logger, validCodes, validEntities, internalErrorCode)
|
||||||
|
|
||||||
|
// Use in gqlgen server config
|
||||||
|
srv := handler.NewDefaultServer(generated.NewExecutableSchema(cfg))
|
||||||
|
srv.SetErrorPresenter(errorPresenter)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Key Types
|
||||||
|
|
||||||
|
- `CodedError` - Error type with code, entity, and params
|
||||||
|
- `Code` - Error code type
|
||||||
|
- `Entity` - Error entity type
|
||||||
|
|
||||||
|
### Error Extensions
|
||||||
|
|
||||||
|
Errors are presented with extensions:
|
||||||
|
- `code` - The error code (mapped to valid codes or internal error)
|
||||||
|
- `errorEntity` - The entity related to the error (optional)
|
||||||
|
- `params` - Additional error parameters (optional)
|
||||||
@@ -1,6 +1,3 @@
|
|||||||
# Shiny global error presenter
|
# Shiny global error presenter
|
||||||
|
|
||||||
GraphQL global error presenter handling coded errors.
|
GraphQL global error presenter handling coded errors.
|
||||||
|
|
||||||
[](https://gitlab.com/unboundsoftware/shiny/presenter/commits/main)
|
|
||||||
[](https://codecov.io/gl/unboundsoftware:shiny/presenter)
|
|
||||||
|
|||||||
+17
-24
@@ -5,9 +5,6 @@
|
|||||||
# Configuration options are organized into tables and keys.
|
# Configuration options are organized into tables and keys.
|
||||||
# See documentation for more information on available options.
|
# See documentation for more information on available options.
|
||||||
|
|
||||||
[bump]
|
|
||||||
initial_tag = "v0.0.1"
|
|
||||||
|
|
||||||
[changelog]
|
[changelog]
|
||||||
# template for the changelog header
|
# template for the changelog header
|
||||||
header = """
|
header = """
|
||||||
@@ -39,7 +36,7 @@ footer = """
|
|||||||
trim = true
|
trim = true
|
||||||
# postprocessors
|
# postprocessors
|
||||||
postprocessors = [
|
postprocessors = [
|
||||||
# { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
|
# { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
|
||||||
]
|
]
|
||||||
# render body even when there are no releases to process
|
# render body even when there are no releases to process
|
||||||
# render_always = true
|
# render_always = true
|
||||||
@@ -55,28 +52,25 @@ filter_unconventional = true
|
|||||||
split_commits = false
|
split_commits = false
|
||||||
# regex for preprocessing the commit messages
|
# regex for preprocessing the commit messages
|
||||||
commit_preprocessors = [
|
commit_preprocessors = [
|
||||||
# Replace issue numbers
|
# Replace issue numbers
|
||||||
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
|
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
|
||||||
# Check spelling of the commit with https://github.com/crate-ci/typos
|
# Check spelling of the commit with https://github.com/crate-ci/typos
|
||||||
# If the spelling is incorrect, it will be automatically fixed.
|
# If the spelling is incorrect, it will be automatically fixed.
|
||||||
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
|
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
|
||||||
]
|
]
|
||||||
# regex for parsing and grouping commits
|
# regex for parsing and grouping commits
|
||||||
commit_parsers = [
|
commit_parsers = [
|
||||||
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
|
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
|
||||||
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
|
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
|
||||||
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
|
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
|
||||||
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
|
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
|
||||||
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
|
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
|
||||||
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
|
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
|
||||||
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
|
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
|
||||||
{ message = "^chore\\(release\\): prepare for", skip = true },
|
{ message = "^chore\\(release\\): prepare for", skip = true },
|
||||||
{ message = "^chore\\(deps.*\\)", skip = true },
|
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
|
||||||
{ message = "^chore\\(pr\\)", skip = true },
|
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
|
||||||
{ message = "^chore\\(pull\\)", skip = true },
|
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
|
||||||
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
|
|
||||||
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
|
|
||||||
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
|
|
||||||
]
|
]
|
||||||
# filter out the commits that are not matched by commit parsers
|
# filter out the commits that are not matched by commit parsers
|
||||||
filter_commits = false
|
filter_commits = false
|
||||||
@@ -84,4 +78,3 @@ filter_commits = false
|
|||||||
topo_order = false
|
topo_order = false
|
||||||
# sort the commits inside sections by oldest/newest order
|
# sort the commits inside sections by oldest/newest order
|
||||||
sort_commits = "oldest"
|
sort_commits = "oldest"
|
||||||
tag_pattern = "v[0-9]+\\.[0-9]+\\.[0-9]+"
|
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ const (
|
|||||||
EntityTag = Entity("TAG")
|
EntityTag = Entity("TAG")
|
||||||
EntityEntry = Entity("ENTRY")
|
EntityEntry = Entity("ENTRY")
|
||||||
EntityEntryBasis = Entity("ENTRY_BASIS")
|
EntityEntryBasis = Entity("ENTRY_BASIS")
|
||||||
|
EntityBankConnection = Entity("BANK_CONNECTION")
|
||||||
|
EntityBankTransaction = Entity("BANK_TRANSACTION")
|
||||||
)
|
)
|
||||||
|
|
||||||
type CodedError struct {
|
type CodedError struct {
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"gitlab.com/unboundsoftware/shiny/presenter"
|
"git.unbound.se/shiny/presenter"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCodedError_ErrorIs(t *testing.T) {
|
func TestCodedError_ErrorIs(t *testing.T) {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
module gitlab.com/unboundsoftware/shiny/presenter
|
module git.unbound.se/shiny/presenter
|
||||||
|
|
||||||
go 1.24.1
|
go 1.24.1
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/99designs/gqlgen v0.17.81
|
github.com/99designs/gqlgen v0.17.85
|
||||||
github.com/stretchr/testify v1.11.1
|
github.com/stretchr/testify v1.11.1
|
||||||
github.com/vektah/gqlparser/v2 v2.5.30
|
github.com/vektah/gqlparser/v2 v2.5.31
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
github.com/99designs/gqlgen v0.17.81 h1:kCkN/xVyRb5rEQpuwOHRTYq83i0IuTQg9vdIiwEerTs=
|
github.com/99designs/gqlgen v0.17.85 h1:EkGx3U2FDcxQm8YDLQSpXIAVmpDyZ3IcBMOJi2nH1S0=
|
||||||
github.com/99designs/gqlgen v0.17.81/go.mod h1:vgNcZlLwemsUhYim4dC1pvFP5FX0pr2Y+uYUoHFb1ig=
|
github.com/99designs/gqlgen v0.17.85/go.mod h1:yvs8s0bkQlRfqg03YXr3eR4OQUowVhODT/tHzCXnbOU=
|
||||||
|
github.com/agnivade/levenshtein v1.2.1 h1:EHBY3UOn1gwdy/VbFwgo4cxecRznFk7fKWN1KOX7eoM=
|
||||||
|
github.com/agnivade/levenshtein v1.2.1/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU=
|
||||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
|
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
|
||||||
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
|
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
@@ -14,8 +16,8 @@ github.com/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq
|
|||||||
github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg=
|
github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg=
|
||||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||||
github.com/vektah/gqlparser/v2 v2.5.30 h1:EqLwGAFLIzt1wpx1IPpY67DwUujF1OfzgEyDsLrN6kE=
|
github.com/vektah/gqlparser/v2 v2.5.31 h1:YhWGA1mfTjID7qJhd1+Vxhpk5HTgydrGU9IgkWBTJ7k=
|
||||||
github.com/vektah/gqlparser/v2 v2.5.30/go.mod h1:D1/VCZtV3LPnQrcPBeR/q5jkSQIPti0uYCP/RI0gIeo=
|
github.com/vektah/gqlparser/v2 v2.5.31/go.mod h1:c1I28gSOVNzlfc4WuDlqU7voQnsqI6OG2amkBAFmgts=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/vektah/gqlparser/v2/gqlerror"
|
"github.com/vektah/gqlparser/v2/gqlerror"
|
||||||
|
|
||||||
"gitlab.com/unboundsoftware/shiny/presenter"
|
"git.unbound.se/shiny/presenter"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_globalErrorPresenter(t *testing.T) {
|
func Test_globalErrorPresenter(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user