From d87a3874dc9488cc16e50bc08be61c332269ec5a Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Wed, 2 Feb 2022 21:37:57 +0530 Subject: [PATCH 1/5] ci: init GitHub Actions CI for Keto --- .github/workflows/ci.yaml | 245 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..fd13fb803 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,245 @@ +name: CI Tasks for Ory Keto +on: + push: + branches: + - master + tags: + - '*' + pull_request: + + +jobs: + validate: + name: Run lints and checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: ^1.17 + - run: go list -json > go.list + - name: Run nancy + uses: sonatype-nexus-community/nancy-github-action@v1.0.2 + - name: Run prettier + uses: ory/ci/prettier@master + - name: Run prettier (docs) + uses: ory/ci/prettier@master + with: + dir: docs + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v2 + env: + GOGC: 100 + with: + args: --timeout 10m0s --issues-exit-code=0 + skip-go-installation: true + skip-pkg-cache: true + - name: Test documentation examples + run: make test-docs-samples + + test: + name: Run tests + runs-on: ubuntu-latest + services: + postgres: + image: postgres:11.8 + env: + POSTGRES_DB: keto + POSTGRES_PASSWORD: test + POSTGRES_USER: test + ports: + - 5432:5432 + mysql: + image: mysql:8.0 + env: + MYSQL_ROOT_PASSWORD: test + ports: + - 3306:3306 + env: + TEST_DATABASE_POSTGRESQL: postgres://test:test@localhost:5432/keto?sslmode=disable + TEST_DATABASE_MYSQL: mysql://root:test@(localhost:3306)/mysql?parseTime=true&multiStatements=true + TEST_DATABASE_COCKROACHDB: cockroach://root@localhost:26257/defaultdb?sslmode=disable + steps: + - run: | + docker create --name cockroach -p 26257:26257 \ + cockroachdb/cockroach:v20.2.5 start-single-node --insecure + docker start cockroach + name: Start CockroachDB + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: ^1.17 + - run: | + make .bin/goveralls + make .bin/go-acc + - run: | + cd proto + go mod tidy + go test ./... + - run: .bin/go-acc -o coverage.txt ./... -- -v -tags sqlite -p 1 + - run: | + .bin/goveralls -service=github -coverprofile=coverage.txt + env: + COVERALLS_TOKEN: ${{ github.token }} + + test-race: + name: Run race tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: ^1.17 + - run: | + go test -tags sqlite -race -short -v -p 1 ./... + + docs-build: + runs-on: ubuntu-latest + name: Build and publish docs + if: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref_name == 'master' }} + needs: + - test + - test-race + - validate + steps: + - uses: ory/ci/docs/build@master + with: + token: ${{ secrets.ORY_BOT_PAT }} + swag-spec-location: spec/api.json + + docs-cli: + runs-on: ubuntu-latest + name: Build CLI docs + needs: + - test + - test-race + - validate + steps: + - uses: ory/ci/docs/cli@master + with: + token: ${{ secrets.ORY_BOT_PAT }} + + changelog: + name: Generate changelog + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref_name == 'master' }} + needs: + - test + - test-race + - validate + - docs-build + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: ory/ci/changelog@master + with: + token: ${{ secrets.ORY_BOT_PAT }} + + sdk-generate: + name: Generate SDKs + runs-on: ubuntu-latest + if: ${{ github.ref_type == 'tag' || github.ref_name != 'master' || github.event_name == 'pull_request' }} + needs: + - test + - test-race + - validate + - docs-build + steps: + - uses: ory/ci/sdk/generate@master + with: + token: ${{ secrets.ORY_BOT_PAT }} + app-name: Ory_keto + swag-spec-ignore: internal/httpclient proto/ory/keto docker + swag-spec-location: spec/api.json + + sdk-release: + name: Release SDKs + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + needs: + - test + - test-race + - validate + - docs-build + - sdk-generate + - release + steps: + - uses: ory/ci/sdk/release@master + with: + token: ${{ secrets.ORY_BOT_PAT }} + app-name: Ory_keto + swag-spec-ignore: internal/httpclient proto/ory/keto docker + swag-spec-location: spec/api.json + + release: + name: Generate release + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + needs: + - test + - test-race + - validate + - changelog + - docs-build + steps: + - uses: ory/ci/releaser@master + with: + token: ${{ secrets.ORY_BOT_PAT }} + goreleaser_key: ${{ secrets.GORELEASER_KEY }} + cosign_pwd: ${{ secrets.COSIGN_PWD }} + docker_username: ${{ secrets.DOCKERHUB_USERNAME }} + docker_password: ${{ secrets.DOCKERHUB_PASSWORD }} + + render-version-schema: + name: Render version schema + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + needs: + - release + steps: + - uses: ory/ci/releaser/render-version-schema@master + with: + schema-path: spec/config.json + + newsletter-draft: + name: Draft newsletter + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + needs: + - release + steps: + - uses: ory/ci/newsletter@master + with: + mailchimp_list_id: 058a056618 + mailchmip_segment_id: 11398953 + mailchimp_api_key: ${{ secrets.MAILCHIMP_API_KEY }} + draft: 'true' + ssh_key: ${{ secrets.ORY_BOT_SSH_KEY }} + + slack-approval-notification: + name: Pending approval Slack notification + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + needs: + - newsletter-draft + steps: + - uses: ory/ci/newsletter/slack-notify@master + with: + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + + newsletter-send: + name: Send newsletter + runs-on: ubuntu-latest + needs: + - newsletter-draft + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + environment: production + steps: + - uses: ory/ci/newsletter@master + with: + mailchimp_list_id: 058a056618 + mailchmip_segment_id: 11398953 + mailchimp_api_key: ${{ secrets.MAILCHIMP_API_KEY }} + draft: 'false' + ssh_key: ${{ secrets.ORY_BOT_SSH_KEY }} From 9e9f641295c3973c033c5893aa3c3c628607db08 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Thu, 3 Feb 2022 08:48:59 +0000 Subject: [PATCH 2/5] autogen(docs): generate cli docs --- docs/scripts/config.js | 156 +++++++++++----------- docs/src/theme/CodeFromRemote.js | 26 ++-- docs/src/theme/ketoRelationTuplesPrism.js | 3 +- 3 files changed, 95 insertions(+), 90 deletions(-) diff --git a/docs/scripts/config.js b/docs/scripts/config.js index 058a030e0..ce2bc434d 100644 --- a/docs/scripts/config.js +++ b/docs/scripts/config.js @@ -45,98 +45,100 @@ if (process.argv.length !== 3 || process.argv[1] === 'help') { const config = require(path.resolve(process.argv[2])) -const enhance = (schema, parents = []) => (item) => { - const key = item.key.value - - const path = [ - ...parents.map((parent) => ['properties', parent]), - ['properties', key] - ].flat() - - if (['title', 'description'].find((f) => path[path.length - 1] === f)) { - return - } +const enhance = + (schema, parents = []) => + (item) => { + const key = item.key.value + + const path = [ + ...parents.map((parent) => ['properties', parent]), + ['properties', key] + ].flat() + + if (['title', 'description'].find((f) => path[path.length - 1] === f)) { + return + } - const comments = [`# ${pathOr(key, [...path, 'title'], schema)} ##`, ''] + const comments = [`# ${pathOr(key, [...path, 'title'], schema)} ##`, ''] - const description = pathOr('', [...path, 'description'], schema) - if (description) { - comments.push(' ' + description.split('\n').join('\n '), '') - } + const description = pathOr('', [...path, 'description'], schema) + if (description) { + comments.push(' ' + description.split('\n').join('\n '), '') + } - const defaultValue = pathOr('', [...path, 'default'], schema) - if (defaultValue || defaultValue === false) { - comments.push(' Default value: ' + defaultValue, '') - } + const defaultValue = pathOr('', [...path, 'default'], schema) + if (defaultValue || defaultValue === false) { + comments.push(' Default value: ' + defaultValue, '') + } - const enums = pathOr('', [...path, 'enum'], schema) - if (enums && Array.isArray(enums)) { - comments.push( - ' One of:', - ...YAML.stringify(enums) - .split('\n') - .map((i) => ` ${i}`) - ) // split always returns one empty object so no need for newline - } + const enums = pathOr('', [...path, 'enum'], schema) + if (enums && Array.isArray(enums)) { + comments.push( + ' One of:', + ...YAML.stringify(enums) + .split('\n') + .map((i) => ` ${i}`) + ) // split always returns one empty object so no need for newline + } - const min = pathOr('', [...path, 'minimum'], schema) - if (min || min === 0) { - comments.push(` Minimum value: ${min}`, '') - } + const min = pathOr('', [...path, 'minimum'], schema) + if (min || min === 0) { + comments.push(` Minimum value: ${min}`, '') + } - const max = pathOr('', [...path, 'maximum'], schema) - if (max || max === 0) { - comments.push(` Maximum value: ${max}`, '') - } + const max = pathOr('', [...path, 'maximum'], schema) + if (max || max === 0) { + comments.push(` Maximum value: ${max}`, '') + } - const examples = pathOr('', [...path, 'examples'], schema) - if (examples) { - comments.push( - ' Examples:', - ...YAML.stringify(examples) - .split('\n') - .map((i) => ` ${i}`) - ) // split always returns one empty object so no need for newline - } + const examples = pathOr('', [...path, 'examples'], schema) + if (examples) { + comments.push( + ' Examples:', + ...YAML.stringify(examples) + .split('\n') + .map((i) => ` ${i}`) + ) // split always returns one empty object so no need for newline + } - let hasChildren - if (item.value.items) { - item.value.items.forEach((item) => { - if (item.key) { - enhance(schema, [...parents, key])(item) - hasChildren = true - } - }) - } + let hasChildren + if (item.value.items) { + item.value.items.forEach((item) => { + if (item.key) { + enhance(schema, [...parents, key])(item) + hasChildren = true + } + }) + } - const showEnvVarBlockForObject = pathOr( - '', - [...path, 'showEnvVarBlockForObject'], - schema - ) - if (!hasChildren || showEnvVarBlockForObject) { - const env = [...parents, key].map((i) => i.toUpperCase()).join('_') - comments.push( - ' Set this value using environment variables on', - ' - Linux/macOS:', - ` $ export ${env}=`, - ' - Windows Command Line (CMD):', - ` > set ${env}=`, - '' + const showEnvVarBlockForObject = pathOr( + '', + [...path, 'showEnvVarBlockForObject'], + schema ) - - // Show this if the config property is an object, to call out how to specify the env var - if (hasChildren) { + if (!hasChildren || showEnvVarBlockForObject) { + const env = [...parents, key].map((i) => i.toUpperCase()).join('_') comments.push( - ' This can be set as an environment variable by supplying it as a JSON object.', + ' Set this value using environment variables on', + ' - Linux/macOS:', + ` $ export ${env}=`, + ' - Windows Command Line (CMD):', + ` > set ${env}=`, '' ) + + // Show this if the config property is an object, to call out how to specify the env var + if (hasChildren) { + comments.push( + ' This can be set as an environment variable by supplying it as a JSON object.', + '' + ) + } } - } - item.commentBefore = comments.join('\n') - item.spaceBefore = true -} + item.commentBefore = comments.join('\n') + item.spaceBefore = true + } new Promise((resolve, reject) => { parser.dereference( diff --git a/docs/src/theme/CodeFromRemote.js b/docs/src/theme/CodeFromRemote.js index a3609647f..189028c20 100644 --- a/docs/src/theme/CodeFromRemote.js +++ b/docs/src/theme/CodeFromRemote.js @@ -53,21 +53,23 @@ const findLine = (needle, haystack) => { return index } -const transform = ({ startAt, endAt }) => (content) => { - let lines = content.split('\n') +const transform = + ({ startAt, endAt }) => + (content) => { + let lines = content.split('\n') - const startIndex = findLine(startAt, lines) - if (startIndex > 0) { - lines = ['// ...', ...lines.slice(startIndex, -1)] - } + const startIndex = findLine(startAt, lines) + if (startIndex > 0) { + lines = ['// ...', ...lines.slice(startIndex, -1)] + } - const endIndex = findLine(endAt, lines) - if (endIndex > 0) { - lines = [...lines.slice(0, endIndex + 1), '// ...'] - } + const endIndex = findLine(endAt, lines) + if (endIndex > 0) { + lines = [...lines.slice(0, endIndex + 1), '// ...'] + } - return lines.join('\n') -} + return lines.join('\n') + } const CodeFromRemote = (props) => { const { src, title } = props diff --git a/docs/src/theme/ketoRelationTuplesPrism.js b/docs/src/theme/ketoRelationTuplesPrism.js index 513d653df..9a00e5bbf 100644 --- a/docs/src/theme/ketoRelationTuplesPrism.js +++ b/docs/src/theme/ketoRelationTuplesPrism.js @@ -44,7 +44,8 @@ export default (prism) => (prism.languages['keto-relation-tuples'] = { comment: /\/\/.*(\n|$)/, 'relation-tuple': { - pattern: /([^:#@()\n]+:)?([^:#@()\n]+)#([^:#@()\n]+)@?((\(([^:#@()\n]+:)?([^:#@()\n]+)#([^:#@()\n]*)\))|([^:#@()\n]+))/, + pattern: + /([^:#@()\n]+:)?([^:#@()\n]+)#([^:#@()\n]+)@?((\(([^:#@()\n]+:)?([^:#@()\n]+)#([^:#@()\n]*)\))|([^:#@()\n]+))/, inside: { namespace, object, From 7976c16cddf0d5134b97aa58c76ee57006ad7d52 Mon Sep 17 00:00:00 2001 From: ory-bot <60093411+ory-bot@users.noreply.github.com> Date: Thu, 3 Feb 2022 08:56:21 +0000 Subject: [PATCH 3/5] autogen(docs): generate cli docs --- docs/docs/cli/keto-check.md | 2 +- docs/docs/cli/keto-expand.md | 2 +- docs/docs/cli/keto-migrate-down.md | 2 +- docs/docs/cli/keto-migrate-status.md | 2 +- docs/docs/cli/keto-migrate-up.md | 2 +- docs/docs/cli/keto-migrate.md | 2 +- docs/docs/cli/keto-namespace-migrate-legacy.md | 2 +- docs/docs/cli/keto-namespace-migrate.md | 2 +- docs/docs/cli/keto-namespace-validate.md | 2 +- docs/docs/cli/keto-namespace.md | 2 +- docs/docs/cli/keto-relation-tuple-create.md | 2 +- docs/docs/cli/keto-relation-tuple-delete-all.md | 2 +- docs/docs/cli/keto-relation-tuple-delete.md | 2 +- docs/docs/cli/keto-relation-tuple-get.md | 2 +- docs/docs/cli/keto-relation-tuple-parse.md | 2 +- docs/docs/cli/keto-relation-tuple.md | 2 +- docs/docs/cli/keto-serve.md | 2 +- docs/docs/cli/keto-status.md | 2 +- docs/docs/cli/keto-version.md | 2 +- docs/docs/cli/keto.md | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/docs/cli/keto-check.md b/docs/docs/cli/keto-check.md index 5627d3bc5..4dbabfe3b 100644 --- a/docs/docs/cli/keto-check.md +++ b/docs/docs/cli/keto-check.md @@ -37,7 +37,7 @@ keto check <subject> <relation> <namespace> <object> [fl ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-expand.md b/docs/docs/cli/keto-expand.md index 0589f03b8..b0267dc0f 100644 --- a/docs/docs/cli/keto-expand.md +++ b/docs/docs/cli/keto-expand.md @@ -36,7 +36,7 @@ keto expand <relation> <namespace> <object> [flags] ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-migrate-down.md b/docs/docs/cli/keto-migrate-down.md index 5f107dca9..2ca50b228 100644 --- a/docs/docs/cli/keto-migrate-down.md +++ b/docs/docs/cli/keto-migrate-down.md @@ -35,7 +35,7 @@ keto migrate down <steps> [flags] ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-migrate-status.md b/docs/docs/cli/keto-migrate-status.md index 154640dd1..be102483b 100644 --- a/docs/docs/cli/keto-migrate-status.md +++ b/docs/docs/cli/keto-migrate-status.md @@ -34,7 +34,7 @@ keto migrate status [flags] ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-migrate-up.md b/docs/docs/cli/keto-migrate-up.md index aff6332a3..2865f4f7b 100644 --- a/docs/docs/cli/keto-migrate-up.md +++ b/docs/docs/cli/keto-migrate-up.md @@ -43,7 +43,7 @@ keto migrate up [flags] ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-migrate.md b/docs/docs/cli/keto-migrate.md index a06fac2de..64b089d75 100644 --- a/docs/docs/cli/keto-migrate.md +++ b/docs/docs/cli/keto-migrate.md @@ -28,7 +28,7 @@ Commands to migrate the database. This does not affect namespaces. Use ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-namespace-migrate-legacy.md b/docs/docs/cli/keto-namespace-migrate-legacy.md index ffa69b0a3..fd8c7d4f1 100644 --- a/docs/docs/cli/keto-namespace-migrate-legacy.md +++ b/docs/docs/cli/keto-namespace-migrate-legacy.md @@ -42,7 +42,7 @@ keto namespace migrate legacy [<namespace-name>] [flags] ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-namespace-migrate.md b/docs/docs/cli/keto-namespace-migrate.md index e8dee9cdb..bebabfda7 100644 --- a/docs/docs/cli/keto-namespace-migrate.md +++ b/docs/docs/cli/keto-namespace-migrate.md @@ -23,7 +23,7 @@ Migrate a namespace ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-namespace-validate.md b/docs/docs/cli/keto-namespace-validate.md index d98d246c2..a2241bbe4 100644 --- a/docs/docs/cli/keto-namespace-validate.md +++ b/docs/docs/cli/keto-namespace-validate.md @@ -33,7 +33,7 @@ keto namespace validate <namespace.yml> [<namespace2.yml> ...] | val ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-namespace.md b/docs/docs/cli/keto-namespace.md index a47d60528..914371eb3 100644 --- a/docs/docs/cli/keto-namespace.md +++ b/docs/docs/cli/keto-namespace.md @@ -23,7 +23,7 @@ Read and manipulate namespaces ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-relation-tuple-create.md b/docs/docs/cli/keto-relation-tuple-create.md index be42f1351..fa5fab841 100644 --- a/docs/docs/cli/keto-relation-tuple-create.md +++ b/docs/docs/cli/keto-relation-tuple-create.md @@ -37,7 +37,7 @@ keto relation-tuple create <relation-tuple.json> [<relation-tuple-dir&g ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-relation-tuple-delete-all.md b/docs/docs/cli/keto-relation-tuple-delete-all.md index 02f189830..b9b20542c 100644 --- a/docs/docs/cli/keto-relation-tuple-delete-all.md +++ b/docs/docs/cli/keto-relation-tuple-delete-all.md @@ -45,7 +45,7 @@ keto relation-tuple delete-all [flags] ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-relation-tuple-delete.md b/docs/docs/cli/keto-relation-tuple-delete.md index aa9c6bbfc..5f69deeff 100644 --- a/docs/docs/cli/keto-relation-tuple-delete.md +++ b/docs/docs/cli/keto-relation-tuple-delete.md @@ -38,7 +38,7 @@ keto relation-tuple delete <relation-tuple.json> [<relation-tuple-dir&g ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-relation-tuple-get.md b/docs/docs/cli/keto-relation-tuple-get.md index e7c24616d..e2290a8bd 100644 --- a/docs/docs/cli/keto-relation-tuple-get.md +++ b/docs/docs/cli/keto-relation-tuple-get.md @@ -42,7 +42,7 @@ keto relation-tuple get [flags] ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-relation-tuple-parse.md b/docs/docs/cli/keto-relation-tuple-parse.md index 7503679fc..999b13f40 100644 --- a/docs/docs/cli/keto-relation-tuple-parse.md +++ b/docs/docs/cli/keto-relation-tuple-parse.md @@ -35,7 +35,7 @@ keto relation-tuple parse [flags] ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-relation-tuple.md b/docs/docs/cli/keto-relation-tuple.md index e3c90b367..3dd2c8dd1 100644 --- a/docs/docs/cli/keto-relation-tuple.md +++ b/docs/docs/cli/keto-relation-tuple.md @@ -23,7 +23,7 @@ Read and manipulate relation tuples ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-serve.md b/docs/docs/cli/keto-serve.md index dd37544e9..434c79b0d 100644 --- a/docs/docs/cli/keto-serve.md +++ b/docs/docs/cli/keto-serve.md @@ -41,7 +41,7 @@ keto serve [flags] ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-status.md b/docs/docs/cli/keto-status.md index 73c9b7427..5999b7ebe 100644 --- a/docs/docs/cli/keto-status.md +++ b/docs/docs/cli/keto-status.md @@ -37,7 +37,7 @@ keto status [flags] ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto-version.md b/docs/docs/cli/keto-version.md index 99b146c84..d126276de 100644 --- a/docs/docs/cli/keto-version.md +++ b/docs/docs/cli/keto-version.md @@ -27,7 +27,7 @@ keto version [flags] ### Options inherited from parent commands ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) ``` ### SEE ALSO diff --git a/docs/docs/cli/keto.md b/docs/docs/cli/keto.md index 071746245..eaa9422d1 100644 --- a/docs/docs/cli/keto.md +++ b/docs/docs/cli/keto.md @@ -17,7 +17,7 @@ Global and consistent permission and authorization server ### Options ``` - -c, --config strings Config files to load, overwriting in the order specified. (default [/home/circleci/keto.yml]) + -c, --config strings Config files to load, overwriting in the order specified. (default [/home/runner/keto.yml]) -h, --help help for keto ``` From 734a97ae2c8943f3edfb411ac1e2d1b1d867b961 Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Thu, 3 Feb 2022 14:27:46 +0530 Subject: [PATCH 4/5] chore: remove CircleCI config --- .circleci/config.yml | 231 ------------------------------------------- 1 file changed, 231 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 11b108a3c..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,231 +0,0 @@ -version: 2.1 - -orbs: - sdk: ory/sdk@0.1.52 - changelog: ory/changelog@0.1.10 - goreleaser: ory/goreleaser@0.1.34 - slack: circleci/slack@3.4.2 - nancy: ory/nancy@0.0.18 - docs: ory/docs@0.0.11 - golangci: ory/golangci@0.0.18 - go: circleci/go@1.5.0 - prettier: ory/prettier@0.0.11 - -jobs: - test: - docker: - - image: cimg/go:1.17 - environment: - TEST_DATABASE_POSTGRESQL: postgres://test:test@localhost:5432/keto?sslmode=disable - TEST_DATABASE_MYSQL: mysql://root:test@(localhost:3306)/mysql?parseTime=true&multiStatements=true - TEST_DATABASE_COCKROACHDB: cockroach://root@localhost:26257/defaultdb?sslmode=disable - - image: postgres:11.8 - environment: - POSTGRES_USER: test - POSTGRES_PASSWORD: test - POSTGRES_DB: keto - - image: mysql:8.0 - environment: - MYSQL_ROOT_PASSWORD: test - - image: cockroachdb/cockroach:v20.2.4 - command: start-single-node --insecure - steps: - - checkout - - setup_remote_docker - - # Installation - - go/load-cache - - go/mod-download - - run: |- - make .bin/goveralls - make .bin/go-acc - - run: go mod tidy - - go/save-cache - - - run: cd proto; go mod tidy - - run: cd proto; go test ./... - - # Tests - - run: .bin/go-acc -o coverage.txt ./... -- -v -tags sqlite -p 1 - - # Submit coverage details - - run: test -z "$CIRCLE_PR_NUMBER" && .bin/goveralls -service=circle-ci -coverprofile=coverage.txt -repotoken=$COVERALLS_REPO_TOKEN || echo "forks are not allowed to push to coveralls" - - test-race: - docker: - - image: cimg/go:1.17 - steps: - - checkout - - go/load-cache - - go/mod-download - - run: go mod tidy - - go/save-cache - - run: go test -tags sqlite -race -short -v -p 1 ./... - - validate: - docker: - - image: cimg/go:1.17-node - steps: - - checkout - - - run: sudo npm i -g npm@7 - - - go/load-cache - - go/mod-download - - run: go mod tidy - - go/save-cache - - - golangci/install - - golangci/lint - - - nancy/install - - run: | - export PATH=$HOME/.bin:$PATH - go list -json -deps | nancy sleuth - - - goreleaser/install - - goreleaser/check - - - prettier/install - - prettier/check - - prettier/install: - dir: docs/ - - prettier/check: - dir: docs/ - - # Test documentation examples - - run: make test-docs-samples - clidocs: - docker: - - image: cimg/go:1.17-node - steps: - - checkout - - run: - name: Build and push CLI docs - command: "bash <(curl -s https://raw.githubusercontent.com/ory/ci/master/src/scripts/docs/cli.sh)" - -workflows: - version: 2 - "test, build, and relase": - jobs: - - validate: - filters: - tags: - only: /.*/ - - test: - filters: - tags: - only: /.*/ - - test-race: - filters: - tags: - only: /.*/ - - changelog/generate: - requires: - - test - - test-race - - validate - filters: - tags: - # We have two types of tags: v0.0.0-foo.0 and proto/v0.0.0-foo.0 - # This should only run for releases of Keto itself - only: /v.*/ - branches: - only: master - - clidocs - - docs/build: - requires: - - test - - test-race - - validate - swag-spec-location: spec/api.json - swag-spec-ignore: internal/httpclient proto/ory/keto docker - filters: - tags: - # We have two types of tags: v0.0.0-foo.0 and proto/v0.0.0-foo.0 - # This should only run for releases of Keto itself - only: /v.*/ - branches: - only: master - - sdk/generate: - appname: Ory_Keto - specignorepgks: internal/httpclient proto/ory/keto docker - swagpath: spec/api.json - requires: - - test - - test-race - - validate - - sdk/release: - specignorepgks: internal/httpclient proto/ory/keto docker - swagpath: spec/api.json - requires: - - test - - test-race - - validate - - goreleaser/release - filters: - tags: - # We have two types of tags: v0.0.0-foo.0 and proto/v0.0.0-foo.0 - # This should only run for releases of Keto itself - only: /v.*/ - branches: - ignore: /.*/ - - goreleaser/release: - requires: - - test - - test-race - - validate - filters: - branches: - ignore: /.*/ - tags: - # We have two types of tags: v0.0.0-foo.0 and proto/v0.0.0-foo.0 - # This should only run for releases of Keto itself - only: /v.*/ - - goreleaser/render-version-schema: - requires: - - goreleaser/release - schema-path: .schema/config.schema.json - filters: - tags: - # We have two types of tags: v0.0.0-foo.0 and proto/v0.0.0-foo.0 - # This should only run for releases of Keto itself - only: /v.*/ - - goreleaser/newsletter-draft: - chimp-list: f605a41b53 - chimp-segment: 6479489 - requires: - - goreleaser/release - filters: - tags: - # We have two types of tags: v0.0.0-foo.0 and proto/v0.0.0-foo.0 - # This should only run for releases of Keto itself - only: /v.*/ - - slack/approval-notification: - message: Pending approval - channel: release-automation - requires: - - goreleaser/newsletter-draft - filters: - tags: - # We have two types of tags: v0.0.0-foo.0 and proto/v0.0.0-foo.0 - # This should only run for releases of Keto itself - only: /v.*/ - - newsletter-approval: - type: approval - requires: - - goreleaser/newsletter-draft - filters: - tags: - # We have two types of tags: v0.0.0-foo.0 and proto/v0.0.0-foo.0 - # This should only run for releases of Keto itself - only: /v.*/ - - goreleaser/newsletter-send: - chimp-list: f605a41b53 - requires: - - newsletter-approval - filters: - tags: - # We have two types of tags: v0.0.0-foo.0 and proto/v0.0.0-foo.0 - # This should only run for releases of Keto itself - only: /v.*/ From 763f47df0b1ee4d3bcecf9ea1a3ef4d8ae394b1f Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Thu, 3 Feb 2022 22:22:06 +0530 Subject: [PATCH 5/5] chore: don't depend on docs-build for sdk --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fd13fb803..09047fc86 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -144,7 +144,6 @@ jobs: - test - test-race - validate - - docs-build steps: - uses: ory/ci/sdk/generate@master with: