Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .comet/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Configuration schema used by Comet. Do not edit this value.
schema: comet.project.v1
# Default workflow entered by /comet. Must also appear in workflows.
default_workflow: native
# Workflows enabled in this project: native, classic, or both.
workflows:
- native
# Enables automatic recovery through the read-only Ambient Resume probe for both Native and Classic. Set false to disable it.
# ambient_resume: true | false
ambient_resume: true
# Native workflow settings. They do not change Classic state or behavior.
native:
# Root directory where Native stores Comet specs and changes. Runtime data stays under .comet.
artifact_root: docs
# Artifact language used by Native workflow documents.
# language: en | zh-CN
language: en
# Controls how Native asks clarifying questions: batch asks every currently answerable question per round (default), sequential asks one at a time.
# clarification_mode: batch | sequential
clarification_mode: batch
# Controls whether Native archives automatically after a successful preview or waits for explicit user confirmation.
# archive_confirmation: automatic | required
archive_confirmation: automatic
# Maximum failed Verify outcomes allowed for one confirmed acceptance target before Native stops the completion loop.
max_verify_failures: 5
8 changes: 5 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.x'
go-version: '1.26.x'

- uses: actions/checkout@v3

Expand All @@ -38,7 +38,9 @@ jobs:
PGPASSWORD: postgres

- name: Test
run: go test -v ./...
run: go test -v -tags=integration ./...
env:
DB_DSN: postgres://postgres:postgres@localhost:5432/newsportal?sslmode=disable

build:
runs-on: ubuntu-latest
Expand All @@ -48,7 +50,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.x'
go-version: '1.26.x'

- name: Build
run: go build -v ./...
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.24.x'
go-version: '1.26.x'
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.x'
go-version: '1.26.x'
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ lint:
@golangci-lint run

db-test:
@echo "Rebuilding test DB..."
@dropdb --if-exists newsportal
@createdb -E UTF-8 -O postgres -T template0 --lc-collate C --lc-ctype=ru_RU.UTF-8 newsportal
@psql newsportal < docs/testdb/schema.sql
@$(MAKE) integration

test:
@go test -v ./...
@docs/testdb/run.sh go test -v ./...

integration:
@docs/testdb/run.sh go test -tags=integration -p 1 ./...

generate:
@go generate ./api
Expand Down
181 changes: 180 additions & 1 deletion api/api_zenrpc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion api/dartclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const (
voidResponse = "void"
listType = "List"
objectType = "object"
dartIntType = "int"
)

type dartClass struct {
Expand Down Expand Up @@ -186,7 +187,7 @@ func (c *Client) addModel(dc dartClass) {
// convertScalar converts scalars from go to dart.
func (c *Client) convertScalar(t, description string) string {
switch t {
case "integer", "int":
case "integer", dartIntType:
return "int"
case "string":
return "String"
Expand Down
4 changes: 4 additions & 0 deletions api/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ func (s ProjectService) Current() (*mfd.Project, error) {
//
//zenrpc:project Project
func (s ProjectService) Update(project mfd.Project) error {
if err := project.ValidateGoPGVersion(); err != nil {
return fmt.Errorf("update project, err=%w", err)
}

s.CurrentProject = &project
s.CurrentProject.UpdateByNSMapping()

Expand Down
Loading