Skip to content

Commit

Permalink
improvement/added-pre-commit-and-linting (#125)
Browse files Browse the repository at this point in the history
* Pre commit with prettier
Linter run

* improvement/added pre commit and linting

* Version bump

* Conf for linter

* improvement/added pre commit and linting

* improvement/added pre commit and linting

* improvement/added pre commit and linting
  • Loading branch information
dabeeeenster authored Mar 23, 2023
1 parent 26bf53f commit e027608
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 26 deletions.
7 changes: 4 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ Thanks for submitting a PR! Please check the boxes below:

- [ ] I have filled in the "Changes" section below?
- [ ] I have filled in the "How did you test this code" section below?
- [ ] I have bumped the version number in `/charts/flagsmith/Chart.yaml` in the section `version` or I'm merging to a release branch
- [ ] I have bumped the version number in `/charts/flagsmith/Chart.yaml` in the section `version` or I'm merging to a
release branch

## Changes

*Please describe.*
_Please describe._

## How did you test this code?

<!-- If the answer is manually, please include a quick step-by-step on how to test this PR. -->

*Please describe.*
_Please describe._
2 changes: 1 addition & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
fi
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml
run: ct lint --config ct.yaml --lint-conf lintconf.yaml

- name: Create kind cluster
uses: helm/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ venv/
.envrc
.vscode
charts/*/charts
.direnv
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
21 changes: 21 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"proseWrap": "always",
"singleQuote": true,
"printWidth": 120,
"trailingComma": "all",
"tabWidth": 4,
"overrides": [
{
"files": "**/*.md",
"options": {
"tabWidth": 1
}
},
{
"files": ["**/*.yml", "**/*.yaml"],
"options": {
"tabWidth": 2
}
}
]
}
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Flagsmith Charts

Official Helm charts for Flagsmith, [https://flagsmith.github.io/flagsmith-charts/](https://flagsmith.github.io/flagsmith-charts/)
Official Helm charts for Flagsmith,
[https://flagsmith.github.io/flagsmith-charts/](https://flagsmith.github.io/flagsmith-charts/)

- [Flagsmith](./charts/flagsmith/)

Expand All @@ -16,7 +17,16 @@ Or by adding the following into `helmfile.yaml`:

```yaml
repositories:
# ...
- name: flagsmith
url: https://flagsmith.github.io/flagsmith-charts/
# ...
- name: flagsmith
url: https://flagsmith.github.io/flagsmith-charts/
```
## Development
We use [pre-commit](https://pre-commit.com/index.html#install) for linting. You can install and run with:
```bash
pip install pre-commit
pre-commit run --all-files
```
2 changes: 1 addition & 1 deletion charts/flagsmith/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: flagsmith
description: Flagsmith
type: application
version: 0.16.0
version: 0.16.1
appVersion: 2.42.1
dependencies:
- name: postgresql
Expand Down
8 changes: 5 additions & 3 deletions charts/flagsmith/OPENSHIFT.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Openshift

In order to install Flagsmith to OpenShift you need to provide the domain of the OpenShift cluster and the destination namespace in the helm call. Futhermore, you need to include the values files `openshift` in order to create the routes for the Flagsmith deployments. The command looks likes this:
In order to install Flagsmith to OpenShift you need to provide the domain of the OpenShift cluster and the destination
namespace in the helm call. Futhermore, you need to include the values files `openshift` in order to create the routes
for the Flagsmith deployments. The command looks likes this:

``` bash
```bash
helm install flagsmith ./flagsmith-kubernetes -f flagsmith-kubernetes/openshift-values.yaml --set frontend.env[0].name=API_URL,frontend.env[0].value=http://flagsmith-api-<Release Namespace>.<OpenShift domain>/api/v1/,frontend.env[1].name=ASSET_URL,frontend.env[1].value=/ --set openshiftdomain=<OpenShift domain>
```

An example for the Flagsmith installation for a minishift cluster looks like this:

``` bash
```bash
helm install flagsmith ./flagsmith-kubernetes -f flagsmith-kubernetes/openshift-values.yaml --set frontend.env[0].name=API_URL,frontend.env[0].value=http://flagsmith-api-flagsmith.my.openshift.domain.com/api/v1/,frontend.env[1].name=ASSET_URL,frontend.env[1].value=/ --set openshiftdomain=my.openshift.domain.com --dry-run
```
3 changes: 2 additions & 1 deletion charts/flagsmith/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Flagsmith Helm chart

For documentation on this Helm chart, please refer to the [Flagsmith Docs](https://docs.flagsmith.com/deployment/kubernetes).
For documentation on this Helm chart, please refer to the
[Flagsmith Docs](https://docs.flagsmith.com/deployment/kubernetes).
7 changes: 3 additions & 4 deletions charts/flagsmith/openshift-values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
postgresql:
volumePermissions:
securityContext:
runAsUser:"auto"
securityContext: runAsUser:"auto"
securityContext:
enabled: false
fsGroup: "0"
openshift: true
fsGroup: '0'
openshift: true
16 changes: 8 additions & 8 deletions charts/flagsmith/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
api:
image:
repository: flagsmith/flagsmith-api
tag: null # defaults to .Chart.AppVersion
tag: null # defaults to .Chart.AppVersion
imagePullPolicy: IfNotPresent
imagePullSecrets: []
# Note that if setting this to false, need to set
Expand Down Expand Up @@ -78,7 +78,7 @@ frontend:
enabled: true
image:
repository: flagsmith/flagsmith-frontend
tag: null # defaults to .Chart.AppVersion
tag: null # defaults to .Chart.AppVersion
imagePullPolicy: IfNotPresent
imagePullSecrets: []
replicacount: 1
Expand Down Expand Up @@ -223,14 +223,14 @@ pgbouncer:
influxdb2:
enabled: true
adminUser:
organization: "influxdata"
bucket: "default"
user: "admin"
retention_policy: "0s"
organization: 'influxdata'
bucket: 'default'
user: 'admin'
retention_policy: '0s'
## Leave empty to generate a random password and token.
## Or fill any of these values to use fixed values.
password: ""
token: ""
password: ''
token: ''
persistence:
enabled: false
# storageClass: "-"
Expand Down
3 changes: 3 additions & 0 deletions lintconf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rules:
comments:
min-spaces-from-content: 1

0 comments on commit e027608

Please sign in to comment.