Skip to content

Commit

Permalink
add update graph tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ecordell committed Feb 9, 2023
1 parent 2cd5907 commit b3c84aa
Show file tree
Hide file tree
Showing 32 changed files with 1,121 additions and 684 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,25 @@ jobs:
with:
version: "latest"
args: "test:e2e"
- name: "Check if validated update graph has changed"
uses: "tj-actions/verify-changed-files@v13"
id: "verify-changed-graph"
with:
files: |
validated-update-graph.yaml
- name: "Commit validated update graph"
uses: "EndBug/add-and-commit@v9"
if: |
steps.verify-changed-graph.outputs.files_changed == 'true'
with:
author_name: "Authzed, Inc."
author_email: "[email protected]"
committer_name: "GitHub Actions"
committer_email: "41898282+github-actions[bot]@users.noreply.github.com"
message: "update validated graph after successful tests"
pathspec_error_handling: "exitImmediately"
push: true
tag: "${{github.ref_name}}"
- uses: "actions/upload-artifact@v2"
if: "always()"
# this upload step is really flaky, don't fail the job if it fails
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ release/
*.kubeconfig
*.test
e2e/cluster-state/**
e2e/*.lck
e2e/*.lck.*
4 changes: 4 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ output:
linters-settings:
goimports:
local-prefixes: "github.com/authzed/spicedb-operator"
stylecheck:
dot-import-whitelist:
- "github.com/onsi/ginkgo/v2"
- "github.com/onsi/gomega"
linters:
enable:
- "bidichk"
Expand Down
3 changes: 2 additions & 1 deletion .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
---
ignore: |
config/
default-operator-config.yaml
proposed-update-graph.yaml
validated-update-graph.yaml
e2e/
examples
pkg/crds
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ go get github.com/org/newdependency@version

Continuous integration enforces that `go mod tidy` has been run.

### Regenerating `default-operator-config.yaml`
### Regenerating `proposed-update-graph.yaml`

The default config can be regenerated whenever there is a new spicedb release.
The update graph can be regenerated whenever there is a new spicedb release.
CI will validate all new edges when there are changes to `proposed-update-graph.yaml` and will copy them into `validated-update-graph.yaml` if successful.

```go
cd tools
go generate ./...
mage gen:graph
```
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ RUN go build ./cmd/...

FROM alpine:3.17.0

COPY --from=builder /go/src/app/default-operator-config.yaml /opt/operator/config.yaml
COPY --from=builder /go/src/app/validated-update-graph.yaml /opt/operator/config.yaml
COPY --from=builder /go/src/app/spicedb-operator /usr/local/bin/spicedb-operator
ENTRYPOINT ["spicedb-operator"]
2 changes: 1 addition & 1 deletion Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: syntax=dockerfile
FROM gcr.io/distroless/base
COPY default-operator-config.yaml /opt/operator/config.yaml
COPY validated-update-graph.yaml /opt/operator/config.yaml
COPY --from=ghcr.io/grpc-ecosystem/grpc-health-probe:v0.4.12 /ko-app/grpc-health-probe /usr/local/bin/grpc_health_probe
COPY spicedb-operator /usr/local/bin/spicedb-operator
ENTRYPOINT ["spicedb-operator"]
Loading

0 comments on commit b3c84aa

Please sign in to comment.