Skip to content

Commit

Permalink
CI: rough check that schema changes seem to mention added, don't dele…
Browse files Browse the repository at this point in the history
…te non-deprcated.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Jan 4, 2023
1 parent 0e2fbb4 commit c725d22
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,14 @@ doc/index.rst: $(MANPAGES:=.md)
sed 's/\(.*\)\.\(.*\).*\.md/\1 <\1.\2.md>/' | \
python3 devtools/blockreplace.py doc/index.rst manpages --language=rst --indent " " \
)

# For CI to (very roughly!) check that we only deprecated fields, or labelled added ones
schema-added-check:
@if git diff master doc/schemas | grep -q '^+.*{' && ! git diff master doc/schemas | grep -q '^+.*"added"'; then echo 'New schema fields must have "added": "vNEXTVERSION"' >&2; exit 1; fi

schema-removed-check:
@if git diff master doc/schemas | grep -q '^-.*{' && ! git diff master doc/schemas | grep -q '^-.*"deprecated": "'; then echo 'Schema fields must be deprecated, with version, not removed' >&2; exit 1; fi

schema-diff-check: schema-added-check schema-removed-check

check-source: schema-diff-check

0 comments on commit c725d22

Please sign in to comment.