From 5c318c70d09a530a7bd89f973e931def0ba191a4 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Tue, 5 May 2020 12:23:47 +0200 Subject: vppapigen: api crc checker crcchecker is a tool for enforcement of the binary API. 1. Production APIs should never change. 2. An API can be deprecated across three release cycles. Release 1: API is marked as deprecated. option deprecated="vyy.mm"; option replaced_by="new_api_2"; Release 2: both old and new APIs are supported Release 3: the deprecated API is deleted. 3. APIs that are experimental / not released are not checked. An API message can be individually marked as in progress, by: option status="in_progress"; In the API definition. The definition of a "production API" is if the major version in the API file is > 0. extras/scripts/crcchecker.py --check-patchset # returns -1 if backwards incompatible extras/scripts/crcchecker.py --dump-manifest extras/scripts/crcchecker.py --git-revision v20.01 extras/scripts/crcchecker.py -- diff This patch integrates the tool in "make checkstyle-api". A future patch is required to integrate the tool in the verify job. I.e. this patch does not enable enforcement through Jenkins. Change-Id: I5f13c0976d8a12a58131b3e270f2dc9c00dc7d8c Type: feature Signed-off-by: Ole Troan --- src/tools/vppapigen/vppapigen_crc.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/tools/vppapigen/vppapigen_crc.py (limited to 'src/tools/vppapigen/vppapigen_crc.py') diff --git a/src/tools/vppapigen/vppapigen_crc.py b/src/tools/vppapigen/vppapigen_crc.py new file mode 100644 index 00000000000..b3cb5855c9d --- /dev/null +++ b/src/tools/vppapigen/vppapigen_crc.py @@ -0,0 +1,16 @@ +# CRC generation +import json + +# +# Plugin entry point +# +def run(args, input_filename, s): + j = {} + major = 0 + if 'version' in s['Option']: + v = s['Option']['version'] + (major, minor, patch) = v.split('.') + for t in s['Define']: + j[t.name] = {'crc': f'{t.crc:#08x}', 'version': major, + 'options': t.options} + return json.dumps(j, indent=4, separators=(',', ': ')) -- cgit 1.2.3-korg