Skip to content

Commit

Permalink
add make-generate to pre-commit (#491)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced a new pre-commit hook (`run-make-generate`) to automate the
generation process in application directories.
  
- **Documentation**
- Enhanced readability of the Managed NATS Service README by adjusting
formatting and removing unnecessary headers.

- **Bug Fixes**
- Corrected JSON structure in the Postgres values schema to ensure
validity.

- **Chores**
- Updated pre-commit configuration for improved consistency and
functionality.
- Reorganized properties in the NATS values schema, removing the `users`
property to reflect changes in user management capabilities.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
klinch0 authored Dec 2, 2024
1 parent 2b10fb2 commit f73a5a0
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 38 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ jobs:
- name: Install pre-commit
run: pip install pre-commit

- name: Install generate
run: |
sudo apt update
sudo apt install curl -y
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install nodejs -y
git clone https://github.com/bitnami/readme-generator-for-helm
cd ./readme-generator-for-helm
npm install
npm install -g pkg
pkg . -o /usr/local/bin/readme-generator
- name: Run pre-commit hooks
run: |
git fetch origin main || git fetch origin master
Expand Down
17 changes: 15 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
repos:
- repo: local
hooks:
- repo: local
hooks:
- id: gen-versions-map
name: Generate versions map and check for changes
entry: sh -c 'make -C packages/apps check-version-map && make -C packages/extra check-version-map'
language: system
types: [file]
pass_filenames: false
description: Run the script and fail if it generates changes
- id: run-make-generate
name: Run 'make generate' in all app directories
entry: |
/bin/bash -c '
for dir in ./packages/apps/*/; do
if [ -d "$dir" ]; then
echo "Running make generate in $dir"
(cd "$dir" && make generate)
fi
done
'
language: script
files: ^.*$
7 changes: 1 addition & 6 deletions packages/apps/nats/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,4 @@
| `external` | Enable external access from outside the cluster | `false` |
| `replicas` | Persistent Volume size for NATS | `2` |
| `storageClass` | StorageClass used to store the data | `""` |

### Configuration parameters

| Name | Description | Value |
| ----------- | ----------------------- | ----- |
| `users` | Users configuration | `{}` |
| `users` | Users configuration | `{}` |
44 changes: 15 additions & 29 deletions packages/apps/nats/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,20 @@
"title": "Chart Values",
"type": "object",
"properties": {
"external": {
"type": "boolean",
"description": "Enable external access from outside the cluster",
"default": false
},
"replicas": {
"type": "number",
"description": "Persistent Volume size for NATS",
"default": 2
},
"storageClass": {
"type": "string",
"description": "StorageClass used to store the data",
"default": ""
},
"users": {
"type": "object",
"description": "Users configuration",
"additionalProperties": {
"type": "object",
"properties": {
"password": {
"type": "string",
"description": "Password for the user"
}
}
"external": {
"type": "boolean",
"description": "Enable external access from outside the cluster",
"default": false
},
"default": {}
}
"replicas": {
"type": "number",
"description": "Persistent Volume size for NATS",
"default": 2
},
"storageClass": {
"type": "string",
"description": "StorageClass used to store the data",
"default": ""
}
}
}
}
2 changes: 1 addition & 1 deletion packages/apps/postgres/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@
}
}
}
}
}

0 comments on commit f73a5a0

Please sign in to comment.