Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 7 additions & 12 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ ci:
- any-glob-to-any-file: .buildkite/**
mixin:
- changed-files:
- any-glob-to-any-file: internal/ent/mixin/*
- any-glob-to-any-file: internal/ent/mixin/**
- any-glob-to-any-file: internal/ent/schema/mixin_*.go
privacy:
- changed-files:
- any-glob-to-any-file: internal/ent/privacy/*
- any-glob-to-any-file: internal/ent/privacy/**
dbschema:
- changed-files:
- any-glob-to-any-file: internal/ent/schema/*
- any-glob-to-any-file: internal/ent/schema/**
- any-glob-to-any-file: internal/ent/historyschema/**
- any-glob-to-any-file: db/**
graphqlschema:
- changed-files:
- any-glob-to-any-file: internal/graphapi/schema/**
Expand All @@ -46,11 +49,7 @@ httpserve:
graphapi:
- changed-files:
- any-glob-to-any-file: internal/graphapi/**
- any-glob-to-any-file: internal/graphapi/query/**
- any-glob-to-any-file: internal/graphapi/schema/**
- any-glob-to-any-file: internal/graphapi/generated/**
- any-glob-to-any-file: internal/graphapi/model/**
- any-glob-to-any-file: internal/graphapi/clientschema/**
- any-glob-to-any-file: internal/graphapi/**/**
codegenerators:
- changed-files:
- any-glob-to-any-file: internal/graphapi/generate/gen_schema.go
Expand All @@ -59,10 +58,6 @@ codegenerators:
- any-glob-to-any-file: internal/graphapi/generate/.gqlgenc.yml
- any-glob-to-any-file: internal/ent/generate/entc.go
- any-glob-to-any-file: internal/ent/templates/**
coreclient:
- changed-files:
- any-glob-to-any-file: pkg/openlaneclient/**
- any-glob-to-any-file: internal/graphapi/query/**
config:
- changed-files:
- any-glob-to-any-file: config/**
Expand Down
9 changes: 6 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ linters:
- bodyclose
- err113
- gocritic
# - gocyclo # temporarily disabled due to high complexity in some files, and already caught by sonar lint
- gosec
- misspell
- mnd
Expand All @@ -23,17 +22,20 @@ linters:
- legacy
- std-error-handling
paths:
- internal/graphapi/model/gen_models.go
- internal/graphapi/generated/gen_models.go
- internal/graphapi/historygenerated/gen_models.go
- pkg/openlaneclient/graphclient.go
- pkg/testutils/*
- internal/ent/generated/*
- internal/ent/historygenerated/*
- internal/ent/templates/*
- jsonschema/templates/*
- pkg/objects/mocks/*
- pkg/corejobs/internal/cloudflare/mocks/*
- pkg/corejobs/internal/olclient/mocks/*
- internal/graphapi/generate/*
- internal/graphapi/generated/*
- internal/graphapi/historygenerated/*
- pkg/entitlements/test/*
- cmd/cli/cmd/*
- pkg/sleuth/static/*
Expand All @@ -49,7 +51,8 @@ formatters:
generated: lax
warn-unused: true
paths:
- internal/graphapi/model/gen_models.go
- internal/graphapi/generated/gen_models.go
- internal/graphapi/historygenerated/gen_models.go
- pkg/openlaneclient/graphclient.go
- pkg/testutils/*
- pkg/entitlements/test/*
Expand Down
8 changes: 0 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,3 @@ repos:
entry: npx format-graphql@1.5.0 --write=true
language: node
files: 'query/.*\.graphql$'
- repo: local
hooks:
- id: generate
name: Run Go Generate
description: This hook runs go generate on the project
entry: go-generate-fast ./...
language: golang
files: \.(go|graphql|tmpl)$
2 changes: 1 addition & 1 deletion .task/checksum/generate-ent-smart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
920cc1b62d0b51418f5c7fa5458661
8972fda43d0de1a6423798513051f928
2 changes: 1 addition & 1 deletion .task/checksum/generate-graphql-smart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2cd16ebb2942c9d5ef4b6d7d233d242f
b4d554dde6a3dba0398353fb5c8d4393
2 changes: 1 addition & 1 deletion .task/checksum/generate-others-smart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
71c0a210f2f4665954dd4a2f840fe723
c317845ae0df06842bed49eb3a221f55
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,6 @@ You can load up a local openFGA environment with the compose setup in this
repository; `task fga:up` - this will launch an interactive playground where you
can model permissions model(s) or changes to the models

### Windmill

We use Windmill to run automated scripts periodically amongst others. You can
load up a local instance by running `task docker:windmill:up`. This will
launch the Windmill UI console where you can manage your tokens and/or workspaces

### Creating a new Schema

To ease the effort required to add additional schemas into the system a
Expand Down
44 changes: 5 additions & 39 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,11 @@ env:
# for test container settings
RYUK_CONNECTION_TIMEOUT: "5m"
RYUK_VERBOSE: "true"
## generate env vars for caching
GO_GENERATE_FAST_DEBUG: "false" # set to true to debug go-generate-fast
GO_GENERATE_FAST_CACHE_DIR: "/tmp/.cache"
GO_GENERATE_FAST_DISABLE: "false" # set to true to disable cached entries
GO_GENERATE_FAST_RECACHE: "false" # set to true to recache all entries
COMPOSE_PROJECT_NAME: openlane
# CLI demo environment variables
ADMIN_USER_EMAIL: "admin@admin.theopenlane.io"
GO_INLINE_FLAG: "-gcflags=all=-l"

# load the .env file for windmill
dotenv: ['docker/configs/windmill/.env']

tasks:
default:
silent: true
Expand All @@ -62,25 +54,9 @@ tasks:
- go generate ./...
- task: tidy

generate:
desc: a combination of the ent, graph, and gqlgen tasks which are required to fully generate the necessary graph, server, resolvers, client, etc.
env:
GOFLAGS: "{{.GO_INLINE_FLAG}}"
cmds:
- go-generate-fast ./...
- task: tidy

regenerate:
desc: a combination of the ent, graph, and gqlgen tasks which are required to fully generate the necessary graph, server, resolvers, client, etc.
env:
GO_GENERATE_FAST_RECACHE: "true"
GOFLAGS: "{{.GO_INLINE_FLAG}}"
cmds:
- go-generate-fast ./...
- task: tidy

generate:checksums:
desc: Generate with checksum tracking for CI optimization
aliases: [regenerate, generate]
env:
GOFLAGS: "{{.GO_INLINE_FLAG}}"
cmds:
Expand All @@ -90,7 +66,7 @@ tasks:
- task: tidy

generate:ent:smart:
internal: true
aliases: ['generate:ent']
env:
GOFLAGS: "{{.GO_INLINE_FLAG}}"
sources:
Expand All @@ -100,12 +76,14 @@ tasks:
- internal/ent/templates/**/*
generates:
- internal/ent/generated/**/*.go
- internal/graphapi/schema/ent.graphql
- internal/graphapi/schema/history/ent.graphql
method: checksum
cmds:
- go generate internal/ent/generate/generate.go

