-
Notifications
You must be signed in to change notification settings - Fork 103
add make-generate to pre-commit #491
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
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -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: ^.*$ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+11
to
+23
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 Enhance error handling and documentation for make-generate hook The new hook implementation has several areas for improvement:
Consider this improved implementation: - id: run-make-generate
name: Run 'make generate' in all app directories
entry: |
/bin/bash -c '
+ set -e # Exit on any error
+ if ! command -v make >/dev/null 2>&1; then
+ echo "Error: make is not installed"
+ exit 1
+ fi
for dir in ./packages/apps/*/; do
if [ -d "$dir" ]; then
echo "Running make generate in $dir"
- (cd "$dir" && make generate)
+ (cd "$dir" && make generate) || {
+ echo "Error: make generate failed in $dir"
+ exit 1
+ }
fi
done
'
language: script
- files: ^.*$
+ files: ^packages/apps/.*$ Also, please add documentation about what 'make generate' does and its purpose. 📝 Committable suggestion
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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": "" | ||
} | ||
Comment on lines
+5
to
+19
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. 💡 Codebase verification Removal of users property from schema conflicts with active usage The
Locations needing attention:
🔗 Analysis chainSchema structure looks good but verify impact of users removal The schema properties are well-structured with clear descriptions and appropriate types. However, the removal of the Let's verify the impact of removing the users configuration: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for any references to NATS users configuration
rg -l "users:" ./packages/apps/nats/
Length of output: 110 Script: #!/bin/bash
# Check the content of values.yaml and templates/nats.yaml to understand the usage of users configuration
echo "=== values.yaml ==="
cat ./packages/apps/nats/values.yaml
echo -e "\n=== templates/nats.yaml ==="
cat ./packages/apps/nats/templates/nats.yaml
Length of output: 2449 |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,4 +103,4 @@ | |
} | ||
} | ||
} | ||
} | ||
} |
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.
Security and stability improvements needed for generate tool installation
Several concerns with the current implementation:
Consider these improvements:
Also consider: