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
13 changes: 13 additions & 0 deletions .github/actions/go-linter/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,16 @@ runs:
version: 2025.1.1
install-go: false
working-directory: ${{ inputs.working-directory }}

- name: Check code formatting
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "The following files are not formatted correctly:"
echo "$unformatted"
echo ""
echo "Run 'gofmt -w .' to fix formatting."
exit 1
fi
shell: bash
working-directory: ${{ inputs.working-directory }}
1 change: 0 additions & 1 deletion router-tests/events/kafka_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/wundergraph/cosmo/router/pkg/config"
)


type kafkaSubscriptionArgs struct {
dataValue []byte
errValue error
Expand Down
2 changes: 0 additions & 2 deletions router-tests/events/nats_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func (c *ConfigPollerMock) Stop(_ context.Context) error {
return nil
}


type natsSubscriptionArgs struct {
dataValue []byte
errValue error
Expand Down Expand Up @@ -1432,7 +1431,6 @@ func TestNatsEvents(t *testing.T) {
})
})


t.Run("subscribe to multiple subjects", func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion router-tests/events/redis_events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/wundergraph/cosmo/router/pkg/config"
)


type subscriptionArgs struct {
dataValue []byte
errValue error
Expand Down
2 changes: 1 addition & 1 deletion router-tests/lifecycle/shutdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/wundergraph/cosmo/router-tests/testutils"
"github.com/wundergraph/cosmo/router-tests/testenv"
"github.com/wundergraph/cosmo/router-tests/testutils"
"github.com/wundergraph/cosmo/router/core"
"github.com/wundergraph/cosmo/router/pkg/config"
"go.uber.org/goleak"
Expand Down
2 changes: 1 addition & 1 deletion router-tests/modules/context_error_field_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"testing"

"github.com/stretchr/testify/require"
"github.com/wundergraph/cosmo/router-tests/testutils"
contexterror "github.com/wundergraph/cosmo/router-tests/modules/context-error"
"github.com/wundergraph/cosmo/router-tests/testenv"
"github.com/wundergraph/cosmo/router-tests/testutils"
"github.com/wundergraph/cosmo/router/core"
"github.com/wundergraph/cosmo/router/pkg/config"
)
Expand Down
2 changes: 1 addition & 1 deletion router-tests/modules/set_scopes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"time"

"github.com/stretchr/testify/require"
"github.com/wundergraph/cosmo/router-tests/testutils"
"github.com/wundergraph/cosmo/router-tests/jwks"
setScopesModule "github.com/wundergraph/cosmo/router-tests/modules/custom-set-scopes"
"github.com/wundergraph/cosmo/router-tests/testenv"
"github.com/wundergraph/cosmo/router-tests/testutils"
"github.com/wundergraph/cosmo/router/cmd/custom/module"
"github.com/wundergraph/cosmo/router/core"
"github.com/wundergraph/cosmo/router/pkg/authentication"
Expand Down
2 changes: 1 addition & 1 deletion router-tests/modules/stream_receive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"github.com/hasura/go-graphql-client"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/wundergraph/cosmo/router-tests/testutils"
"github.com/wundergraph/cosmo/router-tests/events"
"github.com/wundergraph/cosmo/router-tests/jwks"
stream_receive "github.com/wundergraph/cosmo/router-tests/modules/stream-receive"
"github.com/wundergraph/cosmo/router-tests/testenv"
"github.com/wundergraph/cosmo/router-tests/testutils"
"github.com/wundergraph/cosmo/router/core"
"github.com/wundergraph/cosmo/router/pkg/authentication"
"github.com/wundergraph/cosmo/router/pkg/config"
Expand Down
1 change: 0 additions & 1 deletion router-tests/observability/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5763,4 +5763,3 @@ func findCacheMetrics(mf []*io_prometheus_client.MetricFamily) []*io_prometheus_
func findEngineMetrics(mf []*io_prometheus_client.MetricFamily) []*io_prometheus_client.MetricFamily {
return findMetricsWithPrefix(mf, "router_engine_")
}

2 changes: 1 addition & 1 deletion router-tests/telemetry/connection_metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"time"

"github.com/stretchr/testify/require"
"github.com/wundergraph/cosmo/router-tests/testutils"
"github.com/wundergraph/cosmo/router-tests/testenv"
"github.com/wundergraph/cosmo/router-tests/testutils"
"github.com/wundergraph/cosmo/router/core"
"github.com/wundergraph/cosmo/router/pkg/config"
"github.com/wundergraph/cosmo/router/pkg/otel"
Expand Down
2 changes: 1 addition & 1 deletion router-tests/telemetry/metrics_log_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"time"

"github.com/stretchr/testify/require"
"github.com/wundergraph/cosmo/router-tests/testutils"
"github.com/wundergraph/cosmo/router-tests/testenv"
"github.com/wundergraph/cosmo/router-tests/testutils"
"go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/metric/metricdata"
"go.uber.org/zap/zapcore"
Expand Down
2 changes: 1 addition & 1 deletion router-tests/telemetry/stream_metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"github.com/hasura/go-graphql-client"
"github.com/nats-io/nats.go"
"github.com/stretchr/testify/require"
"github.com/wundergraph/cosmo/router-tests/testutils"
"github.com/wundergraph/cosmo/router-tests/events"
"github.com/wundergraph/cosmo/router-tests/testenv"
"github.com/wundergraph/cosmo/router-tests/testutils"
"github.com/wundergraph/cosmo/router/pkg/config"
otelattrs "github.com/wundergraph/cosmo/router/pkg/otel"
"go.opentelemetry.io/otel/sdk/metric"
Expand Down
2 changes: 1 addition & 1 deletion router-tests/testenv/testenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ import (
"github.com/wundergraph/cosmo/router/pkg/controlplane/configpoller"
"github.com/wundergraph/cosmo/router/pkg/logging"
rmetric "github.com/wundergraph/cosmo/router/pkg/metric"
"github.com/wundergraph/cosmo/router/pkg/statistics"
"github.com/wundergraph/cosmo/router/pkg/pubsub/datasource"
pubsubNats "github.com/wundergraph/cosmo/router/pkg/pubsub/nats"
"github.com/wundergraph/cosmo/router/pkg/statistics"
rtrace "github.com/wundergraph/cosmo/router/pkg/trace"
)

Expand Down
8 changes: 8 additions & 0 deletions router/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ test-coverage:
test-fresh: clean-testcache test

lint:
@unformatted=$$(gofmt -l .); \
if [ -n "$$unformatted" ]; then \
echo "The following files are not formatted correctly:"; \
echo "$$unformatted"; \
echo ""; \
echo "Run 'gofmt -w .' to fix formatting."; \
exit 1; \
fi
go vet ./...
staticcheck ./...

Expand Down
2 changes: 1 addition & 1 deletion router/pkg/mcpserver/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func TestReload_PrefixModeAvoidsReservedNameCollision(t *testing.T) {
tempDir := t.TempDir()
writeOperationFiles(t, tempDir, map[string]string{
"GetOperationInfo.graphql": getOperationInfoOp,
"ListEmployees.graphql": listEmployeesOp,
"ListEmployees.graphql": listEmployeesOp,
})

schemaDoc, report := astparser.ParseGraphqlDocumentString(testSchema)
Expand Down
1 change: 0 additions & 1 deletion router/pkg/trace/meter.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ type (
}
)


func createExporter(log *zap.Logger, exp *ExporterConfig) (sdktrace.SpanExporter, error) {
u, err := url.Parse(exp.Endpoint)
if err != nil {
Expand Down
Loading