diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml new file mode 100644 index 0000000..2d7d611 --- /dev/null +++ b/.github/workflows/lint-pr.yml @@ -0,0 +1,41 @@ +name: "Lint PR" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - name: lint_pr_title + id: lint_pr_title + uses: amannn/action-semantic-pull-request@v5.1.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: marocchino/sticky-pull-request-comment@v2 + # When the previous steps fails, the workflow would stop. By adding this + # condition you can continue the execution with the populated error message. + if: always() && (steps.lint_pr_title.outputs.error_message != null) + with: + header: pr-title-lint-error + message: | + Hey there and thank you for opening this pull request! 👋🏼 + + We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted. + + Details: + + ``` + ${{ steps.lint_pr_title.outputs.error_message }} + ``` + # Delete a previous comment when the issue has been resolved + - if: ${{ steps.lint_pr_title.outputs.error_message == null }} + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: pr-title-lint-error + delete: true diff --git a/charts/keep/Chart.yaml b/charts/keep/Chart.yaml index bcefcd1..1bf14b0 100644 --- a/charts/keep/Chart.yaml +++ b/charts/keep/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: keep -version: 0.0.3 +version: 0.0.4 description: Keep Helm Chart type: application icon: https://platform.keephq.dev/_next/image?url=%2Fkeep.png&w=48&q=75 diff --git a/charts/keep/README.md b/charts/keep/README.md index 0191b21..9bacc45 100644 --- a/charts/keep/README.md +++ b/charts/keep/README.md @@ -1,6 +1,6 @@ # keep -![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.1](https://img.shields.io/badge/AppVersion-0.2.1-informational?style=flat-square) +![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.1](https://img.shields.io/badge/AppVersion-0.2.1-informational?style=flat-square) Keep Helm Chart @@ -26,15 +26,18 @@ Keep Helm Chart | backend.autoscaling.maxReplicas | int | `3` | | | backend.autoscaling.minReplicas | int | `1` | | | backend.autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| backend.databaseConnectionStringFromSecret.enabled | bool | `false` | | +| backend.databaseConnectionStringFromSecret.secretKey | string | `""` | | +| backend.databaseConnectionStringFromSecret.secretName | string | `""` | | | backend.enabled | bool | `true` | | -| backend.env[0].name | string | `"SECRET_MANAGER_TYPE"` | | -| backend.env[0].value | string | `"k8s"` | | -| backend.env[1].name | string | `"PORT"` | | -| backend.env[1].value | string | `"8080"` | | -| backend.env[2].name | string | `"SECRET_MANAGER_DIRECTORY"` | | -| backend.env[2].value | string | `"/state"` | | -| backend.env[3].name | string | `"DATABASE_CONNECTION_STRING"` | | -| backend.env[3].value | string | `"mysql+pymysql://root@keep-database:3306/keep"` | | +| backend.env[0].name | string | `"DATABASE_CONNECTION_STRING"` | | +| backend.env[0].value | string | `"mysql+pymysql://root@keep-database:3306/keep"` | | +| backend.env[1].name | string | `"SECRET_MANAGER_TYPE"` | | +| backend.env[1].value | string | `"k8s"` | | +| backend.env[2].name | string | `"PORT"` | | +| backend.env[2].value | string | `"8080"` | | +| backend.env[3].name | string | `"SECRET_MANAGER_DIRECTORY"` | | +| backend.env[3].value | string | `"/state"` | | | backend.env[4].name | string | `"PUSHER_APP_ID"` | | | backend.env[4].value | int | `1` | | | backend.env[5].name | string | `"PUSHER_APP_KEY"` | | diff --git a/charts/keep/templates/keep-backend.yaml b/charts/keep/templates/keep-backend.yaml index 641e962..edb9715 100644 --- a/charts/keep/templates/keep-backend.yaml +++ b/charts/keep/templates/keep-backend.yaml @@ -53,6 +53,13 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace + {{- if .Values.backend.databaseConnectionStringFromSecret.enabled }} + - name: DATABASE_CONNECTION_STRING + valueFrom: + secretKeyRef: + name: {{ .Values.backend.databaseConnectionStringFromSecret.secretName }} + key: {{ .Values.backend.databaseConnectionStringFromSecret.secretKey }} + {{- end }} volumeMounts: - name: state-volume mountPath: /state diff --git a/charts/keep/templates/keep-db-service.yaml b/charts/keep/templates/keep-db-service.yaml index 38ba5ed..bad6d8f 100644 --- a/charts/keep/templates/keep-db-service.yaml +++ b/charts/keep/templates/keep-db-service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "keep.fullname" . }}-database + name: {{ include "keep.name" . }}-database labels: {{- include "keep.labels" . | nindent 4 }} keep-component: database-service diff --git a/charts/keep/values.yaml b/charts/keep/values.yaml index 9450627..c92b175 100644 --- a/charts/keep/values.yaml +++ b/charts/keep/values.yaml @@ -11,15 +11,21 @@ backend: # if true, wait for the database to be ready before starting the API # if you use external database, you can set this to false waitForDatabase: true + # if true, the database connection string will be read from a secret + # if it is false, the DATABASE_CONNECTION_STRING value can be set directly + databaseConnectionStringFromSecret: + enabled: false + secretName: "" + secretKey: "" env: + - name: DATABASE_CONNECTION_STRING + value: mysql+pymysql://root@keep-database:3306/keep - name: SECRET_MANAGER_TYPE value: k8s - name: PORT value: "8080" - name: SECRET_MANAGER_DIRECTORY value: /state - - name: DATABASE_CONNECTION_STRING - value: mysql+pymysql://root@keep-database:3306/keep - name: PUSHER_APP_ID value: 1 - name: PUSHER_APP_KEY diff --git a/ct.yaml b/ct.yaml index 156aeee..e4e5e8a 100644 --- a/ct.yaml +++ b/ct.yaml @@ -1,10 +1,8 @@ remote: origin target-branch: main debug: true -check-version-increment: false +check-version-increment: true helm-extra-args: --timeout 15m validate-maintainers: false charts: - charts/keep -chart-repos: - - keep=https://keephq.github.io/helm-charts