Skip to content

Commit

Permalink
Add pre-commit hook (#16)
Browse files Browse the repository at this point in the history
Add pre-commit hook to the repository.
  • Loading branch information
antejavor authored Apr 25, 2024
1 parent 6e56cfe commit 1952015
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Bug Report
description: File a bug report
description: File a bug report
title: "[Bug]: "
labels: ["bug"]
assignees:
Expand Down Expand Up @@ -34,7 +34,7 @@ body:
options:
- Standalone
validations:
required: true
required: true
- type: dropdown
id: version
attributes:
Expand All @@ -57,7 +57,7 @@ body:
- Microsoft Azure
- My environment is not listed
validations:
required: true
required: true
- type: textarea
id: logs
attributes:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Pre-commit

on: pull_request

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2 # fetches all history so pre-commit can run properly

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9' # Use Python 3.9

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure

- name: Cache the pre-commit environment
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@v3
env:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run chart-releaser
Expand Down
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
exclude: ^charts/memgraph/templates/
- id: check-json
- id: mixed-line-ending
- id: check-merge-conflict
- id: detect-private-key
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ Both types of fixes should be applied to the `main` branch.

In order for a pull request to be merged, a review by two code owners is required and the tests need to pass remotely.

## Contact
## Contact

If you need help with contributing to the Memgraph Helm Charts Repository, join our [Discord server](https://discord.gg/memgraph) or contact us at <tech@memgraph.com>.
If you need help with contributing to the Memgraph Helm Charts Repository, join our [Discord server](https://discord.gg/memgraph) or contact us at <tech@memgraph.com>.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@ Contributions are welcome! If you have any improvements, bug fixes, or new chart
</p>

## License
This repository is licensed under the [Apache 2.0 License](https://github.com/memgraph/helm-charts/blob/main/LICENSE).

This repository is licensed under the [Apache 2.0 License](https://github.com/memgraph/helm-charts/blob/main/LICENSE).
2 changes: 1 addition & 1 deletion charts/memgraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ parameter | description | default

The `memgraphConfig` parameter should be a list of strings defining the values of Memgraph configuration settings. For example, this is how you can define `memgraphConfig` parameter in your `values.yaml`:
```
memgraphConfig:
memgraphConfig:
- "--also-log-to-stderr=true"
- "--log-level=TRACE"
```
Expand Down
6 changes: 2 additions & 4 deletions charts/memgraph/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ Make sure your are connecting to the correct ip address of your instance. For de

If you are connecting via mgconsole, you can use the following command:

mgconsole --host <your-instance-ip> --port <your-instance-port>

If you are connecting via Lab, specify your instance ip address and port in Memgraph Lab GUI.

mgconsole --host <your-instance-ip> --port <your-instance-port>

If you are connecting via Lab, specify your instance ip address and port in Memgraph Lab GUI.
4 changes: 2 additions & 2 deletions charts/memgraph/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ spec:
targetPort: {{ .Values.service.targetPort}}
protocol: {{ .Values.service.protocol }}
name: bolt
selector:
{{- include "memgraph.selectorLabels" . | nindent 4 }}
selector:
{{- include "memgraph.selectorLabels" . | nindent 4 }}
2 changes: 1 addition & 1 deletion charts/memgraph/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
containers:
- name: memgraph
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
args:
args:
{{- range .Values.memgraphConfig }}
- {{ . | quote }}
{{- end }}
Expand Down
5 changes: 2 additions & 3 deletions charts/memgraph/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: batch/v1
kind: Job
metadata:
name: "{{ .Release.Name }}-memgraph-test"
labels:
labels:
{{- include "memgraph.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
Expand All @@ -11,11 +11,10 @@ spec:
spec:
containers:
- name: memgraph-test
image: memgraph/memgraph:2.16.0
image: memgraph/memgraph:2.16.0
command: ["/bin/sh", "-c"]
args:
- |
echo "RETURN 0;" | mgconsole --host {{ include "memgraph.fullname" . }} --port 7687
restartPolicy: Never
backoffLimit: 4

25 changes: 12 additions & 13 deletions charts/memgraph/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,24 @@ persistentVolumeClaim:
logPVCSize: 256Mi

memgraphConfig:
- "--also-log-to-stderr=true"
- "--also-log-to-stderr=true"

# Annotations to add to the statefulSet
statefulSetAnnotations: {}
# Annotations to add to the Pod
podAnnotations: {}

resources:
{}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

serviceAccount:
# Specifies whether a service account should be created
Expand Down

0 comments on commit 1952015

Please sign in to comment.