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
62 changes: 62 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and test

on:
pull_request:
branches: [coderabbit_micro_frontend]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: build-test-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Build production image
uses: docker/build-push-action@v5
with:
context: .
push: false
load: true
tags: grafana:pr-test
cache-from: type=gha,scope=grafana-pr
cache-to: type=gha,mode=max,scope=grafana-pr
- name: Verify startup and database health
run: |
docker run -d --name grafana-pr-test -p 127.0.0.1:3000:3000 \
-e GF_ANALYTICS_REPORTING_ENABLED=false \
-e GF_PLUGINS_PREINSTALL_DISABLED=true grafana:pr-test
for attempt in $(seq 1 60); do
if curl -fsS http://127.0.0.1:3000/api/health | jq -e '.database == "ok"'; then
exit 0
fi
sleep 2
done
docker logs grafana-pr-test
exit 1
- name: Container logs
if: failure()
run: docker logs grafana-pr-test || true
- name: Stop test container
if: always()
run: docker rm -f grafana-pr-test || true

test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Test code generation and schema conversion
run: go test ./pkg/codegen/... ./scripts/openapi3/...
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ COPY package.json project.json nx.json yarn.lock .yarnrc.yml ./
COPY .yarn .yarn
COPY packages packages
COPY plugins-bundled plugins-bundled
COPY e2e/test-plugins e2e/test-plugins
COPY public public
COPY LICENSE ./
COPY conf/defaults.ini ./conf/defaults.ini

RUN apk add --no-cache make build-base python3

RUN yarn install
# Browser tests run outside the Alpine production image.
RUN CYPRESS_INSTALL_BINARY=0 yarn install

COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js ./
COPY scripts scripts
Expand Down
34 changes: 19 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ require (
github.com/fatih/color v1.17.0 // @grafana/grafana-backend-group
github.com/fullstorydev/grpchan v1.1.1 // @grafana/grafana-backend-group
github.com/gchaincl/sqlhooks v1.3.0 // @grafana/grafana-search-and-storage
github.com/getkin/kin-openapi v0.127.0 // @grafana/grafana-as-code
github.com/getkin/kin-openapi v0.144.0 // @grafana/grafana-as-code
github.com/go-jose/go-jose/v3 v3.0.5 // @grafana/identity-access-team
github.com/go-kit/log v0.2.1 // @grafana/grafana-backend-group
github.com/go-ldap/ldap/v3 v3.4.4 // @grafana/identity-access-team
Expand Down Expand Up @@ -128,7 +128,7 @@ require (
github.com/modern-go/reflect2 v1.0.2 // @grafana/alerting-backend
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // @grafana/alerting-backend
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // @grafana/grafana-operator-experience-squad
github.com/oapi-codegen/oapi-codegen/v2 v2.3.1-0.20240823215434-d232e9efa9f5 // @grafana/grafana-as-code
github.com/oapi-codegen/oapi-codegen/v2 v2.8.0 // @grafana/grafana-as-code
github.com/oklog/ulid/v2 v2.1.0 // @grafana/identity-access-team
github.com/olekukonko/tablewriter v0.0.5 // @grafana/grafana-backend-group
github.com/openfga/api/proto v0.0.0-20240529184453-5b0b4941f3e0 // @grafana/identity-access-team
Expand Down Expand Up @@ -170,15 +170,15 @@ require (
go.uber.org/atomic v1.11.0 // @grafana/alerting-backend
go.uber.org/goleak v1.3.0 // @grafana/grafana-search-and-storage
gocloud.dev v0.39.0 // @grafana/grafana-app-platform-squad
golang.org/x/crypto v0.43.0 // @grafana/grafana-backend-group
golang.org/x/crypto v0.54.0 // @grafana/grafana-backend-group
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // @grafana/alerting-backend
golang.org/x/mod v0.28.0 // indirect; @grafana/grafana-backend-group
golang.org/x/net v0.46.0 // @grafana/oss-big-tent @grafana/partner-datasources
golang.org/x/mod v0.38.0 // indirect; @grafana/grafana-backend-group
golang.org/x/net v0.57.0 // @grafana/oss-big-tent @grafana/partner-datasources
golang.org/x/oauth2 v0.27.0 // @grafana/identity-access-team
golang.org/x/sync v0.17.0 // @grafana/alerting-backend
golang.org/x/text v0.30.0 // @grafana/grafana-backend-group
golang.org/x/sync v0.22.0 // @grafana/alerting-backend
golang.org/x/text v0.40.0 // @grafana/grafana-backend-group
golang.org/x/time v0.6.0 // @grafana/grafana-backend-group
golang.org/x/tools v0.37.0 // @grafana/grafana-as-code
golang.org/x/tools v0.48.0 // @grafana/grafana-as-code
gonum.org/v1/gonum v0.14.0 // @grafana/observability-metrics
google.golang.org/api v0.191.0 // @grafana/grafana-backend-group
google.golang.org/grpc v1.66.0 // @grafana/plugins-platform-backend
Expand Down Expand Up @@ -278,7 +278,7 @@ require (
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.22.2 // indirect
github.com/go-openapi/errors v0.22.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonpointer v0.23.1 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/spec v0.20.14 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
Expand Down Expand Up @@ -320,7 +320,6 @@ require (
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/invopop/jsonschema v0.12.0 // indirect
github.com/invopop/yaml v0.3.1 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/pgx/v5 v5.5.5 // indirect
Expand Down Expand Up @@ -381,7 +380,6 @@ require (
github.com/opentracing-contrib/go-stdlib v1.0.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand Down Expand Up @@ -436,8 +434,8 @@ require (
go.uber.org/mock v0.4.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // @grafana/identity-access-team
golang.org/x/sys v0.42.0 // indirect
golang.org/x/term v0.36.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/term v0.45.0 // indirect
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect
google.golang.org/genproto v0.0.0-20240812133136-8ffd90a71988 // indirect; @grafana/grafana-backend-group
google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect
Expand Down Expand Up @@ -485,14 +483,20 @@ require (
cloud.google.com/go/longrunning v0.5.12 // indirect
github.com/at-wat/mqtt-go v0.19.4 // indirect
github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect
github.com/go-openapi/swag/jsonname v0.26.0 // indirect
github.com/grafana/grafana/pkg/semconv v0.0.0-20240808213237-f4d2e064f435 // indirect
github.com/grafana/sqlds/v4 v4.1.0 // indirect
github.com/hairyhenderson/go-which v0.2.0 // indirect
github.com/iancoleman/orderedmap v0.3.0 // indirect
github.com/speakeasy-api/openapi-overlay v0.9.0 // indirect
github.com/oasdiff/yaml v0.1.1 // indirect
github.com/oasdiff/yaml3 v0.0.14 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
github.com/speakeasy-api/jsonpath v0.6.3 // indirect
github.com/speakeasy-api/openapi v1.24.0 // indirect
github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
github.com/yudai/pp v2.0.1+incompatible // indirect
golang.org/x/telemetry v0.0.0-20250908211612-aef8a434d053 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
golang.org/x/telemetry v0.0.0-20260708182218-49f421fb7959 // indirect
golang.org/x/tools/godoc v0.1.0-deprecated // indirect
)

Expand Down
Loading
Loading