Skip to content

Commit 01caf62

Browse files
committed
Regenerate generated code as part of the build
There are a number of cases where people don't realize that the schemas are owned by Redfish, and that some of the generated files (registries, indexes) are in fact generated, and shouldn't be modified by hand. This commit forces a regeneration of all those files within Jenkins, each time we do a local build, then does a git diff to compare if the upstream schema files and generated files are different than what is checked in, it will print the diff immediately in the Jenkins build. This should hopefully give much faster feedback to users that their change needs to modify the right files. As part of this commit, we also need to take the version string out of clang-format. CI/the system should own the clang-format version. Related commit: https://gerrit.openbmc-project.xyz/c/openbmc/openbmc-build-scripts/+/51041] Tested: Ran script, build passed. Removed the schema fixes from patch series, saw build failed. Did the same with running the openbmc-build-scripts unit test script. Signed-off-by: Ed Tanous <[email protected]> Change-Id: I17eb0e106be267e8dbba7053b0b07ec617893c86
1 parent 0a4304c commit 01caf62

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

run-ci

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
# generate the generatable files in CI to make sure they haven't changed
3+
set -e
4+
5+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
6+
7+
"$SCRIPT_DIR/scripts/parse_registries.py"
8+
"$SCRIPT_DIR/scripts/update_schemas.py"
9+
git --no-pager -C "$SCRIPT_DIR" diff --exit-code

scripts/parse_registries.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def make_getter(dmtf_name, header_name, type_name):
5050

5151

5252
def clang_format(filename):
53-
subprocess.check_call(["clang-format-12", "-i", filename])
53+
subprocess.check_call(["clang-format", "-i", filename])
5454

5555

5656
files = []

0 commit comments

Comments
 (0)