Skip to content

Commit

Permalink
Add pre-commit hook for validating release notes
Browse files Browse the repository at this point in the history
- This is a pre-commit hook using `pre-commit` framework to validate release notes YAML files.
- The hook checks for correct structure, formatting and required fields in the `release-notes` directory.
- This ensures consistency in release notes before committing changes.
- Added release notes validation to the `make syntax-check` target

Ref: #934 (comment)
  • Loading branch information
aaradhak committed Aug 20, 2024
1 parent 9aee93a commit 3d00f48
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: local
hooks:
- id: validate-release-notes
name: Validate Release Notes
entry: python ci/check-release-notes.py
language: python
files: ^release-notes/.*\.yml$
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: syntax-check
syntax-check:
@find streams updates -iname '*.json' | sort | xargs -n 1 python3 -c 'import json, sys; json.load(open(sys.argv[1]))'
.PHONY: syntax-check pre-commit-check print-rollouts

.PHONY: print-rollouts
syntax-check: pre-commit-check
@find streams updates -iname '*.json' | sort | xargs -n 1 python3 -c 'import json, sys; json.load(open(sys.argv[1]))'
@find release-notes -iname '*.yaml' | sort | xargs -n1 python3 ci/check-release-notes.py
print-rollouts:
@find updates -iname '*.json' -printf '%f\n' | cut -f1 -d. | sort | xargs ./rollout.py print

0 comments on commit 3d00f48

Please sign in to comment.