-
Notifications
You must be signed in to change notification settings - Fork 0
v0.9.0 compliance: full upgrade against core/go reference #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3fe31d7
refactor(core): migrate to dappco.re/go v0.9.0 API
Snider a43663c
refactor(core): adopt Ok/Fail/ResultOf constructors over Result literals
Snider cee6899
refactor(core): full v0.9.0 compliance against core/go reference
Snider 0020cb4
ci: woodpecker pipeline (Go) — golangci-lint/eslint/phpstan + sonar.l…
Snider e669a5d
ci: woodpecker pipeline (Go) — golangci-lint/eslint/phpstan + sonar.l…
Snider 212d272
refactor(core): align api with v0.9.1 hardened core/go reference shape
Snider 433039c
refactor(core): api round 2 — full 24-dim COMPLIANT
Snider 2bf28fb
refactor(api): drop unused internal/compat/{core,miner} shims
Snider 620d99c
refactor(api): morph back to registry-shape — strip stdcompat shims, …
Snider 12e8328
chore(api): rename src/ to php/ and clean up stale .md files
Snider 5776423
chore(api): restructure Go module under go/ for cross-language symmetry
Snider 3521e2f
feat(api): add go.work + external/ submodules for dev workspace mode
Snider fd06ecd
chore(lint): clear production-side errcheck/staticcheck
Snider be17f34
ci: add SonarCloud + Codecov uploaders alongside lthn.sh sonar
Snider 8ab1cc8
ci(github): add public CI workflow (test + lint + sonarcloud + codecov)
Snider 3a89774
docs(README): rewrite with public CI + sonarcloud + codecov badges
Snider 49b659a
ci(github): set GOPROXY=direct + GOSUMDB=off to match Woodpecker
Snider File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [dev, main] | ||
| pull_request: | ||
| branches: [dev, main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| GOFLAGS: -buildvcs=false | ||
| GOWORK: "off" | ||
| GOPROXY: "direct" | ||
| GOSUMDB: "off" | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test + Coverage | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.26' | ||
| - name: Test with coverage | ||
| working-directory: go | ||
| run: go test -race -coverprofile=coverage.out -covermode=atomic -count=1 ./... | ||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| files: go/coverage.out | ||
| flags: unittests | ||
| fail_ci_if_error: false | ||
|
|
||
| lint: | ||
| name: golangci-lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.26' | ||
| - uses: golangci/golangci-lint-action@v9 | ||
| with: | ||
| version: latest | ||
| working-directory: go | ||
| args: --timeout=5m --tests=false | ||
|
|
||
| sonarcloud: | ||
| name: SonarCloud | ||
| runs-on: ubuntu-latest | ||
| needs: test | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.26' | ||
| - name: Test for coverage | ||
| working-directory: go | ||
| run: go test -coverprofile=coverage.out -covermode=atomic -count=1 ./... | ||
| - name: SonarCloud Scan | ||
| uses: SonarSource/sonarqube-scan-action@v6 | ||
| env: | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| with: | ||
| args: > | ||
| -Dsonar.organization=dappcore | ||
| -Dsonar.projectKey=dappcore_api | ||
| -Dsonar.sources=go | ||
| -Dsonar.exclusions=**/vendor/**,**/third_party/**,**/.tmp/**,**/*_test.go | ||
| -Dsonar.tests=go | ||
| -Dsonar.test.inclusions=**/*_test.go | ||
| -Dsonar.go.coverage.reportPaths=go/coverage.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| [submodule "external/go"] | ||
| path = external/go | ||
| url = https://github.com/dappcore/go.git | ||
| branch = dev | ||
| [submodule "external/go-process"] | ||
| path = external/go-process | ||
| url = https://github.com/dappcore/go-process.git | ||
| branch = dev | ||
| [submodule "external/go-scm"] | ||
| path = external/go-scm | ||
| url = https://github.com/dappcore/go-scm.git | ||
| branch = dev | ||
| [submodule "external/go-proxy"] | ||
| path = external/go-proxy | ||
| url = https://github.com/dappcore/go-proxy.git | ||
| branch = dev | ||
| [submodule "external/go-ws"] | ||
| path = external/go-ws | ||
| url = https://github.com/dappcore/go-ws.git | ||
| branch = dev | ||
| [submodule "external/go-inference"] | ||
| path = external/go-inference | ||
| url = https://github.com/dappcore/go-inference.git | ||
| branch = dev | ||
| [submodule "external/go-io"] | ||
| path = external/go-io | ||
| url = https://github.com/dappcore/go-io.git | ||
| branch = dev | ||
| [submodule "external/go-log"] | ||
| path = external/go-log | ||
| url = https://github.com/dappcore/go-log.git | ||
| branch = dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # Woodpecker CI pipeline. | ||
| # Server: ci.lthn.sh. | ||
| # Lint + test run in parallel; sonar (lthn.sh + sonarcloud) + codecov fan | ||
| # out from go-test. | ||
|
|
||
| when: | ||
| - event: [push, manual, tag] | ||
| branch: [dev, main] | ||
|
|
||
| steps: | ||
| - name: golangci-lint | ||
| image: golangci/golangci-lint:latest-alpine | ||
| depends_on: [] | ||
| environment: | ||
| GOFLAGS: -buildvcs=false | ||
| GOWORK: "off" | ||
| commands: | ||
| - cd go && golangci-lint run --timeout=5m ./... | ||
|
|
||
| - name: go-test | ||
| image: golang:1.26-alpine | ||
| depends_on: [] | ||
| environment: | ||
| GOFLAGS: -buildvcs=false | ||
| GOWORK: "off" | ||
| CGO_ENABLED: "1" | ||
| commands: | ||
| - apk add --no-cache git build-base | ||
| - cd go && go test -race -coverprofile=coverage.out -covermode=atomic -count=1 ./... | ||
|
|
||
| - name: sonar-internal | ||
| image: sonarsource/sonar-scanner-cli:latest | ||
| depends_on: [go-test] | ||
| environment: | ||
| SONAR_HOST_URL: https://sonar.lthn.sh | ||
| SONAR_TOKEN: | ||
| from_secret: sonar_token | ||
| commands: | ||
| - sonar-scanner | ||
|
|
||
| - name: sonarcloud | ||
| image: sonarsource/sonar-scanner-cli:latest | ||
| depends_on: [go-test] | ||
| environment: | ||
| SONAR_TOKEN: | ||
| from_secret: sonarcloud_token | ||
| commands: | ||
| - sonar-scanner | ||
| -Dsonar.host.url=https://sonarcloud.io | ||
| -Dsonar.organization=dappcore | ||
| -Dsonar.projectKey=dappcore_api | ||
| -Dsonar.go.coverage.reportPaths=go/coverage.out | ||
|
|
||
| - name: codecov | ||
| image: alpine:3.20 | ||
| depends_on: [go-test] | ||
| environment: | ||
| CODECOV_TOKEN: | ||
| from_secret: codecov_token | ||
| commands: | ||
| - apk add --no-cache curl bash git | ||
| - cd go && bash <(curl -s https://codecov.io/bash) -f coverage.out -t "$CODECOV_TOKEN" -F unittests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| <!-- SPDX-License-Identifier: EUPL-1.2 --> | ||
|
|
||
| # Agent Notes | ||
|
|
||
| This repository is the Go Core API framework. Treat it as infrastructure: keep | ||
| changes narrow, preserve the public `RouteGroup` and `Engine` contracts, and | ||
| verify the whole module before handing work back. | ||
|
|
||
| ## Code Map | ||
|
|
||
| - `api.go` owns `Engine`, route group registration, handler construction, and | ||
| graceful serving. | ||
| - `options.go` contains public `With*` options. New middleware should enter | ||
| through this file unless it is strictly internal. | ||
| - `response.go`, `middleware.go`, `authentik.go`, `sse.go`, `websocket.go`, | ||
| `graphql.go`, `swagger.go`, `openapi.go`, `export.go`, and `codegen.go` | ||
| implement the user-facing HTTP features. | ||
| - `bridge.go` maps `ToolDescriptor` values to REST endpoints and OpenAPI | ||
| descriptions. | ||
| - `cmd/api` wires Core CLI actions for spec export and SDK generation. | ||
| - `cmd/gateway` builds the provider gateway binary. | ||
| - `pkg/provider` contains provider discovery, registry, and reverse proxy | ||
| support. | ||
| - `pkg/stream` contains declarative stream route groups. | ||
|
|
||
| ## Compliance Rules | ||
|
|
||
| Follow the v0.9.0 Core compliance shape. Use `dappco.re/go` wrappers for JSON, | ||
| errors, formatting, strings, buffers, filesystem, process, and environment | ||
| helpers whenever a wrapper exists. Do not add files named `ax7*.go`, versioned | ||
| test files, or monolithic compliance dumps. | ||
|
|
||
| For every production source file with public symbols, keep tests and examples | ||
| beside that file. Test names use `Test<File>_<Symbol>_Good`, | ||
| `Test<File>_<Symbol>_Bad`, and `Test<File>_<Symbol>_Ugly`. Examples use | ||
| `Example<Symbol>` or a valid lowercase suffix variant and print through Core | ||
| `Println`. | ||
|
|
||
| ## Before Stopping | ||
|
|
||
| Use the exact repository gate, with `GOWORK=off` for Go commands: | ||
|
|
||
| ```bash | ||
| GOWORK=off go mod tidy | ||
| GOWORK=off go vet ./... | ||
| GOWORK=off go test -count=1 ./... | ||
| gofmt -l . | ||
| bash /Users/snider/Code/core/go/tests/cli/v090-upgrade/audit.sh . | ||
| ``` | ||
|
|
||
| If the sandbox cannot write the default Go build cache, set `GOCACHE` to a | ||
| temporary directory while running the same commands. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add language specifier to fenced code block.
The code block should specify a language identifier for proper rendering and tooling support.
📝 Proposed fix
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 13-13: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents