Skip to content
Open
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
30 changes: 14 additions & 16 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,35 @@ on: # yamllint disable-line rule:truthy
types:
- "checks_requested"
jobs:
go-lint:
name: "Lint Go"
lint:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing to keep an eye on is that we are now running a more expensive lint job, whereas before we ran multiple concurrent lint operations. This means we are trading off smaller, faster jobs for one larger, more expensive job. That impacts the feedback loop (how long it takes for the developer to receive feedback from CI). This may not be a problem, but please keep an eye on the timing of these jobs.

runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "authzed/actions/setup-go@main"
- name: "Lint Go"
run: "go run magefile.go lint:go"
- name: "Go Mod Tidy"
with:
go-version-file: "go.mod"
- name: "Lint everything and check for tidy dependencies"
run: "go run magefile.go lint:all && go run magefile.go deps:tidy"
Comment on lines +21 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this chained as an && instead of using 2 sequential run operations?

- name: "Check no diff"
uses: "chainguard-dev/actions/nodiff@main"
with:
path: ""
fixup-command: "go run magefile.go deps:tidy"
fixup-command: "go run magefile.go lint:all && go run magefile.go deps:tidy"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ran already above, why does it need to run again?

protobuf:
name: "Generate Protobufs"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "authzed/actions/setup-go@main"
- uses: "chainguard-dev/actions/nodiff@main"
with:
go-version-file: "go.mod"
- name: "Generate Protos"
run: "go run magefile.go gen:all"
- name: "Check no diff"
uses: "chainguard-dev/actions/nodiff@main"
with:
path: ""
fixup-command: "go run magefile.go gen:proto"
extra-lint:
name: "Lint YAML"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "authzed/actions/setup-go@main"
- name: "Lint Go"
run: "go run magefile.go lint:extra"
fixup-command: "go run magefile.go gen:all"
codeql:
name: "Analyze with CodeQL"
runs-on: "ubuntu-latest"
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ on:
- "checks_requested"
jobs:
tests:
name: "Unit and Integration Tests"
name: "Tests"
runs-on: "ubuntu-latest"
timeout-minutes: 30
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-go@v5"
with:
go-version-file: "go.mod"
- uses: "authzed/action-spicedb@v1"
with:
version: "latest"
- name: "Run tests"
run: "go test ./..."
run: "go run magefile.go test:all"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/authzed/authzed-go

go 1.23.0

toolchain go1.24.1
toolchain go1.24.4

require (
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250425153114-8976f5be98c1.1
Expand Down
2 changes: 1 addition & 1 deletion magefiles/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (l Lint) All() error {
return nil
}

// Extra lits everything that's not code
// Extra lints everything that's not code
func (l Lint) Extra() error {
mg.Deps(l.Yaml)
return nil
Expand Down
14 changes: 10 additions & 4 deletions magefiles/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ type Test mg.Namespace

// All runs all test suites
func (t Test) All() error {
mg.Deps(t.Integration)
mg.Deps(t.Integration, t.Unit)
return nil
}

// Integration runs the unit tests
func (Test) Integration() error {
// Unit runs the unit tests
func (t Test) Unit() error {
fmt.Println("running unit tests")
return goTest("./...", "-tags", "integration", "-timeout", "10m")
return goTest("./...", "-race", "-count", "1", "-timeout", "20m")
}

// Integration runs the integration tests
func (Test) Integration() error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit tests have a timeout of 20m, but the integration tests have a timeout of 1m? No race detector?

fmt.Println("running integration tests")
return goTest("./...", "-v", "-tags", "integration", "-timeout", "1m")
}
2 changes: 2 additions & 0 deletions proto/authzed/api/validation_test/relationships_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !integration

package validation_test

import (
Expand Down
2 changes: 2 additions & 0 deletions proto/authzed/api/validation_test/updates_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !integration

package validation_test

import (
Expand Down
8 changes: 0 additions & 8 deletions proto/proto.go
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt anyone uses this, but this would be a breaking change, right?

This file was deleted.

2 changes: 2 additions & 0 deletions v1/client_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build integration

package authzed_test

import (
Expand Down
Loading