These instructions are meant for developers to easily update to a new SARIF version.
Whenever the SARIF version of the output needs to be changed, the following steps are required:
- Navigate to
src/main/resources/json
and replace the existing schema with the new one- SARIF schemas (among others) can be found here
- Recompile the project, the generated files (
build/generated/sources/js2d/main/de/fraunhofer/aisec/codyze/sarif/schema
) should be replaced- In case old files are still present (easily detectable if there is more than one
Sarif*.java
file, where*
stands for the SARIF version) manually delete the generated classes and recompile
- In case old files are still present (easily detectable if there is more than one
- Navigate to the
SarifInstantiator.kt
(src/main/java/de/fraunhofer/aisec/codyze/sarif/
) and update the class members.- The important part can be found in the first few lines, most importantly you need to update the class name of the
sarif
variable as well asschema
andsarifVersion
- Use this occasion to check whether anyone kept the
codyzeVersion
up to date and if the URIs fordownload
andinformation
are still working
- The important part can be found in the first few lines, most importantly you need to update the class name of the
- Execute
SarifInstantiatorTest.kt
(src/test/java/de/fraunhofer/aisec/codyze/crymlin/
)- The
testToString()
might fail if the output differs in theresults
section of the results file, in this case update it accordingly - You can use the generated file of
testOutput()
to test it with the online validator- Even better yet, use the tool with some of the files in
src/test/resources
and validate the output
- Even better yet, use the tool with some of the files in
- The
After the validation was finished successfully, the SARIF version has now been updated!
If there are any new errors while validating the files, additional adaptions in SarifInstantiator.kt
may be needed (especially the pushRun(Set<Finding>)
method), however this should NOT be the case unless the new SARIF version has made big changes to the overall structure.