Add CI check which verifies that all the automatically generated files
have been re-generated, committed and included in the changeset.
@@ -459,6 +459,24 @@ ci-checks: compile .pylint .flake8 .bandit .st2client-dependencies-check .st2com
@echo
. $(VIRTUALENV_DIR)/bin/activate; rstcheck --report warning CHANGELOG.rst
+.PHONY: .generated-files-check
+.generated-files-check:
+ # Verify that all the files which are automatically generated have indeed been re-generated and
+ # committed
+ @echo "==================== generated-files-check ===================="
+
+ # 1. Sample config
+ cp conf/st2.conf.sample /tmp/st2.conf.sample.upstream
+ make .configgen
+ diff conf/st2.conf.sample /tmp/st2.conf.sample.upstream || echo "conf/st2.conf.sample hasn't been re-generated and committed. Please run \"make configgen\" and include and commit the generated file."
+
+ # 2. openapi.yaml file
+ cp st2common/st2common/openapi.yaml /tmp/openapi.yaml.upstream
+ make .generate-api-spec
+ diff st2common/st2common/openapi.yaml /tmp/openapi.yaml.upstream || echo "st2common/st2common/openapi.yaml hasn't been re-generated and committed. Please run \"make generate-api-spec\" and include and commit the generated file."
+
+ @echo "All automatically generated files are up to date."
+
.PHONY: ci-unit
ci-unit: .unit-tests-coverage-html