generate:graphql:smart:
internal: true
aliases: ['generate:gql']
env:
GOFLAGS: "{{.GO_INLINE_FLAG}}"
sources:
Expand Down Expand Up @@ -201,18 +179,6 @@ tasks:
- sh: '[[ -n "${BUILDKITE_TAG:-}" ]]'
msg: "Only runs on tag builds"

generate:ent:
desc: generate ent models
cmds:
- go-generate-fast internal/ent/generate/generate.go
- task: tidy

generate:gql:
desc: generate gql graphql models and resolvers, along with the client
cmds:
- go-generate-fast internal/graphapi/generate/generate.go
- task: tidy

## Go tasks
go:lint:
desc: runs golangci-lint (optionally only on changed files with --changed=true)
Expand Down
1 change: 1 addition & 0 deletions cmd/catalog/reconcile/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/theopenlane/core/config"
"github.com/theopenlane/core/internal/ent/generated"

_ "github.com/theopenlane/core/internal/ent/generated/runtime"
"github.com/theopenlane/core/internal/entdb"
"github.com/theopenlane/core/internal/entitlements/reconciler"
Expand Down
28 changes: 2 additions & 26 deletions cmd/cli/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,13 @@ tasks:
desc: generates a new cli cmd
interactive: true
cmds:
- go run --tags cli ../../pkg/gencmd/generate/main.go generate

generate:ro:
desc: generates a new cli cmd with only the read cmds
interactive: true
cmds:
- go run --tags cli ../../pkg/gencmd/generate/main.go generate --read-only
- go run --tags cli,gencmd ../../pkg/gencmd/generate/main.go generate

generate:enum:
desc: generates a new enum
interactive: true
cmds:
- go run --tags cli ../../pkg/genenum/cmd/main.go

generate:all:history:
desc: generates a new cli cmd for all missing history commands from the query/ directory
vars:
SCHEMAS:
sh: ls -d ../../query/* | cut -f1 |grep history | sed -e "s/query\///" |sed -e "s/.graphql//" | sed -e "s/history/History/" | sed -e "s/..\/..\///"
cmds:
- for: {var: SCHEMAS, as: SCHEMA}
cmd: go run --tags cli ../../pkg/gencmd/generate/main.go generate --name={{ .SCHEMA }} --read-only

generate:all:history:force:
desc: regenerates the cli cmd for all history commands from the query/ directory, this will overwrite any changes made to the generated files
vars:
SCHEMAS:
sh: ls -d ../../query/* | cut -f1 |grep history | sed -e "s/query\///" |sed -e "s/.graphql//" | sed -e "s/history/History/" | sed -e "s/..\/..\///"
cmds:
- for: {var: SCHEMAS, as: SCHEMA}
cmd: go run --tags cli ../../pkg/gencmd/generate/main.go generate --name={{ .SCHEMA }} --read-only --force
- go run --tags genenum ../../pkg/genenum/cmd/main.go

# === Organization Management ===
org:create:
Expand Down
4 changes: 0 additions & 4 deletions cmd/cli/cmd/contacthistory/doc.go

This file was deleted.

55 changes: 0 additions & 55 deletions cmd/cli/cmd/contacthistory/get.go

This file was deleted.

Loading
Loading