-
Notifications
You must be signed in to change notification settings - Fork 0
Schemahero controller and schemahero table #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| intent: schemahero-controller | ||
| flavor: default | ||
| version: '0.1' | ||
| description: Deploys SchemaHero controller for automated database schema management | ||
| in Kubernetes environments | ||
| lifecycle: ENVIRONMENT_BOOTSTRAP | ||
| clouds: | ||
| - kubernetes | ||
| input_type: config | ||
| spec: | ||
| type: object | ||
| properties: | ||
| size: | ||
| type: object | ||
| title: Resource Configuration | ||
| description: CPU and memory resource limits for the schemahero controller | ||
| properties: | ||
| cpu: | ||
| type: string | ||
| title: CPU Limit | ||
| description: CPU resource limit for the schemahero controller | ||
| default: 100m | ||
| pattern: ^[0-9]+[m]?$ | ||
| memory: | ||
| type: string | ||
| title: Memory Limit | ||
| description: Memory resource limit for the schemahero controller | ||
| default: 150Mi | ||
| pattern: ^[0-9]+[KMGT]?[i]?[Bb]?$ | ||
| default: | ||
| cpu: 100m | ||
| memory: 150Mi | ||
| required: [] | ||
| inputs: | ||
| kubernetes_details: | ||
| type: '@outputs/kubernetes-cluster-details' | ||
| optional: false | ||
| default: | ||
| resource_type: kubernetes_cluster | ||
| resource_name: default | ||
| displayName: Kubernetes Cluster Details | ||
| description: Kubernetes cluster configuration and provider access | ||
| providers: | ||
| - kubernetes | ||
| - helm | ||
| outputs: | ||
| default: | ||
| type: '@outputs/schemahero-controller' | ||
| title: SchemaHero Controller Installation | ||
| sample: | ||
| kind: schemahero-controller | ||
| flavor: default | ||
| version: '0.1' | ||
| spec: | ||
| size: | ||
| cpu: 100m | ||
| memory: 150Mi | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||||||||||||||||
| locals { | ||||||||||||||||||||
| spec = lookup(var.instance, "spec", {}) | ||||||||||||||||||||
| size = lookup(local.spec, "size", {}) | ||||||||||||||||||||
| advanced = lookup(var.instance, "advanced", {}) | ||||||||||||||||||||
| user_supplied_helm_values = lookup(lookup(local.advanced, "default", {}), "values", {}) | ||||||||||||||||||||
| constructed_helm_values = <<VALUES | ||||||||||||||||||||
| resources: | ||||||||||||||||||||
| limits: | ||||||||||||||||||||
| cpu: ${lookup(local.size, "cpu", "100m")} | ||||||||||||||||||||
| memory: ${lookup(local.size, "memory", "150Mi")} | ||||||||||||||||||||
| schemahero: | ||||||||||||||||||||
| image: facetscloud/schemahero-manager:latest | ||||||||||||||||||||
| VALUES | ||||||||||||||||||||
|
Comment on lines
+11
to
+13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Pin the controller image instead of using Using the -schemahero:
- image: facetscloud/schemahero-manager:latest
+schemahero:
+ # Pinned for deterministic deployments
+ image: facetscloud/schemahero-manager:0.15.4📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| resource "helm_release" "schemahero" { | ||||||||||||||||||||
| chart = "${path.module}/schemahero-helm" | ||||||||||||||||||||
| name = "schemahero" | ||||||||||||||||||||
| atomic = false | ||||||||||||||||||||
| cleanup_on_fail = true | ||||||||||||||||||||
| namespace = "facets" | ||||||||||||||||||||
| values = [local.constructed_helm_values, yamlencode(local.user_supplied_helm_values), | ||||||||||||||||||||
|
Comment on lines
+21
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Parameterise the namespace – avoid hard-coding Tie the release to - namespace = "facets"
+ namespace = lookup(var.environment, "namespace", "default")📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| yamlencode({ | ||||||||||||||||||||
| tolerations = concat(var.environment.default_tolerations, var.inputs.kubernetes_details.attributes.legacy_outputs.facets_dedicated_tolerations) | ||||||||||||||||||||
| nodeSelector = var.inputs.kubernetes_details.attributes.legacy_outputs.facets_dedicated_node_selectors | ||||||||||||||||||||
| }) | ||||||||||||||||||||
|
Comment on lines
+24
to
+26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Guard optional maps with Direct attribute access explodes with - tolerations = concat(var.environment.default_tolerations, var.inputs.kubernetes_details.attributes.legacy_outputs.facets_dedicated_tolerations)
- nodeSelector = var.inputs.kubernetes_details.attributes.legacy_outputs.facets_dedicated_node_selectors
+ tolerations = concat(
+ lookup(var.environment, "default_tolerations", []),
+ try(var.inputs.kubernetes_details.attributes.legacy_outputs.facets_dedicated_tolerations, [])
+ )
+ nodeSelector = try(var.inputs.kubernetes_details.attributes.legacy_outputs.facets_dedicated_node_selectors, {})📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| ] | ||||||||||||||||||||
| recreate_pods = true | ||||||||||||||||||||
| } | ||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| locals { | ||
| output_interfaces = {} | ||
| output_attributes = {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| extends: | ||
| - '@commitlint/config-conventional' | ||
|
|
||
| rules: | ||
| type-enum: | ||
| - 2 | ||
| - always | ||
| - | ||
| - chore | ||
| - feat | ||
| - fix |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| crds/ | ||
| templates/ | ||
| .github/ | ||
| *.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| end_of_line = lf | ||
| charset = utf-8 | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true | ||
| indent_style = space | ||
| indent_size = 2 | ||
|
|
||
| [README.md] | ||
| max_line_length = 120 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ | ||
| package*.json | ||
| node_modules/ | ||
| .github/ | ||
| test/ | ||
| skaffold.yaml | ||
| .releaserc.yaml | ||
| .editorconfig | ||
| .dockerignore | ||
|
|
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| tagFormat: "${version}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| plugins: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '@semantic-release/commit-analyzer' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'semantic-release-commitlint' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "@semantic-release/release-notes-generator" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - preset: "conventionalcommits" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "@semantic-release/git" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - assets: [] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| messsage: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "@semantic-release/github" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - successComment: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| failComment: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '@eshepelyuk/semantic-release-helm-oci' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - registry: oci://ghcr.io/schemahero/helm | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| skipAppVersion: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+6
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. YAML structure breaks Semantic-Release – plugin entries & “messsage” typo Several list items are malformed (nested array instead of Minimal fix: plugins:
- '@semantic-release/commit-analyzer'
- 'semantic-release-commitlint'
- -
- - "@semantic-release/release-notes-generator"
- - preset: "conventionalcommits"
- -
- - "@semantic-release/git"
- - assets: []
- messsage: false
- -
- - "@semantic-release/github"
- - successComment: false
- failComment: false
- -
- - '@eshepelyuk/semantic-release-helm-oci'
- - registry: oci://ghcr.io/schemahero/helm
- skipAppVersion: true
+ - ['@semantic-release/release-notes-generator', {preset: 'conventionalcommits'}]
+ - ['@semantic-release/git', {assets: [], message: false}]
+ - ['@semantic-release/github', {successComment: false, failComment: false}]
+ - ['@eshepelyuk/semantic-release-helm-oci', {registry: 'oci://ghcr.io/schemahero/helm', skipAppVersion: true}]Without this change, CI/CD will fail at the release step. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| apiVersion: v2 | ||
| name: schemahero | ||
| description: Install and configure SchemaHero in Kubernetes. | ||
| type: application | ||
| version: 0.0.0 # chart version introspected from git release tags | ||
| appVersion: 0.13.1 | ||
| icon: https://raw.githubusercontent.com/schemahero/schemahero/main/artwork/color/svg/schemahero-logomark-color.svg | ||
| home: https://github.com/schemahero/schemahero-helm | ||
| maintainers: | ||
| - name: Ievgenii Shepeliuk | ||
| email: [email protected] | ||
| url: https://github.com/eshepelyuk | ||
| keywords: | ||
| - schemahero | ||
| - database | ||
| - kubernetes | ||
| - postgresql | ||
| - migration | ||
| annotations: | ||
| artifacthub.io/links: | | ||
| - name: SchemaHero site | ||
| url: https://schemahero.io/ | ||
| - name: SchemaHero sources | ||
| url: https://github.com/schemahero/schemahero | ||
|
|
||
| artifacthub.io/crds: | | ||
| - kind: Database | ||
| version: v1alpha4 | ||
| name: database | ||
| displayName: Database | ||
| description: Database is the Schema for the databases API | ||
| - kind: Migration | ||
| version: v1alpha4 | ||
| name: migration | ||
| displayName: Migration | ||
| description: Migration is the Schema for the migrations API | ||
| - kind: Table | ||
| version: v1alpha4 | ||
| name: table | ||
| displayName: Table | ||
| description: Table is the Schema for the tables API | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
CPU pattern too restrictive for valid Kubernetes quantities
^[0-9]+[m]?$forbids fractional cores such as0.5, which are valid CPU requests/limits.Consider a more permissive regex (or simply rely on Kubernetes validation).
📝 Committable suggestion
🤖 Prompt for AI Agents